Repository navigation
Model L: D3D12 port of the reconstruction kernel l_post_recon, byte for byte against its HIP kernel - #136
Merged
Conversation
…or byte against its HIP kernel clean/dx12/kernels/l_post.hlsl ports l_post_recon (l_post.co, HDR) following the HIP ISA: FP16 gather ops with opaque cuts against the driver's FP16 fusion and FP32 widening, software RNE conversions, single-rounding history texel, IEEE divisions. l_d3d12_ops_check.py gains the reconstruction cases (zero-weight and FP16-underflow known answers, extreme kernel shapes, unstaged R = D, exposure pointer, non-finite inputs) and checks that bytes no back end writes keep each back end's own sentinel. Refs #89 Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
…d3d12 Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com> # Conflicts: # clean/l/runner/l_d3d12_ops_check.py
This was referenced Nov 14, 2026
Merged
phantoslayer21
marked this pull request as ready for review
November 14, 2026 03:32
This was referenced Nov 14, 2026
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.
Refs #89
D3D12 port of Model L's reconstruction kernel
l_post_recon(l_post.co, HDR, from #128), byte for byte against the HIP kernel.What
clean/dx12/kernels/l_post.hlsl(new):@wg-kernel l_post_recon co=l_post.co block=256 wave=32, the same arguments, buffers, layouts and grid as the HIP kernel. It follows the HIP ISA (llvm-objdump ofl_post.co):wg_f2h); one rounding for the kernel shape and the history texel (wg_mul_f16, as HIP's v_fma_mixlo_f16); IEEE divisions (wg_div).clean/l/runner/l_d3d12_ops_check.py: newl_post_reconcases:l_post_check.py's random, reset and extreme kernel-shape cases;offset_0.1: total weight 0 everywhere, spec part 3 Q1);offset_0.05: total weight > 0, every FP16 weight 0, Q3);expopointer (one exposure 0);The harness change: bytes that no back end writes (the display rows' pitch padding, and 64 slack bytes after each buffer) must keep each back end's own sentinel. The other kernels' comparison is unchanged.
GPU record
l_d3d12_ops_check.py --run --seeds 6 --kernels l_post_recon, one GPU slot, on this branch's port and main'sl_post.co.l_post_reconswin_block_c96_ncl_post_reconbytes are written bytes. The rest is padding and slack, and each back end kept its own sentinel there: 0 bad.l_post_recon_s0_0again on D3D12 with half its workgroups): caught, 8,498 differing bytes.git diff --stat origin/main: the newl_post.hlsland the Python harness only), and no file includesl_post.hlsl;w64/post_tf_f32_p12_diet_vsit,exposure_auto_diet,input_encoder,lev/input_encoder,swin_block_c96_nc,l_coef,l_coef_pack12,native_fill,color_divide,scale_rgb.l_post.hipand Model M'spost.hipdid not change in that merge.Tested
Not tested
l_post_recon_p12follows in its own PR.l_post_check.py. This PR proves D3D12 = HIP.