[Kernel] Preserve DFlash2 sampling precision and repair QUASAR TP2 - #517
Merged
yangzhuxinyzx merged 10 commits intoSep 6, 2026
Merged
yangzhuxinyzx merged 10 commits into
yangzhuxinyzx merged 10 commits into
Conversation
…cles Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
Generated-by: Codex Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
Generated-by: Codex Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
Generated-by: Codex Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
Generated-by: Codex Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
Contributor
Author
|
本轮审计(head 53be620):数值修复值得保留,暂不整包合并,PR 继续 open。通用 apply_top_k_top_p_triton 在 top-k/top-p 启用时无条件 logits.clone()(1123 行),随后 Python 审计由 OpenAI Codex 辅助,按仓库所有者要求执行;未关闭 PR。 |
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>
Preserve both audit histories and independent mainline QSA, AWQ, and PP changes. Update the old paged-prefill regression for the current native signature. Assisted-by: Codex Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
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
Integrate the QUASAR + DFlash2 output-precision repairs and their audit record into main. TP2 GDN output width 8240 was accepted with insufficient alignment and produced corrupt TurboMind results; physical width 8256 restores the operator contract. Tied top-k/top-p cutoffs could produce incorrect candidate sets, and conditional lookup agreement incorrectly rewrote the probability of the random prefix used to select that lookup. Both sampling defects are repaired.
The precision path independently supports FP32 candidate/dense logits on TP2/TP4 and explicit E4M3 grouped q8 verification. It also retains optional context/metadata CUDA graphs and deferred accepted-slot writes, with the recorded numerical and latency controls. Diagnostic tensor ownership, TP rank detection and reference weight sharding are repaired.
95205a2d9952813aa7469f63ff65b8f2813c027a(onecat/main).0b793e1fc5068cac4ac79d4d3516b111a1f89726.VLLM_SM70_DFLASH2_FP32_LOGITS,VLLM_SM70_DFLASH2_CONTEXT_PIPELINEandVLLM_SM70_DFLASH2_CONTEXT_KV_GRAPHremain opt-in. Target E4M3 requires explicit--kv-cache-dtype fp8_e4m3and a rebuilt Flash-V100 library. TP2 QPN2 is not promoted.This extends the existing repair PR rather than creating a duplicate. Related prefill race/alignment PRs #202/#226 already exist in main and in the previously measured library. QSA #494/#525 is a different model route. The unadmitted FP32-partial experiment #524 is not included.
Test Plan
Rebuild Flash-V100 from the integrated source for physical SM70, then run scoped operator, CUDA Graph, sampling, TP2 admission, reference-sharding and routing regressions. Preserve the prior full-model captures, scored-output limitations and separately measured unprofiled latency. Do not treat a merge-time operator pass as a new end-to-end quality or speed result.
The exact
.venv/bin/python -m pytestarguments and JUnit XML files are retained in bundlev100-dflash2-quality-mainline-20260906. Scope:tests/kernels/attention/test_dflash2_context_pipeline.py,test_sm70_grouped_e4m3.py,test_sm70_flash_v100_grouped_verify.py,test_sm70_flash_v100_paged_prefill_determinism.py;tests/kernels/core, and NVFP4 output padding undertests/kernels/quantization;tests/v1/sample/test_topk_topp_tied_cutoffs.py;tests/v1/spec_decode;Test Result
427 distinct scoped tests passed after main synchronization.
Two historical prefill tests initially could not call the current native API because the anchor arguments were missing. Their direct call now uses the public wrapper's
None, 0contract; L300/L512 direct and public paths each repeat bitwise across six launches. Failed API-validation logs are retained; no numerical assertion was relaxed. The other 46 initial kernel checks passed and were not unnecessarily repeated.Fresh Flash-V100 build: CUDA 12.8, Torch 2.10.0+cu128, Python 3.12, SM70; GPU tests used an exclusive V100 GPU4 lease, now released. Native SHA256:
2fca94182ab26205e0bd4f65a92df8c46017c6c8ede3df3fd7ef28e9b03f78e5. The native vLLM core retains the previously validated artifact; this is not a new full-wheel build. Scoped pre-commit, mypy, clang-format, Markdown and DCO checks pass. GitHub CI passed on this exact head: run 34029576736.Previously measured evidence, with detailed contracts in the linked reports:
Remaining limits and merge scope
The user explicitly requested mainline merge on 2026-09-06 after these limits were reported. This records authorization to integrate the validated implementations and audit evidence, not completion of every quality investigation or a claim that the user independently reran tests.
Reports: operator audit, E4M3/FP32 precision, TP2/TP4 and QAT, fast-path numerics, verifier and prefill PR audit, latency controls.
AI assistance: OpenAI Codex. Commits retain DCO sign-off and assistance attribution. No model weights, native build products or raw captures are committed. Task GPU leases and test processes are released; canonical checkout and unrelated services are untouched.