Skip to content

[Cute,Fwd,Sm100] Fix FP8 precision loss at tile boundaries#2578

Open
Robin930 wants to merge 1 commit into
Dao-AILab:mainfrom
Robin930:fix/fp8-rescale-threshold-overflow
Open

[Cute,Fwd,Sm100] Fix FP8 precision loss at tile boundaries#2578
Robin930 wants to merge 1 commit into
Dao-AILab:mainfrom
Robin930:fix/fp8-rescale-threshold-overflow

Conversation

@Robin930
Copy link
Copy Markdown

Fixes #2577

Problem

FP8 forward pass uses rescale_threshold=4.0, which combined with max_offset=8 allows intermediate P values up to 2^12 = 4096, exceeding FP8 e4m3 max (448). This causes severe precision loss (cosine similarity drops to ~0.86) at KV tile boundaries (multiples of 128).

Fix

Set rescale_threshold=0.0 for FP8 (always rescale O-accumulator). The BF16 path retains rescale_threshold=8.0 as before.

Test

Paged decode GQA with kv_seqlen=1~1023. Before/after:
Clipboard_Screenshot_1779337869
Clipboard_Screenshot_1779337877

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.

[Cute,Fwd,Sm100] FP8 precision degradation at KV tile boundaries due to rescale_threshold

1 participant