Repository navigation
Conversation
voltjia
force-pushed
the
perf/ninetoothed-merged-qk-rms-norm
branch
from
October 30, 2026 14:18
179084f to
fab3b73
Compare
voltjia
force-pushed
the
build/pin-ninetoothed-fused-add-rms-norm
branch
from
November 4, 2026 11:26
fe02af5 to
4a3058f
Compare
voltjia
force-pushed
the
perf/ninetoothed-merged-qk-rms-norm
branch
4 times, most recently
from
November 5, 2026 02:09
07d815e to
35ce41a
Compare
voltjia
force-pushed
the
build/pin-ninetoothed-fused-add-rms-norm
branch
from
November 5, 2026 03:50
4a3058f to
0295210
Compare
voltjia
force-pushed
the
perf/ninetoothed-merged-qk-rms-norm
branch
from
November 5, 2026 03:52
35ce41a to
13dc8c2
Compare
Base automatically changed from
build/pin-ninetoothed-fused-add-rms-norm
to
perf/initialize-ops-auto-tuning
November 5, 2026 08:00
15 of 23 tasks
voltjia
force-pushed
the
perf/ninetoothed-merged-qk-rms-norm
branch
from
November 5, 2026 08:10
13dc8c2 to
4b235b2
Compare
15 of 23 tasks
voltjia
force-pushed
the
perf/ninetoothed-merged-qk-rms-norm
branch
from
November 5, 2026 08:43
4b235b2 to
5f541fe
Compare
voltjia
force-pushed
the
perf/ninetoothed-merged-qk-rms-norm
branch
from
November 5, 2026 08:58
5f541fe to
c0e6359
Compare
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.
Summary
MergedQkRmsNormexperiment to the vLLM-alignedFusedQkNormoperator from InfiniOps #1023.FusedQkNorm; Q and K are normalized in place, while V remains unchanged.q_norm.weightandk_norm.weighttensors directly, removing the post-load merged-weight allocation and copies.head_dim=128, and an activeFusedQkNormimplementation. All other configurations retain the existing separate Q/K RMSNorm path.mainmerge commit82095baef0369797132898a8d132ca13ae60807b, which points to the final InfiniOps #1023 master merge commit1a68b261d19f0ed6f76bbabeab7a25f479f05e07.Motivation
Qwen3 applies separate RMSNorm to query and key head groups after the packed QKV projection. The final public operator shape follows the vLLM-style packed-QKV
FusedQkNormAPI, while retaining norm-only behavior so RoPE and the surrounding model path remain unchanged.Closes N/A - no separate issue exists.
Type of Change
feat- new feature / new modelfix- bug fixperf- performance improvement (no behavioral change)refactor- code restructuring without behavior changetest- adding or fixing tests onlydocs- documentation onlybuild/ci- build system or CI configurationchore- tooling, formatting, or other non-code changesTest Results of Involved Models on Supported Platforms (Please attach screenshots)
Validation performed on the A100 container using the full InfiniOps prefix with CPU, NVIDIA, Torch, NineToothed, Flash-Inference, and W4 Marlin enabled:
The basic instruction smoke used a one-layer Qwen3 model with BF16, four query heads, two KV heads, and
head_dim=128:Call-path verification used
INFINI_OPS_TRACE_CALLS=1:The trace contained one
FusedQkNormcall for the one-layer prefill and did not fall back to separate Q/KRmsNormcalls.The A100 smoke and benchmark measurements used the reviewed #1023 operator patch. The operator patch remained unchanged through rebase, and InfiniOps merged #1023 as master commit
1a68b261d19f0ed6f76bbabeab7a25f479f05e07. InfiniLM #609 has also merged intomainas commit12a4492f70dd33235e3d142e333ad4a9629d3b7b. The current #607 headc0e6359is a clean single commit directly based on InfiniLMmaincommit12a4492and pins the #1023 master commit through InfiniCore #1580 finalmainmerge commit82095bae.Benchmark / Performance Impact
Operator-level A100 medians on InfiniOps #1023 show that the aligned packed-QKV kernel itself remains close to the prior internal merged-QK kernel:
MergedQkRmsNormmedianFusedQkNormmedianThe small kernel cost is offset in InfiniLM by removing the post-load Q/K weight packing allocation and copies and by normalizing Q/K without allocating a separate normalized QK tensor.
End-to-end prefill was measured with
examples/bench.pyon the same A100, same random one-layer Qwen3 model, BF16, batch size 1, output length 1, prefix caching disabled, synchronous weight loading, and one warmup. Median prefill TTFT is reported. The 1024/4096 rows use three runs; 8192 uses ten runs because that length had materially higher run-to-run variance.FusedQkNormstackThe 8192 samples ranged from roughly 38.6 to 66.9 ms on both stacks, so the long-length result should be read as parity within noise rather than a strong standalone gain.
Notes for Reviewers
infini::ops::FusedQkNormfactory rather than probing the private NineToothed provider header. The installed publicinfini/ops.hexposes the operator and active-implementation query.mainafter build: pin NineToothed fused add RMSNorm #609. build: pin NineToothed fused add RMSNorm #609 carried the reviewed build: pin NineToothedfused_add_rms_norm#606 dependency pin intomainafter build: pin NineToothedfused_add_rms_norm#606 was accidentally merged into the old stack branch. InfiniOps #1023 has merged; InfiniCore #1580 has merged; its finalmainmerge commit pins the #1023 master commit.CI / ChatOps
Host behavior, Ruff, and format checks passed on clean head
c0e6359using the historical PR head branchperf/ninetoothed-merged-qk-rms-norm. Native CI run41998576713was dispatched on this head and remains queued while the configured InfiniLM runner pool is offline to GitHub Actions.Checklist
Title, Branch, and Commits
<type>/xxx-yyyy-zzzz.main.fixup!/squash!/wipcommits remain.Scope and Design
General Code Hygiene
C++ Specific
new/deletewere added.clang-format; the repository formatter uses the same configuration.csrc/models/llama_legacy/.Python Specific
Testing
examples/bench.pyon A100.test/bench/test_benchmark.pywas not run because the validation scope was the Qwen3 attention fast path and this repository has no committed Qwen3 random-weight fixture required for that harness.Build, CI, and Tooling
Documentation
Security and Safety