[Bugfix] Use FP32 state and E4M3 defaults for DFlash2 - #560
Merged
yangzhuxinyzx merged 2 commits intoSep 8, 2026
Conversation
Use E4M3 for the SM70 fp8 alias, repaired grouped attention and FP32 scalar partials for DFlash2 verification, and model-scoped FP32 logits defaults. Assisted-by: Codex Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
Assisted-by: Codex Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
yangzhuxinyzx
marked this pull request as ready for review
September 8, 2026 01:24
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
Make the SM70 DFlash2 E4M3 target use FP32 attention state consistently. Previously, q8 verification selected the legacy grouped kernel first and rounded normalized partial outputs to FP16; the scalar fallback also stored FP16 partials. The repaired grouped path could therefore be present and enabled without controlling DFlash2 arithmetic.
This change removes that E4M3 bypass, adds FP32 scalar partial storage/reduction, routes DFlash2 target q1 away from half-partial XQA, and admits 1728/3456 pages to the repaired grouped entry.
--kv-cache-dtype fp8now resolves to E4M3 on SM70 Flash-V100. The existing Qwen3.8 DFlash2 configuration enables FP32 logits by default. Explicit E5M2 and unrelated non-DFlash XQA routes remain available.KV storage remains FP8, Tensor Core operands/final activations remain FP16. Precision revision 4 and a matching extension rebuild are required. Older binaries cannot silently fall back to half-partial E4M3 scalar execution. MTP is not enabled.
Test Plan and Results
56f534e672657a6c7599afd6c0dcb2e2c211b2e3(onecat/main). CUDA 12.8.93/GCC12, Torch 2.10+cu128, V100-SXM2-32GB.docs/design/sm70_dflash2_fp32_defaults.md.Review Scope
This does not duplicate #556 (Gemma normalization/state-audit work) or #405 (FP8 verifier performance experiments). It addresses attention precision dispatch, scalar partial dtype and runtime precision defaults. Existing numerical failures are not reclassified based on a lower aggregate L2.
Raw local artifacts are indexed under
dflash2-e4m3-fp32-default-20260908; model weights and generated binaries are excluded from this PR. AI assistance: Codex. Human review is required before merging.Merge status clarification
The maintainer explicitly requested merging this change after being informed that the full TP4 model A/B remains queued. The reviewed head is
50e5b5d2fc09f872be5401a9f5eb471c85104be6; its CI checks all pass. Operator and routing results above are complete, but model acceptance/throughput and the final queued memory-safety run are not being relabeled as passed. The same-card TP4 queue continues with at most four GPUs and no MTP. A matching Flash-V100 precision-revision-4 rebuild is required to use the new E4M3 scalar/grouped policy; this merge does not publish a wheel or change running services.