Skip to content

fix(vmi): materialize packed group-slot widening - #1230

Open
Zhendong404 wants to merge 1 commit into
mainfrom
codex/fix-vmi-packed-group-slots-widening
Open

fix(vmi): materialize packed group-slot widening#1230
Zhendong404 wants to merge 1 commit into
mainfrom
codex/fix-vmi-packed-group-slots-widening

Conversation

@Zhendong404

@Zhendong404 Zhendong404 commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • materialize compact group_slots widening with vcvt partition streams and register interleaves
  • support 2x and 4x storage-width widening for floating-point and integer VMI extension lowering
  • derive and validate 256-byte physical carriers per chunk; avoid invalid logical-size VPTO vregs
  • add BF16 8/12-group and UI8 widening coverage through public VMI ops

Scope

This PR fixes the lowering required to express the ASC-style group-result conversion/store sequence. It does not rewrite the #1209 reproducer end to end or establish an A5 performance result by itself.

Root cause

A grouped BF16 reduction produces compact group_slots values. Widening those values partitions compact source lanes (EVEN/ODD for 2x, P0..P3 for 4x); the old lowering had no legal materialization that restored their original lane order before a group store.

The current #1209 VMI fixture works around this limitation by widening the full abs_bits vector to f32 and running a second f32 group reduction for scale_out. ASC instead reuses the BF16 grouped maximum directly (vcgmax -> bitcast -> vcvt PART_EVEN -> store). Thus this PR removes the lowering blocker, but the fixture must still be rewritten to consume the original group maximum before the VMI source algorithm aligns with ASC.

Lowering

  • 2x: vcvt EVEN, vcvt ODD, then vintlv.low
  • 4x: vcvt P0..P3, then three vintlv.low operations

slots=1 remains on the existing sparse path and is deliberately excluded.

Validation

  • full local ninja build
  • llvm-lit 7 focused VMI tests, all passed
  • git diff --check

Relates to #1209.

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.

2 participants