Repository navigation
Frame generation: net1's 32 steps on the GPU (HIP and D3D12), bit for bit against the CPU reference - #191
Merged
Conversation
… bit for bit against the CPU reference - fg_add_f16 (HIP) and its D3D12 port fg_add.hlsl: the skip add, y = h(a + b); per-kernel cases in fg_d3d12_check.py - kernel_replay: additive "chain" blocks (buffers that persist between launches, steps, saves, optional timing); "case" blocks unchanged - runner/fg_net1_gpu.py: the whole network from NET1_WIRING on both back ends; every step output compared raw (sentinels, slack) and against the CPU reference; a half-grid negative control per kernel; synthetic weights, odd sizes, special values; --model for a converter output file (execute-only); --timing as information only - FG kernels still built only through --only; Model M / Model L kernel sets unchanged Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
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.
Issue #96 (frame generation), lane groundwork: net1's 32 steps run on the GPU on both back ends and match the CPU reference bit for bit.
What changes
fg_add_f16, net1's skip add (y = h(a + b)), inclean/fg/kernels/fg_net1.hip, plus its D3D12 portclean/dx12/kernels/fg_add.hlsl. Per-kernel cases are added tofg_d3d12_check.py: random pairs, and every pair of thirteen special values.clean/dx12/tests/kernel_replay.cppgets additivechainblocks: device buffers that persist between launches,steplines (@idpointers or 32-bit values),save, and an optionaltime <runs>. Existingcaseblocks parse and run as before.clean/fg/runner/fg_net1_gpu.pybuilds net1 fromNET1_WIRING: one launch per step, every buffer resident, and no host round trip between steps. It runs on HIP in-process and on D3D12 as one chain per case. Then:--model, the weights of a converter output file of the preset-FG map, onnet1_digest.py's fixed input. Execute-only: the files the tool writes for the replay are deleted after the run, and it prints only counts and digests.--timing(information only) runs a 512 x 512 probe that times every launch. Only if every single launch, scaled up, stays under 250 ms does it time net1 at 1920 x 1080 and 2560 x 1440 input pixels on both back ends.build_dx12.py --only. The Model M / Model L kernel sets andkernel_sets.jsonare unchanged.Tested
python -m unittest discover -s clean/fg/tests -t .: 77 OK, including 4 new plan tests (every step output's shape against the reference buffers, launch arguments, natural weight order, chain lines).clean/dx12/tests/test_kernel_sets.py: 4 OK.GPU (one GPU slot each, under its cap):
fg_d3d12_check.py --run: 244 cases and 1,502,364 values. HIP matches D3D12 in raw bytes and matches the CPU reference; all four negative controls were caught (add: 973 bytes).fg_net1_gpu.py --run, synthetic weights: 4 cases, 128 step outputs and 1,290,608 values, all bit for bit, with 16 of 16 negative controls caught.Timing line, information only and no claims (synthetic weights, buffers resident, mean of 5 runs after a warm-up; HIP: device events, D3D12: wall time per synchronised run):
The longest single launch measured 102 ms. Both back ends' outputs were identical at both sizes. These kernels are exactness references, one scalar output per lane, and not tuned.
public_gates.py: must-pass gates pass. The leak and number LOOK lines are at main's baseline, with none in the changed files.Not tested