Under Proton (RADV/ACO), three Model M kernels go over the 192-VGPR bound
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
- 難度
- 5/5
- 預估耗時
- 一週以上
- 新手友好度
- 15/100
- Issue 類型
- 缺陷
- 描述清晰度
- 需要釐清
- 活躍度
- 活躍
- 技術堆疊
- cpp
研究方向
The issue asks for a maintainer decision, not a code change: restructure the kernels, report the SPIR-V to Mesa ACO, or leave it. Start with clean/dx12/vgpr_limits.json and clean/dx12/README.md, then the kernels under clean/dx12/kernels built by build_dx12.py. Reproducing the VGPR counts needs RADV_DEBUG=shaderstats under Wine with native_direct_test. Done means a chosen path, agreed with the maintainer, and no code change to the kernels has been made yet.
由索引模型根據 Issue 內容生成。
描述
What
Under Proton, Mesa's ACO compiler needs more VGPRs than clean/dx12/vgpr_limits.json allows for three of Model M's heaviest kernels. Per vgpr_limits.json's own note, they then fit one 256-lane workgroup per CU instead of two:
| Kernel | VGPRs under ACO | Bound | Waves/SIMD | GPU time per frame |
|---|---|---|---|---|
swin_block_c64_nc |
240 | 192 | 6 | 0.30 ms |
swin_block_c96_pm_rev_nc |
256 | 192 | 5 | 0.26 ms |
bneck/swin_bneck6_mbo_nc |
256 | 192 | 5 | 0.43 ms |
swin_block_c96_add_xe_xo_nc |
192 | 192 | 8 | 0.21 ms |
d1p12/swin_block_c64_add_dec0_nc |
192 | 192 | 8 | 0.43 ms |
That's about 1.0 ms of Model M's roughly 2.3 ms on the direct route, at 1706×960 → 2560×1440. The repository's notes put a lost workgroup per CU at +38 µs (swin_block_c96_add_xe_* at 215 VGPRs) to +103 µs (dec0 at 201/215 VGPRs) per frame at 1440p Quality. So this is probably a few tenths of a millisecond on Linux. I haven't measured that directly: I can't force ACO to 192 VGPRs to compare.
It isn't loop unrolling. That was my first guess, because of the "unroll loops despite [loop]" note in clean/dx12/README.md, so I checked:
swin_block_c64_nc's DXIL has no loops at all: DXC already unrolled it, so AMD's Windows compiler gets the same straight-line code and fits it in ≤192 VGPRs (the build's RGA check).swin_block_c96_pm_rev_ncand the bottleneck keep their loops under ACO (2 and 8 back-edges).
So it's ACO's register allocation on these large kernels. Before scheduling it's already about 198 VGPRs for c64, and 194 and 230 for the other two.
How it was measured (synthetic data only)
- RX 9070 XT, Mesa RADV 27.0.0-devel, GE-Proton 11-11's Wine, vkd3d-proton
5b1089c8with dxil-spirv #362 (dxil-spirv114e664eplus the PR). - Kernels built from main's
clean/dx12/kernels(unchanged since a8500cb) withbuild_dx12.py. native_direct_test(direct route, check mode, 3 frames) run under Wine withRADV_DEBUG=shaderstats(VGPRs, waves, LDS) andRADV_DEBUG=shaders(ACO's ISA).- Kernels matched by their WMMA count: each SPIR-V cooperative-matrix multiply-add becomes two
v_wmmain ACO's ISA (736, 560 and 1312 for the three), and by LDS size where that could be read. - GPU times are from
WG_D3D12_PROFILEin the same harness. Profiling adds overhead, so treat them as rough.
What could be done (your call):
- Restructure these kernels so they need fewer registers on any compiler. That would change the Windows DXIL too.
- Report it to Mesa (ACO) with these kernels' SPIR-V as a reproducer. They're WrongGPU's own MIT-licensed code, so the SPIR-V can be shared. I can put that together if you'd rather it went that way.
- Leave it. On Linux this is a few tenths of a millisecond, not a correctness problem.
Related: #29, #10.
- 主要語言
- C++
- 星號
- 12
- 分支
- 2
- 平均合併
- 3 小時 10 分鐘
- 30 天內合併 PR
- 171
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
phantoslayer21/wronggpu 的其他 Issue
-
難度 2/5 1-3 小時 新手友好度 88/100
phantoslayer21/wronggpu#275 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 82/100
phantoslayer21/wronggpu#274 ·
維護者通常 1 天內回覆
-
bug
難度 2/5 1-3 小時 新手友好度 88/100
phantoslayer21/wronggpu#241 ·
維護者通常 1 天內回覆
-
bug build
難度 2/5 1-3 小時 新手友好度 74/100
phantoslayer21/wronggpu#234 ·
維護者通常 1 天內回覆
-
bug build
難度 2/5 1-3 小時 新手友好度 80/100
phantoslayer21/wronggpu#233 ·
維護者通常 1 天內回覆
查看 phantoslayer21/wronggpu 的全部 Issue
相似的 Issue
-
ai_p2
難度 2/5 1-3 小時 新手友好度 80/100
ClickHouse/ClickHouse#132519 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 76/100
juce-framework/JUCE#1810 ·
-
難度 1/5 1 小時以內 新手友好度 82/100
petercorke/robotics-toolbox-python#952 ·
維護者通常 1 天內回覆
-
NatronRenderer: a Python error in the script (-t / project script) doesn't change the exit status未關閉func:engine type:bug
難度 2/5 1-3 小時 新手友好度 72/100
NatronGitHub/Natron#1276 ·
維護者通常 1 天內回覆
-
難度 1/5 1-3 小時 新手友好度 77/100
維護者通常 1 天內回覆