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

  • concatenate.py: Tensor concatenation along a dimension

  • low_mem_dropout.py: Memory-efficient dropout implementation

Matrix Multiplication Operations#

Attention Operations#

Normalization#

Activation Functions#

  • geglu.py: Gated Linear Unit (GEGLU) activation

  • swiglu.py: SwiGLU activation function

Loss Functions#

Sparse and Jagged Tensors#

Sequence Models#

Statistics#

  • welford.py: Welford’s online algorithm for computing variance

Neural Network Components#

Distributed Operations#