Rate this Page

Helion Examples#

This directory contains examples demonstrating how to use Helion for high-performance tensor operations. The examples are organized into the following categories:

Basic Operations#

  • add.py: Element-wise addition with broadcasting support

  • exp.py: Element-wise exponential function

  • sum.py: Sum reduction along the last dimension

  • long_sum.py: Efficient sum reduction along a long dimension

  • softmax.py: Different implementations of the softmax function

Matrix Multiplication Operations#

Attention Operations#

Normalization#

Sparse and Jagged Tensors#

Distributed Operations#

  • distributed/all_gather_matmul.py: All-gather operation followed by matrix multiplication

  • distributed/all_reduce.py: All-reduce operation (one-shot)

Other Operations#