Repository navigation
[w2] rocm-runtime-knobs: ROCm knob inventory, A/B script and launch-gap microbench (prep) - #168
Merged
Merged
Conversation
…gap microbench (prep, scripts only) Inventory of the runtime knobs that exist in the build image's libamdhip64/libhsa-runtime64, an interleaved tg128 A/B script (ab.sh + ab-stats.py: screen on Nemotron, confirm on four models, combination, greedy-hash check) and a HIP launch-gap microbenchmark (stream vs hipGraph, GPU-side idle measured with wall_clock64). No llama.cpp code. Nothing was run on the GPU. Assisted-by: Claude Sonnet 5.5
Owner
Author
|
Reverted from master on 2026-12-04 (w2 build crashed Qwen4-single at >20k ctx; no measured gain). Commit preserved on branch archive/w2-25f0def; will be re-landed individually after GPU validation. |
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.
What
Prep task, no llama.cpp code: scripts only under
tools/rdna3-w2/rocm-runtime-knobs/.knobs.txt: the HIP/HSA runtime knob names that really exist in the build image (rdna3-build:local, ROCm 7.16.26385 / core-10.1), fromstrings libamdhip64.so libhsa-runtime64.so. All 14 knobs of the plan exist;DEBUG_CLR_GRAPH_PACKET_CAPTUREdoes not.ab.sh+ab-stats.py: interleaved whole-card tg128 A/B (base - knob - base ...) of 24 knob variants (+3 extras found in the library:DEBUG_CLR_AQL_DEV_QUEUE,AMD_DIRECT_DISPATCH,DEBUG_HIP_GRAPH_CLASSIC_PATH). Screen on Nemotron, confirm the survivors on Nemotron/Gemma/Qwen3.8/Qwen4, combine the winners, then check the greedy text hash on Nemotron-DFlash (specbench.py --modes greedy). Each run hastimeout 600, a hung run's container is removed, two failed baselines abort.launchgap/: HIP microbenchmark (compiled with hipcc for gfx1100, not run). N dependent kernels in a stream and in a captured hipGraph, three flavours (tiny, full-GPU, 512 B kernel argument); prints host enqueue us/launch, total us/launch and the GPU-side idle between kernels measured withwall_clock64().sweep.shruns it for the baseline and every knob.Two deviations from the plan (details in the README)
GPURUN_OPTS='-e HIP_FORCE_DEV_KERNARG=0'does not override the hardcoded=1:gpurun.shplaces${GPURUN_OPTS}before its own-e HIP_FORCE_DEV_KERNARG=1, docker keeps the last one.ab.shandlaunchgap/sweep.shcallgpurun.sh -e K=V(applied after) and build the same llama-bench command aslb.sh(which cannot pass-e).CONFIRM_ALL=1for the full matrix).BLOCK_TIMEOUT=9000is needed (gpublock default is 2400 s).Expected gain (estimate)
Unknown, at most a share of ~2 us per dependent launch (about 1.4 ms/token on Gemma with ~700 launches); realistic 0-3% tg, possibly 0.
Env switch
The knobs themselves (runtime env, via
gpurun.sh -e). Nothing changes in production,prodimg/Dockerfile,router-config.inior anyllama-cpp-rocm:*image. A winning knob goes into production only with the user's approval.Files
tools/rdna3-w2/rocm-runtime-knobs/{README,ab.sh,ab-stats.py,knobs.txt,launchgap/{launchgap.hip,build.sh,sweep.sh}}(the working copies run frombuild-bins/w2/rocm-runtime-knobs/andbuild-bins/tools/launchgap/).Risks
DEBUG_CLR_*are debug flags and may hang or corrupt: hence the timeout, container removal and the greedy hash gate. Extra knob values are guesses (semantics unknown fromstrings).Checked on CPU (no GPU used)
bash -n ab.sh;launchgap.hipcompiles withhipcc -O2 --offload-arch=gfx1100 -Wall -Wextra, no warnings (not executed).gpurun.sh/specbench.py(screen, confirm, combo, hash, failed run, knob absent from knobs.txt) andDRYRUN=1.GPU validation tonight (NOT YET RUN)
Decision rule: > 1% tg beyond run-to-run spread, no model loses, identical greedy hash.
Hard rules followed
No GPU access, no GPU lock, no
/dev/kfd//dev/dri; no production, docker compose orllama-cpp-rocm:*images; nothing touched in ggml-org/llama.cpp; PR not merged.Assisted-by: Claude Sonnet 5.5