Repository navigation
cs_w32_dot2_f16: words 4 and 5 are the unclamped hardware results (with #8652) - #1
Open
crastinator wants to merge 2 commits into
Open
crastinator wants to merge 2 commits into
crastinator wants to merge 2 commits into
Conversation
The clamp bit of v_dot2_f32_f16 is encoded, but an RX 6700 XT (gfx1031, tools/hw_oracle) ignores it: 10.5, -8.5, 1.25, NaN and +-inf come back unclamped in wave32 and wave64 under every MODE tried, and 2,560 random and special inputs per wave size give the same words with and without clamp, while v_fma_f32 clamp in the same kernels clamps. The translator clamped the sum to [0, 1]; it now accepts clamp and leaves the result alone. v_dot2c_f32_f16 has no clamp bit in VOP2 and no VOP3 form on gfx103x (llvm-mc rejects _e64 and calls the bytes an invalid encoding), so a clamp on it is refused instead of guessed. tests/semantic/test_dot2_f32_f16_clamp_hw.py pins 14 measured words and a hand-written fixture; both fail on the old translator. design.md gets a contract row.
RDNA2 hardware ignores v_dot2_f32_f16's clamp bit (gfx1031, tools/hw_oracle), and with the translator fix the fixture's clamp cases come out as 10.5 and -8.5, not 1.0 and 0. The expected words in check.py and run_gpu_tests.py, the fixture's header and the design.md sentence now say so.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
For #7315 (ItsNotRexed/Leonida). This makes
cs_w32_dot2_f16agree with RDNA2 hardware and with ItsNotRexed/Leonida#8652.Two commits on top of your head
b59a90adf:39c3b849: #8652's translator change (v_dot2_f32_f16clampis a no-op on the hardware;v_dot2c_f32_f16clampis refused), cherry-picked. Only design.md needed a merge with your row. If #8652 lands first, this commit drops out on a rebase.fca2f93a: out[4] / out[5] become the unclamped hardware words0x41280000(10.5) and0xc1080000(-8.5), incheck.py,run_gpu_tests.py, the fixture header and your design.md sentence. The other six words don't change.Why: on an RX 6700 XT (gfx1031),
tools/hw_oraclereturns 10.5 / -8.5 for those two instructions (details in #8652 and my earlier comment on #7315). matheusfermiano-source got the same words on a Radeon 660M (gfx1035) on #8652.Tested on the RX 6700 XT (RADV Mesa 26.3.1, CachyOS, Linux 7.3.5):
run_gpu_tests.py --filter cs_w32_dot2_f16: PASS natively and withLEONIDA_W64_EMULATE=1,1093140480 1096810496 3238526976 1095237632 1093140480 3238526976 1092354048 1052770308.run_gpu_tests.py: 224/241, 16 skipped. The one failure isms_wave_info_s3, which is intermittent onmain(#6172).test_dot2_f32_f16_clamp_hwandtest_alu_dot_complete: OK. The pytest files for the GPU runner,test_shader_checksandtest_rdna2_decodegive the same failures as your headb59a90adf.With this, #7315 depends on #8652 (or carries it). AI-assisted (Claude Code).