Summary
Fa2VsstbNzStoreKernel (Flash-Attention-4 softmax output store: fp32→fp16 + deinterleave + NZ-format block-strided store) is a 1:1 CCE↔DSL port whose golden matches exactly, but the DSL lowering is instruction-heavy because VMI cannot express the fused multiply+cast. Three gaps, the first dominant:
- No fused
vmulscvt in VMI (dominant) — CCE fuses scalar-mul + fp32→f16 cast into one vmulscvt(PART_EVEN). VMI must emit vmuls + vcvt separately, then repack the cast result with vbitcast + vpack LOWER + vbitcast (3 extra ops) before it is storable. Per stream: CCE 1 instr → DSL 5.
- Store doubling (no
vdintlv stream-pairing) — CCE pairs two 64-f16 streams into one 128-f16 via vdintlv → one 128-elem vsstb. The DSL stores each stream separately → 4 vsstb/iter vs CCE's 2.
- PTOAS
vstore repeat_stride encoding bug (separate, documented) — vstore(..., repeat_stride=1) lowers to vsstb with Sm_rs = repeat_stride + 2 (0x00410002 instead of 0x00410001), forcing the low-level vsstb + explicit scalar bs path.
Motivation / use case
FA
Proposed API / behavior
No response
Alternatives considered
No response
Additional context
No response
Summary
Fa2VsstbNzStoreKernel(Flash-Attention-4 softmax output store: fp32→fp16 + deinterleave + NZ-format block-strided store) is a 1:1 CCE↔DSL port whose golden matches exactly, but the DSL lowering is instruction-heavy because VMI cannot express the fused multiply+cast. Three gaps, the first dominant:vmulscvtin VMI (dominant) — CCE fuses scalar-mul + fp32→f16 cast into onevmulscvt(PART_EVEN). VMI must emitvmuls+vcvtseparately, then repack the cast result withvbitcast + vpack LOWER + vbitcast(3 extra ops) before it is storable. Per stream: CCE 1 instr → DSL 5.vdintlvstream-pairing) — CCE pairs two 64-f16 streams into one 128-f16 viavdintlv→ one 128-elemvsstb. The DSL stores each stream separately → 4vsstb/iter vs CCE's 2.vstorerepeat_strideencoding bug (separate, documented) —vstore(..., repeat_stride=1)lowers tovsstbwithSm_rs = repeat_stride + 2(0x00410002instead of0x00410001), forcing the low-levelvsstb+ explicit scalarbspath.Motivation / use case
FA
Proposed API / behavior
No response
Alternatives considered
No response
Additional context
No response