Repository navigation
Conversation
merceod
force-pushed
the
users/atindra/pr-02-norms
branch
8 times, most recently
from
October 20, 2026 06:20
95d05dd to
7ae1f9b
Compare
merceod
force-pushed
the
users/atindra/pr-02-norms
branch
from
October 21, 2026 02:30
7ae1f9b to
f52eba5
Compare
merceod
force-pushed
the
users/atindra/pr-02-norms
branch
3 times, most recently
from
October 21, 2026 10:31
bec4c22 to
d05ac44
Compare
Its samplers keep the per-row device seed/offset, so the captured call carries over. The 32-warp prep config cannot launch with 64-wide wavefronts and is pruned there.
The dispatch had only cuda and rocm factories, so the CPU platform (which CI now runs through test_xpu_sampler since #581) raised NotImplementedError where main calls FlashInfer directly.
A dispatch caches the kernel it resolves on the first call, so a test that patches the kernel module after another test resolved it kept running the first module's function. The modular conftest now resets every dispatch between tests, next to the platform cache.
On AMD GPUs forward_residual runs the fork's in-place kernel through an op with a fake, so dynamo keeps it in the graph; NVIDIA GPUs keep the direct FlashInfer call. Both norms run the fork's native kernels on AMD: AITER's are faster per call but round bf16 stores toward zero.
PositionManager builds an fp32 cache with the scale and Llama 3.1 frequency blend applied; the fork's cos/sin-cache kernel reads it.
Attention layers pass their own theta, which models often leave out of PositionConfig, and Llama 3.1 defaults that are a no-op at scale 1.
#492's rope_table_dtype (a cos/sin table rounded the way the reference rounds it, Fish S2-Pro's codec) now replaces the fp32 cache on ROCm. Before, apply_qk took the fp32 cache over it.
…spatch Main's HF-order filter and min-tokens floor called FlashInfer's sampling_from_probs and renorms directly. On ROCm those are the fork's ops, which raise when dynamo traces into them, so they now go through PlatformDispatch like the other draws. The generation-control tests spy on the dispatch instead of the FlashInfer function.
merceod
force-pushed
the
users/atindra/pr-02-norms
branch
from
November 1, 2026 07:49
d05ac44 to
73b0e20
Compare
This branch has not been deployed
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.
On AMD GPUs the norm, RoPE and sampler resources now run AMD's FlashInfer fork (amd-flashinfer 0.6.18+amd.1). The kernel is picked per platform through
PlatformDispatchfrom #603, and NVIDIA keeps calling FlashInfer as it does today.mstar::rms_norm's CUDA kernel dispatches to FlashInfer or the fork. Fused add + norm gets its own op with a fake,mstar::fused_add_rms_norm, so dynamo keeps it in the graph on ROCm.rope_table_dtypetable ([Model] Add Fish Audio S2-Pro: text-to-speech with voice cloning and exact streaming #492) takes precedence over the cache on ROCm as it does on CUDA.Why not AITER's norm kernels: they're 20-40% faster per call, but they round bf16 stores toward zero. In a drift test that shrank the residual by 9.1% over 64 layers, against 1.05% (and no bias) for the fork.
NVIDIA: no behaviour change. Every platform but ROCm gets today's FlashInfer calls (the sampler dispatch makes FlashInfer its default),
forward_residualkeeps its direct FlashInfer call and its graph break (moving NVIDIA onto the op needs a worker_phases A/B first), no RoPE cache gets built, and the autotune prune keeps every config at warp size 32.scripts/ci/select_cpu_tests.pyliststest/rocmwith the modules CPU Core doesn't run (they need an AMD GPU), since main's build check wants every test module accounted for.PlatformDispatch.reset_all()lets the modular tests' platform fixture drop every dispatch's cached kernel between tests, the same way it clears the cached platform, so a test that patches a kernel module gets its own.Tests
ruff check .test/modular/test_rocm_op_dispatch.py(new), dispatch per platform on CPUtest_rocm_op_dispatch.py,test_rms_norm_op.py,test_fused_rmsnorm.py,test_position_autocast.py,test_platform_dispatch.py,test_sampler_*,test_sampling_*,test_qwen3_5_config.py,test_resource_runner.py)test/rocm/test_norm_kernels.py,test_rope.py,test_sampler.py,test_triton_kernels.pyon MI300Xtest/modular,test/distributedandtest/sampling_teston an MI300X node with GPUs hidden, on the integration branch that carries this whole stack, rebased on maintest/rusttheretest/rocmon MI300X, same branchtest/modular,test/distributedand the model test dirs, plus the TP lockstep sim; torch 2.9.1 CPU, merged with main)test_eval_framework.py::test_sigterm_to_the_runner_stops_the_managed_server, a subprocess timing test that passed on the rerun and on the other PRstest/modularonly fails the twotest_dump_stacksenvironment cases main fails too (7174 passed before the last three test fixes, targeted rerun on the tip 398 passed), other CPU suites 248 passed, TP lockstep sim 7 passed,test/rust368 passed. One MI300X:test/rocm675 passed, fused-MoE and sampler GPU tests 228 passed, served smoke rows for Qwen3.5 0.8B, Kokoro, Whisper large-v3 and Cosmos3 DROID match the earlier runsNumbers
End to end against the same tree without this PR, one MI300X (VM slice, indicative),
benchmark.runnerclosed loop at c=16, 96 requests, two runs per arm.configs/orpheus_colocated.yamlwithflashinfer_backend: fa2), audio s/sconfigs/qwen3tts.yaml), audio s/sWhisper on the 5 clips per model per run: WER 0 on nearly every clip in both arms, at most one wrong word on one clip per run. Exclusive-node tables follow.
Not in this PR
rope_thetaout ofPositionConfig, so they get the on-the-fly kernel instead of the cache.Checks on this rebase
The stack now sits on main f7cb5ca (2026-10-29), every branch cut from one integration tree.
test/ci, the TP lockstep sim,test/rust, CPU Coretest/rust436 passed, CPU Core fails nothing main doesn't (main's own 34:test_dump_stacksx2,loop_output_ownershipx32)test/rocmon one MI325X (a VM slice, torch 2.12.1+rocm7.2)test_*moe*failures are main's GLM-5.2 kernel tests, the same set on the previous headNothing fails on this tree that the previous head doesn't: the failing-set diff against it is empty for
test/rocm, MoE, the sampler and the rows.