Skip to content

feat(vpto): add A2/A3 MGATHER lowering - #3

Open
castigli wants to merge 2 commits into
feature/a2a3-tgather-mgather-vptofrom
feature/a2a3-mgather-vpto
Open

feat(vpto): add A2/A3 MGATHER lowering#3
castigli wants to merge 2 commits into
feature/a2a3-tgather-mgather-vptofrom
feature/a2a3-mgather-vpto

Conversation

@castigli

@castigli castigli commented Jul 23, 2026

Copy link
Copy Markdown
Owner

Summary

Stacked on hw-native-sys#971.

  • lower A2/A3 VPTO GM-to-UB pto.mgather for Coalesce::Row and Coalesce::Elem with Undefined, Clamp, Wrap, and Zero OOB behavior
  • support i8/ui8/i16/ui16/i32/ui32/f16/bf16/f32 payloads while requiring exact GM/destination type agreement and signless i32 indices
  • use scalar index handling plus 32-byte-aligned per-row MTE2 copies for Row, and direct flat scalar GM/UB access for dense Elem tables
  • enforce a fail-closed A2/A3 safe subset: static positive and representable table metadata, row-major none-box UB tiles, no row_plus_one, explicit coalesce, no scratch, exact Row width, and dense contiguous Elem sources
  • preserve the reserved EVENT_ID0 scalar-to-MTE2 synchronization contract and reject the deferred GM-to-L1 path
  • expose pto.tile.mgather in PTODSL and add NumPy-golden A3 NPU coverage for every Row/Elem and OOB-mode combination
  • materialize MGATHER tile handles only for VPTO and clean late identity pointer casts before emission validation

Validation

  • hardened Docker ptoas build: passed
  • full gather lit directory: 7/7 passed
  • A2 and A3 VPTO LLVM compilation: passed for the full supported payload matrix
  • broader vpto/ub lit directory: 75/76 passed; the remaining A5 TileLib test is the known Python-bindings-disabled failure (lower_tadd_noop.pto)
  • PTODSL vector/cube unit tests: 37 passed, 117 subtests passed
  • all eight PTODSL MGATHER kernels compiled through the A3 VPTO toolchain offline
  • A3 NPU numerical tests: 8/8 passed, covering Row and Elem with each of Undefined, Zero, Clamp, and Wrap

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant