Repository navigation
compute: accept DPP16 on binary16 VOP2 add, sub, subrev and mul - #3188
Conversation
|
LGTM. The DPP16 support for binary16 VOP2 ops looks correct, particularly the handling of |
|
Thanks. The size came from the old base ( AI-assisted. |
The direct compute path refused any DPP source on v_add_f16, v_sub_f16, v_subrev_f16 and v_mul_f16. src0 now goes through the existing DPP16 lane permutation, and the f16 op reads the low half of the permuted word. FI, BOUND_CTRL and inactive source lanes follow the 32-bit DPP rules. For these ops the row and bank masks gate the destination write; other DPP ops still require full masks. DPP8 and clamp/omod stay refused. native_f16_alu_hardware adds four DPP16 cases under a sparse EXEC: quad_perm with FI, row_shr:1 without FI, a partial row mask and a partial bank mask with BOUND_CTRL, against the exact binary16 reference. AI-assisted.
pigalot
left a comment
There was a problem hiding this comment.
I reviewed ce002d89 merged over main 6d690968. The merge is clean (tree 97e61f4c) and git diff --cached --check is clean. The diff matches the four-file scope described in the last comment.
What I traced.
- Opcodes:
binary16_alucovers onlyv_add_f16,v_sub_f16,v_subrev_f16andv_mul_f16. DPP16 decoding of these is limited to the direct profile; other paths still refuse. - Masks: partial
row_maskandbank_maskare accepted only for this half-precision path. LaneLin wave32 uses rowL >> 4(plus 2 for the upper half in split wave64) and bank(L >> 2) & 3. That matches the GFX10 DPP definition of a row as 16 lanes and a bank as 4 lanes within a row. - Writes: a write needs a usable source lane and both mask bits. Without
bound_ctrl, an out-of-row or inactive source keeps the destination. WithBOUND_CTRL:0, the source reads 0. - Modifiers: the DPP
neg/absbits are decoded from their GFX10 DPP-word positions, and the high 16 bits of the destination are kept.
What I ran. I built compile_dxil native_store_replay native_compute_ir_dump in dev and release (plus offscreen_check in release), then ran
python .agentic\scripts\with_gpu_lock.py ctest --test-dir out/build/<preset> --no-tests=error -j 1 -V -R '^(native_f16_alu_(ir|hardware)|native_dpp[a-z0-9_]*_hardware|native_sdwa_f16[a-z0-9_]*|native_direct_container|native_permlane[a-z0-9_]*)$'- Results: 8/8 pass in Debug and Release
/O2, with no skips.native_f16_alu_hardwarematched all 256 words of the DPP case, with the high halves kept. - Negative control: on
main886a5a28, the PR'snative_f16_alu_check.pyfails in both modes.irandgpustop at+0x60: unsupported v_add_f16 DPP form.
Mutants in src/gfx1013_direct_compute.inl. For each, I rebuilt in dev and ran native_f16_alu_(ir|hardware):
| Mutant | Result |
|---|---|
| DPP permutation ignored (own lane read) | killed (word 8: 0xabcd3c00 vs 0xabcd3c02) |
row_mask ignored |
killed (word 74) |
bank_mask ignored |
killed (word 27) |
bank computed from lane >> 3 |
killed (word 27) |
| inactive source lane still writes | killed (word 9) |
row computed from lane >> 3 |
killed (word 46) |
bound_ctrl ignored |
killed (word 11) |
Restored and rebuilt afterwards; git diff --quiet is clean.
Verdict: approve on ce002d89.
Environment: NVIDIA GeForce RTX 5090 driver 610.88, Windows 11 25H2 build 26200.9974, MSVC 19.52.37029, Windows SDK 10.0.28000.0 DXC, Python 3.12.10, wave32, debug layer off.
CI: Build and test on Windows passes on ce002d89.
This reply was AI-assisted.
Fixes #3167. Part of #2935. Target branch
main.Change (
src/gfx1013_compute_native.cpp,src/gfx1013_direct_compute.inl): direct compute accepts DPP16 on the binary16 VOP2 opsv_add_f16,v_sub_f16,v_subrev_f16andv_mul_f16.Tests. The setup was Windows 11 build 26300.9974 with an NVIDIA GeForce RTX 5080 (driver 32.0.16.2101) and DXC from the Windows SDK 10.0.26100, on
main80668b97plus this commit.native_f16_alu_hardwareadds four DPP16 cases under a sparse EXEC, against the exact binary16 reference intests/f16_packed_model.py:quad_perm:[1,0,3,2]with FI;row_shr:1without FI;native_f16_alu_ir, thenative_dpp*tests,native_sdwa_f16*,native_direct_containerandnative_permlane*pass.native_f16_alu_hardware:Measured on a local capture (counts and instruction shape only) with
compile_dxil --jobs 8 gfx1013-direct-cs@36 --requestsonmain80668b97.quad_perm:[1,0,3,2] row_mask:0xf bank_mask:0xf fi:1.AI-assisted.