Repository navigation
[ASM] [Bugfix] Scale gfx942 v3 FP8 FMHA probabilities before conversion - #6139
akshatvishu wants to merge 2 commits into
Conversation
Signed-off-by: akshatvishu <[email protected]>
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
One backend per PR: PR title tags & labels: |
|
No activity for 15 days, so this is now labelled |
|
keep-open |
|
No activity for 15 days, so this is now labelled |
|
@akshatvishu Thanks for tracking this down. The underflow is real at these sequence lengths, and the ISA diff makes the change easy to follow. One suggestion that may remove most of the cost: instead of 32 Beyond that:
|
Summary
Fix the reported gfx942 dense v3 FP8 FMHA probability underflow in #6137. The constant-V stress case returns about 0.42 in the original binary because its FP8 PV numerator drops small exponentials while the FP32 denominator retains them. The patched binary passes the regression with absolute tolerance 0.01.
Changes
docs/examples/isa_optimization/.Only
hsa/gfx942/fmha_v3_fwd/MI300/fwd_hd128_fp8.cochanges. Sibling causal/grouped/MI308 code objects are not claimed fixed. The Sage part of #6137 is a separate PR, following the one-backend-per-PR contribution rule.Binary audit
The original object disassembles and reassembles with identical
.text, descriptor, metadata and target flags using the repository'sroundtrip.sh. Re-extracting the patched object produces exactly the intended instruction sequence. Removing the 193 inserted multiplications recovers the original assembly. VGPRs, SGPRs and LDS allocation are unchanged.7bffc09e0fea2165b609e3661c896839bff3d0418e4511e99ef62bc2101c8b04.e5575cb14fe020289f31dd0653d213f792724b71a76a993219eae215fda435dc.The public tree contains the code object without its instruction generator. The included ISA diff makes this repair reproducible; apply the same arithmetic in the generator when regenerating it. Related open #5535 uses probability scaling for a different gfx950 MLA object.
Testing
2.12.0+git6bbd260.git diff --checkpass.Performance
This correctness repair has a measured cost. Full-operation pooled medians in microseconds, including caller Q/K/V quantization, over six captures and three rounds of ten unprofiled event measurements per cache mode:
Original and patched arms use separate processes; BF16 controls remain around 527 to 530 microseconds primed. These operation measurements do not establish request latency or image quality. FP8 input quantization and probability rounding remain. No new dependencies or public API changes; other architectures and code objects were not tested.