Repository navigation
crosslane_fuzz.py: ask for 32-wide subgroups for wave32 and emulated programs (FUZZ-13) - #702
Conversation
…programs (FUZZ-13) run_gpu never set VKC_SUBGROUP_SIZE, unlike lds_fuzz.py and valu_fuzz.py. On AMD (compute default 64) a wave32 program with a group over 32 lanes ran as one 64-wide subgroup and mismatched in wave 1: 23 of 50 programs, reported by @Pierre-Kookis, with VKC_SUBGROUP_SIZE=32 bringing that to 0 of 100. The environment is now built by gpu_env(), which sets VKC_SUBGROUP_SIZE=32 for wave32 programs and for wave64 ones translated with --wave64-emulate; native wave64 keeps the device default, as --w64-native intends. Both callers pass the mode. Four unit tests cover it.
|
AMD check of #702 (8cd37b2). I reported this on #638 and #634, so here is the before and after on the GPU where it showed. Setup: Windows 11. AMD Radeon Graphics (Ryzen 7 7800X3D iGPU, RDNA2), driver 32.0.21043.5001, subgroup 32..64. RTX 4070 Ti SUPER, driver 610.88, subgroup 32. Test programs from main c432cdc (llvm-mingw clang), llvm-mc 23.1.6.
With #702, AMD now gives exactly the NVIDIA counts. The 11 and 12 left in the full run are the maskdata and high-lane classes (#293) on both GPUs. Seed 2, clean, on AMD: 0 mismatches (wave32 38 / 0 / 12, emulate 37 / 0 / 13). (AI-assisted run, counts only.) |
|
Tested 8cd37b2 on Linux (WSL2 Ubuntu), Python 3.12, CPU only (no GPU run): pass
|
|
Tested 8cd37b2 on NVIDIA GeForce RTX 4060 Ti (Ada, subgroup 32..32), driver 621.24, Windows 11; LLVM 21.1.8 (WSL), Vulkan SDK 1.4.363: pass for the 32-wide half. On a device whose only subgroup size is 32, asking for The AMD half (a 64-wide default) still needs an AMD GPU. AI-assisted. |
Item: FUZZ-13 (claimed in #634), found by @Pierre-Kookis.
tools/crosslane_fuzz.py'srun_gpu()never setVKC_SUBGROUP_SIZE, unlikelds_fuzz.pyandvalu_fuzz.py. On AMD, whose compute default is 64, a wave32 program with a group over 32 lanes ran as one 64-wide subgroup and mismatched in wave 1: 23 of 50 even with--no-maskdata --no-w32-hi-lanes, and 0 of 100 withVKC_SUBGROUP_SIZE=32(the finding in #634).gpu_env(prog, emulate, dump)buildsvk_compute_test's environment, asrun_gpudid. It now also setsVKC_SUBGROUP_SIZE=32for wave32 programs and for wave64 ones translated with--wave64-emulate, the same rule as the other two fuzzers.--w64-nativeis for (on a 32-wide GPU it is the documented approximate case).run_gputakes the mode, and both callers (the main loop andstill_fails, used by minimisation) passmode == "emulate".Tests:
tests/test_crosslane_fuzz.pygets aGpuEnvclass with 4 tests: wave32 and emulated wave64 ask for 32; native wave64 leaves the caller's value alone and adds none; the buffer size, dump path and inherited variables are kept.python -I tests/test_crosslane_fuzz.py: 19 tests OK.python -m compileallis clean.Not run end to end: I have no
llvm-mchere, and my GPU (NVIDIA RTX 4070 SUPER) is always 32-wide, so it could not show the bug anyway. An AMD run ofpython -I tools/crosslane_fuzz.py --programs 50 --wave 32before and after would confirm it; the finding's numbers say it should go from 23/50 to 0.AI-assisted.