[Kernel][SM70] Add opt-in E4M3 grouped attention with FP32 partials - #524
Conversation
Preserve explicit per-query causal lengths and zero graph padding for the single-request small-Q route. Keep legacy E5M2 and sparse defaults unchanged. Assisted-by: OpenAI Codex Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
Assisted-by: OpenAI Codex Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
Compensate QK and probability residuals, keep PV accumulation tile-local, and reject stale precision binaries. Preserve default-off routing and record the failed same-process 128K token gate; this is not model promotion. Co-authored-by: OpenAI Codex <noreply@openai.com> Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
…integration-20260906-050258 Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com> # Conflicts: # docs/design/sm70_v100_migration_control.md
Retain current-main migration history and distinguish verified small-Q replay from incomplete full-model and planner integration admission. Co-authored-by: OpenAI Codex <noreply@openai.com> Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
AI integration review — 2026-09-07 — changes requiredReviewed head P1: reconcile the new main E4M3 paired-load contract before integrationMain #517 enables A CPU-only counterexample uses valid non-overlapping uint8 KV shape Retain the tested 8-byte loader for the explicit-row FP32 specialization, or strengthen both dispatch and native stride guards to the new 16-byte contract with an appropriate fallback. Add an 8-but-not-16-byte stride negative/control case before rebuilding; existing contiguous/interleaved cases do not exercise it. Verify E5M2 and sparse-page4 remain unaffected. P1: deterministic model admission remains failedRechecked the archived R6 same-process 128K FP64-reference/native/FP64-reference summary and raw-result hash Integration/test limitations
The archived 89 kernel/138 routing passes and 200/200 bitwise real-input replay concern the prior Recommendation: keep Draft and do not merge/default-enable until the integration contract is repaired and rebuilt, affected regression/model gates pass, and repository-required human review/test confirmation is supplied. No source, production default, service, or GPU allocation was changed during this review. Private v18/v37 long-prefill integration remains outside #524. |
Retain the q8 E4M3 capability and add padded-stride graph regressions. Runtime/model acceptance remains pending; no default promotion. Co-authored-by: OpenAI Codex <noreply@openai.com> Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
Keep model admission pending and distinguish pinned core dependencies from the rebuilt Flash-V100 extension. Co-authored-by: OpenAI Codex <noreply@openai.com> Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
Preserve max/sum and unnormalized PV, version the workspace contract, and cover exact FP16 midpoint rounding. Keep the route experimental pending integration and model gates. Co-authored-by: OpenAI Codex <noreply@openai.com> Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
Retain the non-monotonic per-input results and the aborted startup provenance; model admission remains pending. Co-authored-by: OpenAI Codex <noreply@openai.com> Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
Preserve the completed 128K pass and boundary-256K failure without transferring operator admission to model acceptance. Co-authored-by: OpenAI Codex <noreply@openai.com> Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
Clone only exceptional unaligned contiguous Q on the active stream. Preserve aligned arithmetic and graph behavior; retain failed model counterfactuals in the admission log. Co-authored-by: OpenAI Codex <noreply@openai.com> Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
Record the completed FP32 SSM/head brackets and late GDN build provenance; do not approve the failing boundary route. Co-authored-by: OpenAI Codex <noreply@openai.com> Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
…20260907-100628 [Kernel][SM70] Integrate repaired E4M3 FP32 small-query attention (#524)
2026-09-07 final status: memory repairs verified; model gate still fails
Latest evidence head
4cb6ec783b7339b0fd596ad07c943dfc2b2b25ca; model-tested source0c34be5d6039101771ac492c4d96bb954ab97f33includes host-only offset-Q protection; arithmetic sourcebeb172ebd0278b7faa4118e2e0caf12047aa6cb2, integrated with main099d9841f542f1b71121b4aff49e3aa29053a489. Keep Draft/default-off.Latest model result: FP32 SSM + FP32 logits passes 128K but fails 261888+256 at one-based token 26. Both references are stable; candidate chooses
-level, reference-, continuing as "low-level kernel changes" versus "low-precision arithmetic". Both are coherent; this is a failed strict token gate, not a claim of universal semantic degradation. All four ranks confirm actual FP32 recurrent state on 48 GDN layers, FP32 logits, page1616, and the native attention route. All captured rank-zero attention outputs are finite across 16 layers. Raw result SHA256:452a5a1845cae49b8aa26470a2fffacc4e8009a715ebb7625ec3b0e990c3a722.The token position does not rank different configurations' general quality. Changing downstream precision alone did not close admission. Next localize the first-divergence prefix; do not repeat this unchanged full-model cohort or relax the token criterion. Two private recording setup failures (Dynamo hook / subclass filter) are retained separately and are not numerical results. The completed run's boundary wait coincides with an on-demand strided GDN build and recovers after it; that dependency uses CUDA 12.0.140, DSO
89337e7055cc8ba8f9bd972341f43010ce23a5a7cb991a84eb48e60bc5bbfaf9. Prebuild/warm it before production timing. Our GPU jobs are finished and released; max concurrent task GPUs was four.79001ddfa0517c2fc8d1cfb2f017d174f2e3648506905847da69f867f905c22b). This does not establish the cause of the earlier token-77 difference.[80,8,6]LSE to[80,8,6,2]max/sum (+15 KiB). Both wrapper and backend require native precision version >=3 and reject stale extensions. E5M2 and the ordinary E4M3 q8 route retain their original workspace contract.8880b0405d6d7d212c4a738d45ab441815b6c948ab6e4e8ac5e1b83d754a9d49: 102 kernel, 142 routing, 38 planner checks pass; 69 memcheck cases, zero errors. Core/stable/FA2 dependencies remain explicitly pinned to archived libraries, not claimed as rebuilt.speed, candidate choosesbenchmark. Their reference scores tie, while candidate favorsbenchmarkby 0.046875; this is not a waiver of the deterministic gate or proof of broad semantic degradation. All four TP ranks select the route; rank-zero captures cover 16 attention layers and are finite. Result SHA256:a94d356ce29273fba3a202428ea77c737e7f51bd5152be1885d3ed46b6fb700e.validation, stable referencesscrutiny. Four ranks confirm actual FP32 logits; all recorded attention outputs are finite. The predeclared gate prevents extending this failure to 256K. Result SHA256:9571a0b77a2dfa161b8e8f0aa90097e3e6f9115b89c5eab06f295394113b043c. Synthetic head arithmetic improves about 80x, but that did not establish model admission.autouses FP32 SSM. The completed FP32-SSM counterfactual is reported above; it does not retrospectively approve the FP16-SSM failures or close boundary-256K admission.c33a84443d42621060a90ff7ecdbe2af4910e7774317c44c74777a13d7b56aafpasses 105 kernel checks, 6 targeted Q/KV alignment memcheck cases with zero errors, and matches all 200 old aligned real-input outputs bitwise. Four q5 100-ABBA speed ratios are 1.01834/1.00065/1.00036/1.00000, not a new model-speed claim. The separate 142/38/69 counts above retain their earlier artifact attribution.Revision 3 is not model-admitted. No merge, auto-merge, default KV promotion, service restart, or private v18/v37 prefill integration is claimed. Historical results below remain artifact-specific.
Earlier 2026-09-07 alignment update (revision 2)
Recorded head
1eeb7fb7a674d6b5b44682dbe5210d8be41cf76c, integrated with main099d9841f542f1b71121b4aff49e3aa29053a489. At that update the refreshed same-prompt 128K run was pending; its later result is stated above.4d889d0c1dde3589bced4211b984047a3d028609retains both native capability registrations and preventsROW_SEQLENSfrom inheriting the dense-q8 16-byte paired loader. Valid 8-byte KV strides keep their tested loader; main's q8 E4M3 acceleration remains intact.b65ee698fa992b6ff933f495c3827390aef3376641464c399b27939a3f9132b3: 98 kernel, 142 routing, 38 planner checks pass. The planner now uses explicitly pinned archived core dependencies; this is not a full core rebuild.4d889d0c1d(the next commit updates documentation only), frozen original prompt IDs, TP4/MTP4/E4M3, unchanged deterministic diagnostic settings, and the new DSO. No production default, service, or global KV alias changed. A private max/sum-state precision experiment has only compiled and is not included in this PR.The older test/model evidence below remains historical and artifact-specific. AI code review is not human review/test confirmation; no approval or auto-merge is asserted.
Historical R6 purpose and evidence (superseded by revision 3 above)
Integrate opt-in SM70 E4M3 dense small-query attention with FP32 partial state, an explicit E4M3 paged-to-FP16 bridge API, and follow-up arithmetic repairs. Preserve FP32 accumulation, current production defaults, and existing services.
The historical R6 same-process 128K model gate failed at output token 77. Operator improvements did not override that failure. This section records that artifact; it does not describe the latest model result. Human line-by-line review and relevant test confirmation remain outstanding.
Scope and non-duplication
VLLM_FLASH_V100_E4M3_GROUPED_FP32remains off. The opt-in requires native precision capability version >=2; stale libraries fail closed with a rebuild warning.Original base:
755baae1d075ee04fa9096b23fc0225b23589a86. Arithmetic follow-up:52dcdc4d523d8e7331897f073bada070ad468cc1. Synced main:95205a2d9952813aa7469f63ff65b8f2813c027a, merged without rewriting branch history.Historical R6 model gate: candidate rejected
Qwen3.8-27B-FP8, TP4/MTP4, explicit E4M3 KV, FP16 activations/SSM state, graph execution, fixed diagnostic GEMM dispatch, one cached 128K prefix, and three 256-token greedy requests in one process: FP64 attention reference–native candidate–FP64 attention reference. The reference replaces only admitted small-Q attention on identical quantized KV; this is not an all-FP64 model or a performance benchmark.
Both reference requests produce identical tokens. The candidate first differs at one-based token 77: references choose token 799 (
one), candidate chooses 23438 (engineers). The reference top-two logprobs tie; the candidate margin is 0.015625. Near-ties do not waive the no-divergence gate. This is not proof of broad semantic degradation or that E4M3 is inferior to E5M2.All four workers hit the native route; recorded rank-zero outputs cover all 16 full-attention layers and are finite. Result SHA256:
911c9906aed7ecf48d2673ce8267f2d27d2de22da65e55a0ec7ae36bbbff1926, private bundlee4m3-scaled-residual-r6-paired128-20260906.An earlier unscaled-residual revision passed its own same-process 128K bracket. Its reference sequence differs from this cohort's reference, so the two cohorts cannot establish that residual scaling alone caused the model difference. The earlier cross-process token-151 counterexample and original token-102 failure remain recorded in the design report. Full approximately-256K reference/control acceptance is incomplete.
Test plan and results
Build the Flash-V100 extension with
setup.py build_extinto a task-owned output directory using CUDA 12.8.93/GCC12, Torch 2.10+cu128, Python 3.12, SM70, and standard fast-math flags. SetPYTHONPATHto the new DSO and this checkout's Flash-V100 package. No installed runtime binary is overwritten.Model-tested arithmetic artifact:
87ffc1fd626e3d0fa46f6e2bda741a88d79d53809685a4d569c37e4d35b325cd.Fresh post-main-sync artifact:
76aa9a19f197fe805bb97b037f8a7934129ef0752b5c66922246c241a7e97b42.eb187e7fea4c81e4f01bb5ebb3752c888e583b0d62fc3bd63dec37bf2cde73f9.vllm._C, before numerical assertions. The failing setup log is retained; the full 38-test suite is not claimed as passed.Remaining admission
Resolve the within-process token counterexample; complete approximately-256K reference/control, current-main model checks, and matched prefill/decode performance. Complete separate clean-source integration/routing for private long-prefill and remaining E4M3 paths. Do not enable the global alias based on arithmetic microbenchmarks. This PR makes no current-main model-quality or production-speed acceptance claim.
See
docs/design/sm70_e4m3_grouped_fp32.mdand the migration control log. Paper drafts, model weights, private activations, binary build products and machine-specific raw paths stay out of Git. Tests use at most four physical GPUs concurrently; no unrelated jobs or services are stopped.AI assistance: OpenAI Codex. Human review/test confirmation is not claimed, and automated merge is not enabled.