IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /max/get-started.md). For the complete documentation index, see llms.txt.
Skip to main content
For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /max/get-started.md).

Mojo module

apple_amx_intrinsics

Provides low-level wrappers around Apple's AMX assembly instruction set for matrix operations.

Functions​

  • ​dot_at_b: Performs a matrix multiply C = A^T * B using Apple AMX instructions.
  • ​extrx: Extracts a row or moves it to x, result in amx0.
  • ​extry: Extracts a row or moves it to y, result in amx0.
  • ​fma: Issues an AMX fused multiply-add of X and Y register rows accumulated into the Z accumulator.
  • ​fma16: Float16 matrix multiply and subtract.
  • ​fma32: Float32 matrix multiply and add.
  • ​fma64: Float64 matrix multiply and add.
  • ​fms16: Float16 matrix multiply and add.
  • ​fsm32: Float32 matrix multiply and subtract.
  • ​fsm64: Float64 matrix multiply and subtract.
  • ​genlut: Issues the Apple AMX genlut instruction using the address encoded in gpr.
  • ​ldx: Loads data from the memory address encoded in gpr into an AMX X register row.
  • ​ldy: Loads data from the memory address encoded in gpr into an AMX Y register row.
  • ​ldz: Loads data from the memory address encoded in gpr into an AMX Z accumulator row.
  • ​ldzi: Loads data from the memory address encoded in gpr into an AMX Z accumulator row using interleaved layout.
  • ​load_z: Stores row_count rows from AMX Z accumulator registers starting at start_index to memory at src.
  • ​mac16: SI16 matrix multiply and add.
  • ​matfp: Float16 matrix multiply.
  • ​max_int__: UI16 matrix multiply.
  • ​read_x: Stores row_count rows from AMX X registers starting at start_index to memory at src.
  • ​read_y: Stores row_count rows from AMX Y registers starting at start_index to memory at src.
  • ​store_x: Loads row_count rows from memory at src into AMX X registers starting at start_index.
  • ​store_y: Loads row_count rows from memory at src into AMX Y registers starting at start_index.
  • ​store_z: Loads row_count rows from memory at src into AMX Z accumulator registers starting at start_index.
  • ​stx: Stores an AMX X register row to the memory address encoded in gpr.
  • ​sty: Stores an AMX Y register row to the memory address encoded in gpr.
  • ​stz: Stores an AMX Z accumulator row to the memory address encoded in gpr.
  • ​stzi: Stores an AMX Z accumulator row to the memory address encoded in gpr using interleaved layout.
  • ​transpose_z_to_x_or_y: Transposes a downsampled column of the AMX Z register into a row of the X or Y register.
  • ​vec_int__: Horizontal ui16 multiply z0[i] += x0[i] + y0[i].
  • ​vecfp: Horizontal float16 multiply z0[i] += x0[i] + y0[i].

Was this page helpful?