Repository navigation
docs(deberta_v2): record why FP8 is not shipped - #2122
Merged
zhenshanx-nv merged 1 commit intoNov 10, 2026
Merged
Conversation
Add a README for the deberta_v2 family with the FP8 self-quantization study of microsoft/deberta-v3-base and deberta-v3-large on TensorRT 11.4 (B200, B300) and 11.1: recipe (per-tensor FP8 for the six projections of every layer on the fp16 engine, ModelOpt-calibrated static activation scales), measurement method, speed, plan size, feature quality and MNLI head agreement against PyTorch fp32. At the manifest window (256 tokens, batch 1) FP8 runs at 0.94x to 0.99x of fp16 on B200 and 1.08x to 1.11x on B300, the plan is 21% to 30% smaller, and the feature error grows from 0.2% to 6% to 7%. In the FP8 engine TensorRT fuses the attention of one layer only (all layers in fp16), which takes the GEMM gain back. FP8 is not shipped. NVFP4 was not tried. No problem on main was found. Documentation only; no code change. Signed-off-by: Zhenshan Xie <zhenshanx@nvidia.com>
|
Warning Review limit reachedEnable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. Next included review available in 8 minutes. View limit details
|
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.
Background
families/deberta_v2builds DeBERTa-v2/v3 encoders (microsoft/deberta-v3-basein the manifests,text_to_token_features, batch 1, window 256) in fp32 (default) or fp16 and has no quantized build. No FP8 or NVFP4 checkpoint of a DeBERTa-v2/v3 model exists on the Hub, so FP8 self-quantization of the encoder projections on top of the fp16 engine (build-time per-tensor FP8 weights, ModelOpt-calibrated static activation scales) was built and measured for deberta-v3-base and deberta-v3-large on TensorRT 11.4 and 11.1. FP8 does not pay for this family: at the manifest window FP8 runs at 0.94x to 0.99x of fp16 on B200 and 1.08x to 1.11x on B300, the plan is 21% (base) to 30% (large) smaller, and the token feature error grows from 0.2% to 6% to 7% (MNLI head agreement 99.25% to 99.55%). This change adds a README for the family that records the study, like the yolov10 (#2093), bart (#2004) and timesfm (#2005) studies, so that it does not have to be repeated. The FP8 code is not part of this change. NVFP4 was not tried: the encoder is not bound by weight reads at batch 1.Exit Criteria
Implementation
families/deberta_v2/README.md(new): a short family description and the section "FP8 quantization study (not shipped)": summary and decision, recipe, method, results (speed, batch 32, quality, why there is no speedup), NVFP4, what was not tried, when to revisit.Recipe that was measured (code kept out of the repository):
query_proj,key_proj,value_projon the hidden rows,attention.output.dense,intermediate.dense,output.dense; 72 in base, 144 in large). Embeddings, the relative position table and its positional products, layer norms, GELU, attention matmuls and softmax stay fp16.FP8_DEFAULT_CFG(max) on the PyTorch model, 800 WikiText-2 and MNLI train texts. fp16 Dequantize.Why no gain: in the fp16 engine TensorRT runs the attention of every layer as one fused kernel; in the FP8 engine it does so for one layer only, and the other layers run separate matmuls, a softmax and extra transposes, concats and adds (pointwise kernels 14 to 58 in base, 26 to 118 in large). At 128 and 256 tokens the projection GEMMs are small, so this takes the FP8 GEMM gain back. FP8 is faster only at 512 tokens (1.18x to 1.37x) and at batch 32 in an experiment-only graph (1.03x to 1.34x).
Change categories
Validation
Commands and Results
Documentation only.
python3 -m tools.model_ci validatepytest tools/tests/test_architecture.py tools/tests/test_public_source_hygiene.py(CPU)git diff --checkpython3 tools/pr_metadata.py validateon this descriptionThe numbers in the README come from the local study and are not re-run by this change (batch 1, window 256, x is fp16 time over FP8 time):
Quality against PyTorch fp32 (800 held-out texts, window 256, TensorRT 11.4, B200): token feature relative error fp16 0.0021 / 0.0023, FP8 0.070 / 0.060 (base / large); MNLI head agreement on 2000 validation-matched pairs fp16 100% / 100%, FP8 99.25% / 99.40% (B300 large 99.55%), accuracy within +0.35 point. On a one-token input the large FP8 model gave token cosine 0.631 in one B300 build (0.944 to 0.995 in the others). No NaN or Inf in any engine.
Hardware, Environment, and Revisions
upstream/mainat683a7316.microsoft/deberta-v3-baseat8ccc9b6f36199bec6961081d44eb72fb3f7353f3(manifest revision),microsoft/deberta-v3-largeat64a8c8eab3e352a784c658aef62be1662607476f; for the head check onlyMoritzLaurer/DeBERTa-v3-base-mnli-fever-anli(6f5cf0a2) andMoritzLaurer/DeBERTa-v3-large-mnli-fever-anli-ling-wanli(b3546ea6).Salesforce/wikitextwikitext-2-raw-v1(b08601e0),nyu-mll/gluemnli(bcdcba79); calibration from the train splits, evaluation from WikiText-2 test and MNLI validation-matched.upstream/mainat683a7316(the fp16 support, feat(deberta_v2): support fp16 builds #2056); speed, size and kernel numbers from a re-run of the same FP8 code on236fede5(the family code did not change between the two). Reference: TransformersDebertaV2Modelin float32 (TF32 off).Not Run / Remaining Gaps
attention.output.denseor q/k/v in fp16 to keep the attention fusion, per-channel scales, SmoothQuant, percentile or entropy calibration, H100, the native runtime with an FP8 bundle.Contributor Self-Review
Notes For Future Readers
Risk level
Risk rationale: documentation only; one README added, no code, build, bundle or test change.
🤖 Generated with Claude Code