[Kernel][WIP] Integrate native FlashInfer SM70 batch GDN and QSA probes - #523
Draft
yangzhuxinyzx wants to merge 31 commits into
Draft
yangzhuxinyzx wants to merge 31 commits into
yangzhuxinyzx wants to merge 31 commits into
Conversation
Reuse the existing SM70 push protocol in a benchmark-only same-owner sidecar. Preserve Triton operation order, remove zero-filled publication/reduction, and record a 19-20 percent rotating-weight full-chain microbenchmark improvement. Production integration and model-quality gates remain pending. Co-authored-by: Codex <noreply@openai.com> Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com> (cherry picked from commit de1754f)
Co-authored-by: Codex <noreply@openai.com> Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
Co-authored-by: Codex <noreply@openai.com> Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
Co-authored-by: Codex <noreply@openai.com> Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
Co-authored-by: Codex <noreply@openai.com> Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
Co-authored-by: Codex <noreply@openai.com> Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
…etry Co-authored-by: Codex <noreply@openai.com> Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
…race Co-authored-by: Codex <noreply@openai.com> Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
Co-authored-by: Codex <noreply@openai.com> Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
Co-authored-by: Codex <noreply@openai.com> Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
Retain MoE locality and paired-projection negative screens; keep the new copy-only route opt-in pending endpoint and quality admission. Co-authored-by: Codex <noreply@openai.com> Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
…gnal Co-authored-by: Codex <noreply@openai.com> Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
Co-authored-by: Codex <noreply@openai.com> Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
Co-authored-by: Codex <noreply@openai.com> Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
Instantiate pinned upstream decode and cascade kernels through an ordered sparse KV adapter. Keep serving dispatch unchanged pending GPU correctness and performance validation. Co-authored-by: Codex <noreply@openai.com> Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
Warm all benchmark arms before paired timing, report hardware telemetry, and record component gains without promoting the B1-regressing prototype to serving. Co-authored-by: Codex <noreply@openai.com> Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
Preserve FP16 convolution product and residual rounding, FP32 recurrent state, and cooperative grid synchronization. Keep runtime dispatch unchanged while screening complete operator chains before consolidated E2E validation. Co-authored-by: Codex <noreply@openai.com> Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
Specialize Torch operator namespaces per GDN geometry and keep candidate/reference recurrent histories independent. Add mixed-precision HC oracle and graph replay cases. GPU validation is still pending a foreign lease release. Co-authored-by: Codex <noreply@openai.com> Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
Record checkpoint-weight paired GPU gains with independent FP32 recurrent histories. Reject the slower shared-staging HC path; add a bounded register-staging candidate and retain all serving defaults. Further GPU validation is waiting for the foreign lease. Co-authored-by: Codex <noreply@openai.com> Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
Preserve main plus the pinned #504 HC/projection baseline and #513/#515 operator prototypes for a single controlled integration comparison. No production default is enabled. Co-authored-by: Codex <noreply@openai.com> Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
Keep prior HC/M1 routes, preserve FP32 recurrent state, and dispatch via local metadata/tensor contracts. Add CPU route and GPU bridge tests; leave the integration flag disabled pending model validation. Co-authored-by: Codex <noreply@openai.com> Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
AI-assisted with Codex; human review required before merge. Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
AI-assisted with Codex; human review required before merge. Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
AI-assisted with Codex; human review required before merge. Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
AI-assisted with Codex; human review required before merge. Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
Assisted-by: Codex Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
Contributor
Author
|
Quality attribution follow-up recorded in a25c23f. This is evidence for the existing #523 integration scope, not a duplicate component PR or a request to merge.
AI-assisted investigation (Codex); human review is still required before merge. Full provenance, aborted diagnostic attempts, raw result locations and next action are in |
This was referenced Sep 6, 2026
…ation Keep the FlashInfer parent default off. Package the native MQA scorer, retain full-chain microbenchmarks and negative GDN results, and record the independently reproduced QSA allocator-order defect. Reuse existing PR #494 for that repair; do not ship the diagnostic alternative. Co-authored-by: OpenAI Codex <noreply@openai.com> Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
Keep physical deduplication and masks while ordering grouped and XQA plans by logical ownership. Add allocation-invariance regressions and document the causal investigation, upstream alternatives, and measured cost. Co-authored-by: OpenAI Codex <noreply@openai.com> Signed-off-by: Leonccaa <166551845+Leonccaa@users.noreply.github.com> (cherry picked from commit 5fa8a60) Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
Contributor
Author
Reuse the reviewed logical-owner planner, reduce live-union sorting overhead, and package isolated GDN geometries with safe native loading and reload guards. Preserve failed HC/MoE experiments and fixed quality ablations; keep the integration default off pending the full quality and performance gates. Co-authored-by: OpenAI Codex <noreply@openai.com> Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
Preserve the original tool-call regression, identify the EOS boundary, and add CPU rounding counterfactuals plus a single-GPU HC stage-isolation harness. Document completed CPU evidence and explicitly pending GPU/model gates; no serving defaults or numerical kernels changed. Co-authored-by: OpenAI Codex <noreply@openai.com> Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
…arse QSA AI-assisted by OpenAI Codex. Keep experimental defaults off pending natural model quality and fresh E2E gates. Co-authored-by: OpenAI Codex <noreply@openai.com> 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
Current status (2026-09-06 follow-up): still Draft / default off. The
20--30% end-to-end target and expanded quality gate are not met. Historical
results below are retained; the latest ablations and component evidence are
summarized at the end. Nothing here is a production-performance admission.
Integrate the operator-screen winners from #513 and #515 with the pinned #504 batch HC/TP baseline, behind a default-off
VLLM_SM70_FLASHINFER_BATCHprobe. This branch combines those component branches; the new work is the model-execution bridge, not a release default change.Test Plan
Test Result
190e5f02250f98080905250337cd3fce93901b8e.45711b5e21moves shape/metadata dispatch inside the compiled boundary and preserves the existing FP16 input projection on fallback. Reintroducing the legacy guard demonstrably fails dynamic-range export.2273c24d7dadditionally resolves empty AOT state placeholders using the existing recurrent-core contract; explicit state buffers are not replaced. Final expanded preflight: 29 passed, including four GPU cases.Final combined model result (source
f45c673898)GDN and QSA both hit their native runtime routes. Fixed 8K/256 no-MTP TP4 workload, prefix cache + Mamba align, FP16 KV, FP32 recurrent state, CUDA Graph, GPU 4–7:
C16 complete engine-step mean: 27.221 -> 25.357 ms. The three throughput targets remain unmet. This is one campaign, not a cross-run stability study.
Not admitted for quality: combined GSM8K 15/16 and JSON Schema 16/16, but offline BFCL 49/64 vs control 52/64. No truncations. Five control successes become failures and two failures become successes. Both candidate variants regress on the same two irrelevance cases. This is a localization lead, not proof of causality or broad quality degradation. No HTTP/SSE, coding, PPL or long-context quality admission is claimed.
Keep this PR Draft and the integration default off. Do not count the throughput gain as accepted production performance. Next use retained real trajectories to isolate QSA arithmetic/output-gate drift and then GDN; do not seek favorable seeds to clear the gate.
All task workers exited; cleanup confirmed GPU 4–7 at 7 MiB each with no compute processes. The user-authorized old local API remains inactive/disabled. Remote services and unrelated GPU 0–3 work were untouched. Raw artifacts and every rejected/failed attempt are recorded in the worklog.
See
docs/design/sm70_flashinfer_batch_integration.mdfor contracts, negative results and provenance. AI-assisted with Codex; DCO sign-offs included. Human review required before merge.Follow-up: device-planned MQA and QSA quality attribution
This remains WIP, not completion of the full hot-chain plan. New source:
64dd679aa1; reviewed #494 dependency cherry-picked without conflict as3e0f7a40c1(original author and DCO retained).fragment, caller-owned graph schedule, int64 position support and runtime
capability dispatch behind the existing default-off parent switch.
8K C4/C8/C16 = 49.17/61.15/92.04 -> 40.56/42.27/54.00 us.
This EXCLUDES sparse attention and the model; it is not an E2E speed claim.
Six 8K/64K cases pass changing-replay index equality and have positive
five-block paired within-run timing intervals.
changes and independent streams. CPU routing/statistics/compile-boundary:
36 tests. Final source commit's applicable pre-commit hooks pass.
history exactly, but loses at C4/C8/C16. Do not select that variant there.
HC full-chain B4/B8/B16 benchmark extension is prepared; GPU test pending.
defect. Four-rank captures first diverge at layer 3 QSA despite identical
Q/K/V, gate, selected logical tokens and effective K/V. Small local error
grows to final hidden relative L2 0.2236.
and restores all four ranks' final hidden tensors across four cold-prefill
step pairs plus all 16 first-token logprobs. This is causal evidence, NOT
broad quality admission.
shared-page union and XQA tails. The competing diagnostic implementation was
retired to ignored artifacts and is NOT in the delivered source/build.
Reuse [Bugfix][SM70] Stabilize QSA page4 order under KV relocation #494 instead of a duplicate PR. Its Flash-V100 source builds and imports
locally; its GPU regressions in this integration are still pending.
[Bugfix][SM70] Stabilize QSA page4 order under KV relocation #494's prior AWQ evidence. Do NOT report the retired alternative's tests as
validation of [Bugfix][SM70] Stabilize QSA page4 order under KV relocation #494's exact implementation.
The original adverse BFCL results are retained. No new E2E result, expanded
dataset-quality admission, full-wheel acceptance, HC/TP overlap win or MoE
compaction win is claimed. Targets remain C4/C8/C16 = 238/420/728 tok/s,
C16 <=21.978 ms; they are NOT yet reached. Parent switch stays default off,
remote services untouched, no direct main push. All model diagnosis workers
were cleaned up; subsequent GPU work respects other tasks' leases.
Purpose/Test Plan/Test Result details and raw artifact provenance are retained
in
docs/design/sm70_flashinfer_batch_integration.md. AI-assisted with Codex;human review required before any promotion or merge.
Follow-up: stable planning, quality ablations, native GDN component
Source head:
d1c7e6489a81b0b2f520358b066aafd54892cf72(DCO signed;AI attribution included). All applicable staged and commit-time hooks pass.
Publishing preflight observed main
4366d9d5fe80eeaf79575b51ec36a6a032673df0;these measurements remain on the frozen integration base, not an untested
silent rebase. Final GDN component rebuild imports without CUDA initialization
and has identical disassembled device instructions to the tested component.
Purpose: continue the fixed FlashInfer full-hot-chain plan without promoting
an unadmitted model route. Integration base remains
755baae1d075ee04fa9096b23fc0225b23589a86; #494 is the reviewed dependency,not a competing implementation. No direct main push or remote deployment.
Implementation and focused Test Plan
live device union and select 512/1024/2048/4096/8192-entry sorts, with the
same graph addresses and attention arithmetic. Test changing live counts,
relocation, graph replay, actual captured NVFP4 inputs and memcheck.
Q8/V24 and Q16/V48 namespaces. Test head-partition isolation and state
ownership at B1/2/4/8/16/32/64. This is not a distributed TP test.
and reject unsupported reload contracts rather than retaining stale
prepared weights. Initial unsupported shapes still fall back locally.
fixed 80 cases only for causal component ablations. The preregistered
expanded three-seed BFCL/schema/GSM8K/HumanEval and HTTP/SSE gates remain
required before admission.
Test Result
80 pass, including live-sort-boundary changes in both directions under
one graph. Two targeted graph cases pass memcheck with zero errors.
Captured 2048-row planner+attention+gate: 653.21 -> 458.50 us (-29.81%),
five-block within-run paired 95% reduction interval [29.76%,29.85%].
This recovers correctness-fix overhead, remains slower than the unsafe
433-us allocator-dependent reference, and is NOT a model TPS result.
changing-state graph tests pass. A model ablation resolves the staged
component through package discovery, without external GDN-library paths.
Full release-wheel/clean-install validation remains pending.
missing/preloaded native components and unsupported prepared reloads.
All arms use the same repaired #494 binary, weights, prompts, sampling,
natural EOS and 16K limit, with zero truncations. GDN-only and native GDN+MQA
produce identical complete token lists. The sparse-QSA combined result is
still a failure: paired BFCL delta -1.5625 pp, conservative 95% interval
[-9.5612,+6.5981] pp. The GDN-only / GDN+MQA delta is +1.5625 pp with interval
[-6.5981,+9.5612] pp; do not interpret this small screen as noninferiority.
Scoring is offline model/parser diagnostic, not official BFCL or HTTP/SSE.
Rejected paths / remaining work
target C8/C16; the separate split-phase variant also remains rejected.
communication-free replay exactly reproduces the four-rank failure and
isolates projection arithmetic association. No new HC/TP speed admitted.
routes. Corrected W2-only C16 full chain: 131.411 -> 141.158 us. Production
MoE source is restored unchanged; rejected code is benchmark-only.
boundaries from production. That is a source lead, not proof of which
arithmetic change caused the missing tool call. Keep the negative result.
quality, full wheel, prefill and new fixed-contract E2E remain unfinished.
Do not add isolated service-time savings into a claimed model gain.
The worklog records source/library provenance, confidence-interval scope,
all negative attempts and local artifacts. Keep
VLLM_SM70_FLASHINFER_BATCH=0by default and require human review.Numerical isolation follow-up (
1a5a7f7e7b)No new serving kernel, runtime default or E2E throughput result in this
follow-up. Last measured C4/C8/C16 remains 232.169/390.046/630.996 tok/s,
not quality-admitted.
parallel_1failure shares the first 51 output tokens withMQA+GDN, including one complete valid tool call. At offset 51 the reference
continues with newline 198 and a second call; the sparse-QSA arm emits
EOS 248046. Lengths are 105 versus 52. This is generation termination, not
a parser discarding a generated second call. The numerical cause of the
different EOS draw remains unproved.
before PV, retaining reference tile/split and output/gate boundaries.
All 36 retained real QSA inputs get closer to the recorded reference with
its FP16 probability materialization: median relative L2
1.27622e-4 -> 3.82219e-5, median per-case reduction 70.34%.
These are older shadow inputs, NOT the repaired EOS step. This is neither
CUDA emulation nor model-quality evidence, and does not justify blindly
reducing native precision.
up-only and full sharding. It requires reproducing the retained four-rank
negative input first and does not relax the 3e-3 envelope. No distributed
timing is inferred from the single-GPU simulation.
including three new invalid/NaN/duplicate/denominator tests. Applicable
source/commit hooks pass; DCO and AI attribution included.
conditional-probability capture on all four ranks with A/A repeats. This
diagnostic is artifact-only, explicit opt-in and NOT a quality score.
CPU spawn-import checks pass without CUDA initialization.
The HC GPU launcher exhausted its ten-minute availability window with exit
75; a subsequent process check still found foreign GPU work. The new HC
GPU and EOS model diagnostics have NOT run. The waiter exited, no GPU
process/service was left resident, and foreign work was not terminated.
Resume those focused checks after actual availability, then the fixed
quality suites, then the concentrated frozen-contract E2E campaign.
Follow-up: implemented numerical repairs (
6dbb62937e)The preceding lease-only status is superseded: resources became available,
the registered HC and four-rank EOS diagnostics completed, and the combined
natural quality campaign is now running. Keep this PR Draft/default-off.
sharding, but up-only is bitwise identical at all arithmetic intermediates
for 16 inputs across 96 real weights. The runtime now preserves full down
GEMM and only shards up. TP4 full HC Graph chains at B4/8/16 pass the
existing every-intermediate 3e-3 gate. Five paired blocks: 0.422%/0.213%/
-0.092% chain-time reduction. B16 has no speed admission; correctness did
not preserve the previous sharded-down speedup.
materialization, 16-token partition and FP32 normalization, retaining
pinned FlashInfer virtual-page preparation/cascade and the output gate.
36 real-input median relative L2 improves 1.27593e-4 -> 5.34201e-5.
Full-QSA micro reductions over production: B4 6.62%, B8 38.27%, B16 49.57%;
positive five-block CIs. It is slower than old, numerically different SIMT.
live widths, multiple KV heads and short selections. The incomplete first
wrapper model attempt was explicitly stopped before quality/speed output.
Expanded routing/HC CPU tests: 118 passed. GPU output-gate/Graph bridge
tests at B4/8/9/15/16, one/two KV heads, widths15/65/2051: 20 passed.
raw logits are identical across arms. At offset51, old SIMT QSA shifts EOS
probability 0.760651 -> 0.839734 and newline 0.239349 -> 0.160266. The same
stateless draw flips from newline to EOS. This is decode probability drift,
not a parser, seed, or first-prefill issue. No EOS masking was added.
grouped-MoE experiments off. Its frozen 8K/256 C1/4/8/16 speed probe is
gated on each suite meeting the repaired production control and the EOS
case passing. This is not yet expanded multi-seed quality admission.
Fresh model quality and E2E results are pending. New QSA is still an explicit
prebuilt experimental component, not a released wheel/default. Full raw
provenance and all negative results remain in the worklog.