Repository navigation
[Misc][ROCm][Kernel] Drop W4A16 prefill force hooks and the unregistered alias - #104
Merged
Merged
Conversation
3 of 4 tasks
Delete the finished FORCE_CONFIG and FORCE_SPLIT_K getenv hooks and the two contradictory banners above select_config. launch_dispatch calls compute_split_k directly. VLLM_RDNA2_PREFILL_DEBUG stays. Delete the unregistered gptq_gemm_rdna2_prefill_direct alias, its Python wrapper and fake, and the probe fixture line that named it. Delete the undocumented HC prefill tile and split overrides; the M-based tile and the block-count split stay. Correct the decode-kernel comments that said prefill falls through to Triton. Prefill is gptq_gemm_rdna2_prefill. Co-authored-by: Cursor Grok 4.7 Signed-off-by: BlivionIaG <15323295+BlivionIaG@users.noreply.github.com>
cursor
Bot
force-pushed
the
cursor/w4a16-prefill-host-cleanup-39f8
branch
from
October 16, 2026 15:28
8829469 to
ddb69e6
Compare
BlivionIaG
marked this pull request as ready for review
October 16, 2026 15:29
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
Subtraction-only cleanup of the W4A16 prefill host path on
rdna_extras. This is a redo of the substance of #48. #48 stays onrdna_extra/v0.28.0and is not retargeted. Default config and split-K selection are the same when the removed env vars are unset.AI assistance was used (Cursor Grok 4.7). A human should review every changed line and run the gfx1030 build and tests below before this leaves draft.
Why this is not a duplicate
Open PRs were searched for
q_gemm_rdna2_prefill,FORCE_CONFIG,prefill_direct, andhc_prefill. The only PR that deletes these hooks is #48, and its base isrdna_extra/v0.28.0. Nothing else open onrdna_extrasedits this host path. This PR also drops the unregisteredgptq_gemm_rdna2_prefill_directalias, the undocumented HC prefill tile/split overrides, the false Triton sentences inq_gemm_rdna2.cu, and the force-var row indocs/rdna2/tuning.md. #48 deletedVLLM_RDNA2_PREFILL_DEBUG; this PR keeps it.What was deleted
csrc/rocm/q_gemm_rdna2_prefill.cu: both banners aboveselect_config. Inner branch comments stay.select_configbranches are unchanged.VLLM_RDNA2_PREFILL_FORCE_CONFIGearly return insideselect_config.maybe_force_split_kandVLLM_RDNA2_PREFILL_FORCE_SPLIT_K.launch_dispatchcallscompute_split_k<Config*>directly.VLLM_RDNA2_PREFILL_DEBUGis unchanged.gptq_gemm_rdna2_prefill_direct(not inops.hortorch_bindings.cpp), its wrapper and fake invllm/_custom_ops.py, and the fixture line inbenchmarks/kernels/w4a16_compile_dispatch/test_probe_cpu.py. That line was not counted: the probe regex ends the op name on a word boundary, and the assertion still expects threegptq_gemm_rdna2_prefillcalls.csrc/rocm/hc_prefill_rdna2.cu:VLLM_RDNA_HC_PREFILL_TILE/_SPLITand theenv_inthelper that only served them. Tile selection isM <= 64 ? 0 : (M <= 384 ? 1 : 2). Split count is(target_blocks + mn / 2) / mn, then clamped to[1, 16].csrc/rocm/q_gemm_rdna2.cu: the three sentences that said prefill falls through to Triton. Prefill isgptq_gemm_rdna2_prefill.docs/rdna2/tuning.md: the one table row that documented bothVLLM_RDNA2_PREFILL_FORCE_CONFIGand_FORCE_SPLIT_K. They were not two rows. That row is not in perf(rdna2): QSA/GDN HIP prefill paths vs Triton/FLA + TunableOp decode/MTP grid (implements #64) #99's hunk (which addsVLLM_RDNA_ALL_HIPandVLLM_RDNA_MROPE_BLOCKafter the QSA row) and not in feat(rdna2): opt-in W8A8 int8 sdot4 dense and MoE kernels for gfx1030 #93's hunk (which inserts the W8A8 row afterVLLM_RDNA2_W4A8_SDOT4).ops.h,torch_bindings.cpp, andCMakeLists.txtare not edited, so this does not touch the #57 / #93 / #99 hunks in those files.vllm/_custom_ops.py: #57 editsmoe_skinny_int4_decode(around the old line 3072). This deletion is the unregistered prefill alias (old lines 922-950). The hunks do not overlap. The alias removal is included anyway.tools/rdna2_028/probe_force_split.pystill setsVLLM_RDNA2_PREFILL_FORCE_SPLIT_K. #87 deletes thetools/rdna2_028probes, so this PR does not edit that file.bench_results/2026-09-29_w4a16-regression-audit/SUMMARY.mdnames the var in a past writeup and is left as history.Unset env path (unchanged)
select_configused to cacheatoi(VLLM_RDNA2_PREFILL_FORCE_CONFIG)(default-1) and return it when>= 0. Unset, that return never fired. The remaining branches, in order, are the same:size_m > 256:size_n >= 4096returns ConfigA, otherwise ConfigCsize_m < 4 && size_n > 4096returns ConfigA4 <= size_m <= 8 && size_n >= 2048 && size_k >= 1024returns ConfigCsize_m == 12 && 2560 <= size_n <= 8192 && size_k >= 512returns ConfigCsize_m == 32 && 5120 <= size_n <= 6144 && size_k >= 1536returns ConfigClaunch_dispatchwasmaybe_force_split_k(compute_split_k<Config>(...)). That helper returned the computed split unlessVLLM_RDNA2_PREFILL_FORCE_SPLIT_Kwas a positive integer (unset default-1). Each arm now passescompute_split_kstraight through.compute_split_kitself, including theVLLM_RDNA2_PREFILL_DEBUGprint, is untouched.HC tile was
forced >= 0 ? forced : (M-based).env_intreturned-1when unset, so the M-based value was already the result. HC split wasforced > 0 ? forced : (target_blocks + mn / 2) / mn. Unset,forcedwas-1, so the formula was already the result. The[1, 16]clamp is unchanged.A host replica of those predicates (envs unset) matched on 720
(M, N, K)shapes, 37 computed split values, 4096 HCMvalues, and 48 HC split pairs. Setting the vars used to change the result; that is what this removal does.Test Plan
No ROCm toolchain in this environment (
hipccis absent, no/opt/rocm). On gfx1030, before merge:# Build with PYTORCH_ROCM_ARCH=gfx1030, then: .venv/bin/python -m pytest \ tests/kernels/quantization/test_rdna2_w4a16.py \ tests/kernels/quantization/test_rdna2_w4a16_awq.py \ tests/kernels/quantization/test_rdna2_w4a16_selection.py -vHost checks run here:
rgfor the removed names,python3 -m py_compileon the two Python files, and the unset-env replica above.Test Result
rgovercsrc/,vllm/,benchmarks/,docs/,tests/,tools/: the only remaining reader istools/rdna2_028/probe_force_split.py(left for cleanup(tools): delete finished tools/rdna2_028 campaign drivers #87).VLLM_RDNA2_PREFILL_DEBUGis still read incompute_split_k.python3 -m py_compileonvllm/_custom_ops.pyandbenchmarks/kernels/w4a16_compile_dispatch/test_probe_cpu.py: pass.pytestfor that file was not run: this environment has no.venvand noregex..cufiles: even. No line in those files exceeds 88 columns.tests/kernels/quantization/test_rdna2_w4a16*.py: not run (no hipcc, no GPU). No model eval: the unset dispatch path is the same code, and no serving run was done.Essential Elements of an Effective PR Description Checklist
supported_models.mdandexamplesfor a new model. (dropped the force-var row indocs/rdna2/tuning.md)BEFORE SUBMITTING, PLEASE READ https://docs.vllm.ai/en/latest/contributing