[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)

未关闭
#248 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
8/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
c, pytorch

调研方向

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.

由索引模型根据 Issue 内容生成。

描述

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 ID 0x7551, SKU G2870300, Subsystem 0x0e11, Rev 0xc8, 32 GiB VRAM, isolated to container via /dev/kfd + single render node
  • Kernel: Linux 6.8.0-134-generic (Ubuntu 24.04)
  • Driver: amdgpu 6.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-001
    • MEC: feature 29, 0x00000c80
    • SMC: feature 0, program 0, 0x00684a00 (104.74.0)
    • RLC: feature 1000, 0x00be7e04
    • MES / MES_KIQ: feature 1, 0x00000084
    • SDMA0 / 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., r2 SLOW 402 → r3 FAST 507 → r4–r6 SLOW 400–402; or r2–r5 FAST 504–513 → r6 SLOW).
  • 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 s to 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:

  1. Identical kernel sequence: both states execute the exact same 859 kernels (35 kernels/layer × 24 + tail, zero name diffs) and identical hipGraphLaunch ratio (34.3–34.4 kernels/launch).
  2. 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 hipGraphLaunch packets are followed by a ~23.2 us gap.
  3. Small kernels straddling the stall boundary are stretched by ~16 us: e.g., FillFunctor, _stage2_pow2, reshape_and_cache_flash_kernel, and rms_norm jump 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.
  4. 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 sclk stays 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

  1. Other GPU tenants: rocm-smi --showpids confirms only the single server KFD PID on the GPU across runs.
  2. Thermal throttling: SLOW runs cooler (77–80 °C junction) than FAST (82–83 °C junction).
  3. Host CPU contention: container VLLM:: CPU% is flat at 201% and host CPU busy is 4–6% in both states.
  4. rocm-smi polling interference: un-sampled control runs (sampler=none) still exhibit both ~400 tok/s SLOW and ~506–509 tok/s FAST states.
  5. Other clock domains: mclk (1258 MHz), fclk (2016 MHz), and socclk (1280 MHz) are identical in both states.
  6. Host sysfs power profiles:
    • power_dpm_force_performance_level=manual + pp_power_profile_mode=5 (COMPUTE): still drops to SLOW at round 3 (r2 508.9 → r3–r6 399.8–402.7 tok/s, 1976–1978 MHz, 128–132 W).
    • power_dpm_force_performance_level=high: caps sclk at 1049–1051 MHz (~275 tok/s, 102–105 W) because pp_dpm_sclk only lists 0: 500Mhz, 1: 0Mhz *, 2: 1080Mhz.
  7. 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–r4 497–511 → r5–r6 398–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 static flatPacketData buffer 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

  1. What in amdgpu 6.16.13 / KFD / gfx1201 MEC (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 queued hipGraphLaunch AQL stream? (e.g., CWSR / preemption / GFXOFF / RLC / DPM state machine?)
  2. Is there a known kernel parameter, firmware update, or ppfeaturemask setting to prevent this stall state on gfx1201?
  3. Why does pp_dpm_sclk on R9600D (0x7551, amdgpu 6.16.13) only expose up to 1080Mhz, causing power_dpm_force_performance_level=high to underclock the card to ~1050 MHz?
主要语言
C
星标
472
派生
153
PR 合并指标
30 天内没有已合并 PR

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

ROCm/amdgpu 的其他 Issue

查看 ROCm/amdgpu 的全部 Issue

相似的 Issue

更多 C Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。