[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)
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 8/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- c, pytorch
- Lĩnh vực
- operating-systems, performance
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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?
- Ngôn ngữ chính
- C
- Star
- 472
- Fork
- 153
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của ROCm/amdgpu
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 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.3Có thể đã có người làm @benrichard-amd đã nhận 5 ngày trước. Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 18/100
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
Issue tương tự
-
documentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
Life-Framework/Life-Framework#5378 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Bug Status: Needs Triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug status: planned ui
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
ChupathingyCE/chupathingyce#2126 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
good first issue simulation
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 92/100
MarcosAsh/Lattice_Fluid_Dynamics#270 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
needs-kind
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 82/100
falcosecurity/libs#3173 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày