[Fix] DeepSeek-V4.1: apply the per-shape BF16 GEMM rows only in CUDA graphs #302
All Vouch review confidence checks passed
Residual risk 0.15 = Change Risk (0.39) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.39 · 250 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.331
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #302"
general
weight: 0.35
yeahdongcn
Problem
1. #290's thresholds were applied to eager steps.
- #290 measured the per-shape rows in CUDA graphs, but
fp8_block_bf16_supportedandfp8_block_splitk_configapplied them to eager steps as well.2. 33 rows is too early for three shapes.
- For 1792x5120, 4096x1280 and 5120x1024, the 33-row start came from a graph-chain microbenchmark.
- In end-to-end decode, split-K and the block GEMM are faster through 55 rows. At DSpark-4 c8 (40-row verify batches), #290 made the decode step 2.2% slower than before.
Changes
| Commit | Change |
|---|---|
|
97fc37a9fix: apply the measured DeepSeek-V4.1 BF16 GEMM rows only in CUDA graphs | The per-shape BF16 thresholds and the split-K ranges below them now apply only while a CUDA graph is being captured. Eager steps, prefill included, go back to the pre-#290 split-K ranges and to BF16 from 512 rows. ||
17349956perf: start the BF16 GEMM at 60 rows for DeepSeek-V4.1 attention and wo_b | In CUDA graphs, 1792x5120, 4096x1280 and 5120x1024 switch to the BF16 GEMM at 60 rows instead of 33. Split-K covers up to 59 rows; for 5120x1024 it stops at 48 and the block GEMM takes 49-59. |Measured end to end, as the DSpark-4 decode step time (ITL p50) with one server per run. The table compares the split-K/block GEMMs with the BF16 GEMM for these three shapes (negative: split-K/block faster). Run-to-run noise is 0.3-0.7%.
| Verify rows (c x 5) | 40 | 45 | 50 | 55 | 60 | 80 | 120 | 160 |
|---|---|---|---|---|---|---|---|---|
| split-K/block vs BF16 | -2.5% | -2.2% | -0.6% | -0.9% | +0.3% | +2.3% | +3.9% | +7.9% |
Validation
pytest tests/test_fp8_block_gemv_native.py tests/test_paged_mqa_logits_metadata_warmup.py tests/test_custom_op_preload.pyon S5000, on the rebased branch: 45 passed.test_measured_rows_apply_only_in_graph_capturechecks both paths. Eager steps use the pre-#290 split-K ranges and BF16 from 512 rows; captured steps use the per-shape rows.