[gfx1201][R9600D] Periodic ~55.8 us (~18 kHz) ~23.2 us GPU-side stall inside queued hipGraphLaunch causes ~25% bimodal throughput drop (+ pp_dpm_sclk 1080 MHz cap)
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 8/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- c, pytorch
- Ambito
- operating-systems, performance
Direzione di ricerca
This is a driver-level triage report about a periodic GPU stall on gfx1201, with no specific file or test named for a fix. The payload points at the amdgpu driver's power management and dispatch paths (pp_dpm_sclk, ppfeaturemask, CWSR, the MEC and SMU firmware), which need hardware and kernel expertise to investigate. Done would mean a root cause or a confirmed firmware or parameter workaround from the maintainers.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Summary
On AMD Radeon AI PRO R9600D (gfx1201, device 0x7551) running amdgpu 6.16.13 (Linux 6.8.0-134-generic), sustained LLM decode inference under HIP Graph (vLLM + gpt-oss-20b, BF16/MXFP4, concurrency 15) exhibits a sharp ~25% bimodal throughput split (~507 tok/s vs ~400 tok/s) within the same container, server process, and workload — including mid-round transitions completed within ~1.2 seconds.
Kernel traces (N=2 SLOW vs N=11 FAST) show that the software path and kernel sequence are 100% identical (859 kernels per 24-layer decode step, CPU queued +45 to +55 ms ahead of the GPU), while the SLOW state introduces a periodic GPU-side stall repeating every ~55.8 us (~18 kHz) inside already-queued hipGraphLaunch execution: 40.6–40.7% of graph kernels are followed by a ~23.2 us inter-kernel gap (vs 0.0–0.3%, ~4.4 us normal gap in FAST), lowering GPU busy ratio from ~86.4% to 70–73%, power from ~150 W to ~127 W, and memory activity from ~53% to ~41%, while sclk pins at ~1976 MHz.
A companion driver observation on the same GPU: sysfs pp_dpm_sclk only exposes 0: 500Mhz, 1: 0Mhz *, 2: 1080Mhz, so setting power_dpm_force_performance_level=high caps sclk at ~1050 MHz (~275 tok/s) instead of full boost.
Hardware & Software Environment
- GPU: AMD Radeon AI PRO R9600D (
gfx1201), PCI ID0x7551, SKUG2870300, Subsystem0x0e11, Rev0xc8, 32 GiB VRAM, isolated to container via/dev/kfd+ single render node - Kernel: Linux
6.8.0-134-generic(Ubuntu 24.04) - Driver:
amdgpu6.16.13(srcversion: A6F143BEC60C0AFC3263226) - Module parameters:
mes=0,cwsr_enable=1,sched_policy=0,hws_max_conc_proc=-1,runpm=-1,ppfeaturemask=0xfff7bfff - GPU firmware (
amdgpu_firmware_info):VBIOS:113-G2870300-001MEC: feature 29,0x00000c80SMC: feature 0, program 0,0x00684a00(104.74.0)RLC: feature 1000,0x00be7e04MES/MES_KIQ: feature 1,0x00000084SDMA0/SDMA1: feature 1081708182,0x00798e96
- Default power state:
power_dpm_force_performance_level=auto,pp_power_profile_mode=0 (BOOTUP_DEFAULT) - Userspace stack: PyTorch 2.12.0, vLLM
0.27.1.dev5, ROCm userspace (libamdhip64.so.7/libhsa-runtime64.so.1)
Observed Behavior
1. Bimodal throughput & sharp mid-round flip (isolated GPU, 1 KFD process)
Running 6 consecutive identical benchmark rounds (ISL/OSL 512/128, concurrency 15, 150 prompts, 30 warmups) against one vllm serve instance on an otherwise idle R9600D (kfd PIDs verified to contain only the server process):
| State | Output throughput | Median TPOT | sclk (MHz) |
Package Power | Memory R/W Activity (mrw) |
Junction Temp |
|---|---|---|---|---|---|---|
| FAST | ~505–513 tok/s | ~27.8–28.4 ms | 1860–1898 (spread 55–180) | 148–151 W | 50–56% | 82–83 °C |
| SLOW | ~397–404 tok/s | ~35.4–36.2 ms | 1974–1978 (spread ≤ 40) | 126–132 W | 41–42% | 77–82 °C |
- Transitions occur in both directions within the same server process (e.g.,
r2SLOW 402 →r3FAST 507 →r4–r6SLOW 400–402; orr2–r5FAST 504–513 →r6SLOW). - Transitions can happen mid-round within ~1.2 s: in one round (444.6 tok/s overall), 1 s telemetry stayed in SLOW through
+24.8 s(sclk ~1978 MHz,123–135 W,mrw 34–44%) and flipped by+26.0 sto FAST (sclk ~1860 MHz,143–157 W,mrw 51–75%) with zero warnings, JIT events, or scheduler changes in the vLLM server log (Running: 15 reqs,Waiting: 0, KV cache 3.5–3.8% constant).
2. Kernel trace evidence: ~55.8 us (~18 kHz) periodic ~23.2 us stall inside hipGraphLaunch
Captured 1.5 s torch profiler kernel traces (N=2 SLOW, N=11 FAST, including a pure mid-round decode SLOW trace triggered only after 3 consecutive seconds of sclk >= 1955 MHz, pw <= 136 W, use >= 95%):
| Trace | State | GPU busy % | Gaps 15–100 us (share of kernels) | Gap median | Inter-gap period median | hipGraphLaunch internal gaps >15 us |
CPU queue lead median (kernel.ts - runtime.ts) |
1 decode step (24 layers, 859 kernels): busy / gap sum |
|---|---|---|---|---|---|---|---|---|
| SLOW #1 | SLOW | 69.9% | 18,340 (43.6%) | 23.16 us | 55.84 us | 40.7% (15,353/37,678) | +45.32 ms | 22.19 ms / 11.11 ms |
| SLOW #2 (pure mid-round decode) | SLOW | 72.9% | 17,202 (43.5%) | 23.20 us | 55.76 us | 40.6% (14,363/35,372) | +54.72 ms | 29.53 ms / 11.13 ms |
| FAST #1 | FAST | 84.4% | 184 (0.4%) | 23.54 us | 60.28 us | 0.3% (156/45,370) | +36.53 ms | 24.80 ms / 3.86 ms |
| FAST #2 | FAST | 86.4% | 2 (0.0%) | 16.24 us | — | 0.0% (1/51,522) | +36.60 ms | 24.85 ms / 3.93 ms |
| FAST #3–#11 (9 traces) | FAST | 86.0–87.7% | 1–87 (0.0–0.2%) | — | — | — | — | — |
Key observations from per-kernel alignment of one 24-layer decode step:
- Identical kernel sequence: both states execute the exact same 859 kernels (35 kernels/layer × 24 + tail, zero name diffs) and identical
hipGraphLaunchratio (34.3–34.4 kernels/launch). - Not CPU-bound: CPU enqueue leads GPU execution by +45 to +55 ms (>1 full decode step), and 40.6–40.7% of kernels inside already-submitted
hipGraphLaunchpackets are followed by a ~23.2 us gap. - Small kernels straddling the stall boundary are stretched by ~16 us: e.g.,
FillFunctor,_stage2_pow2,reshape_and_cache_flash_kernel, andrms_normjump from 1.3–3.2 us in FAST to 17.9–19.0 us in SLOW whenever they fall on the ~55.8 us boundary. - Explains the macro telemetry: the ~30% microsecond-scale stall duty cycle reduces average power (~150 W → ~127 W) and memory activity (53% → 41%), keeping the card below its ~150 W power cap so
sclkstays pegged at ~1976 MHz (whereas in FAST, hitting the ~150 W cap causes normal DPM clock modulation around 1860 MHz).
What Has Been Ruled Out
- Other GPU tenants:
rocm-smi --showpidsconfirms only the single server KFD PID on the GPU across runs. - Thermal throttling: SLOW runs cooler (77–80 °C junction) than FAST (82–83 °C junction).
- Host CPU contention: container
VLLM::CPU% is flat at 201% and host CPU busy is 4–6% in both states. rocm-smipolling interference: un-sampled control runs (sampler=none) still exhibit both ~400 tok/s SLOW and ~506–509 tok/s FAST states.- Other clock domains:
mclk(1258 MHz),fclk(2016 MHz), andsocclk(1280 MHz) are identical in both states. - Host
sysfspower profiles:power_dpm_force_performance_level=manual+pp_power_profile_mode=5 (COMPUTE): still drops to SLOW at round 3 (r2508.9 →r3–r6399.8–402.7 tok/s, 1976–1978 MHz, 128–132 W).power_dpm_force_performance_level=high: capssclkat 1049–1051 MHz (~275 tok/s, 102–105 W) becausepp_dpm_sclkonly lists0: 500Mhz,1: 0Mhz *,2: 1080Mhz.
- Userspace CLR / ROCr dispatch options:
DEBUG_CLR_AQL_DEV_QUEUE=0 HSA_ALLOCATE_QUEUE_DEV_MEM=0: still drops to SLOW at round 5 (r2–r4497–511 →r5–r6398–404 tok/s).DEBUG_HIP_GRAPH_CLASSIC_PATH=1: all steady-state rounds (r2–r6) land in SLOW (381–389 tok/s, 1975–1978 MHz, 125–128 W).- In
ROCm/clr(dispatchAqlPacketBatchFlat), the same staticflatPacketDatabuffer is dispatched across both states.
(Note: ROCm/rocm-systems currently disables hip-graph-bubbles-test on gfx1151, gfx1200, and gfx1201 in projects/rocprofiler-sdk/tests/rocprofv3/hip-graph-bubbles-test/CMakeLists.txt.)
Questions / Request for Driver Triage
- What in
amdgpu 6.16.13/ KFD /gfx1201MEC (0x00000c80) / SMU (104.74.0) firmware can enter/exit a state that inserts a ~23.2 us stall every ~55.8 us (~18 kHz) inside a queuedhipGraphLaunchAQL stream? (e.g., CWSR / preemption / GFXOFF / RLC / DPM state machine?) - Is there a known kernel parameter, firmware update, or
ppfeaturemasksetting to prevent this stall state ongfx1201? - Why does
pp_dpm_sclkon R9600D (0x7551,amdgpu 6.16.13) only expose up to1080Mhz, causingpower_dpm_force_performance_level=highto underclock the card to ~1050 MHz?
- Lingua principale
- C
- Stelle
- 472
- Fork
- 153
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di ROCm/amdgpu
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 15/100
-
[BUG] KFD deadlock: profiler_lock and the DQM lock are taken in opposite orders (profiler release vs create_queue_cpsch), all of /dev/kfd hangs on MI355X with amdgpu-dkms 7.1.3Forse già presa @benrichard-amd l’ha presa 5 giorni fa. Aperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 18/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
Issue simili
-
documentation
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
Life-Framework/Life-Framework#5378 ·
I maintainer di solito rispondono entro 1 giorno
-
Bug Status: Needs Triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
bug status: planned ui
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
ChupathingyCE/chupathingyce#2126 ·
I maintainer di solito rispondono entro 1 giorno
-
good first issue simulation
Difficoltà 1/5 1-3 ore Idoneità per principianti 92/100
MarcosAsh/Lattice_Fluid_Dynamics#270 ·
I maintainer di solito rispondono entro 1 giorno
-
needs-kind
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 82/100
falcosecurity/libs#3173 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno