From 0e01cb032aea25331f95e153d951050d12ca2fc6 Mon Sep 17 00:00:00 2001 From: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com> Date: Sat, 14 Nov 2026 16:21:15 -0500 Subject: [PATCH] Frame generation: net1 fused tier B (11 launches), D3D12 within 1.5x of HIP, exact path selectable - fg_mpair_{b,d4..d0} (HIP + fg_mpair.hlsl): the bottleneck and each decoder level as two chained 1 x 1 convolutions in registers, the decoders' upscale and skip add computed per input fragment - fg_fast16.h: leaky ReLU with fg_leaky16's bits from one product and one rounding (checked on all 65,536 inputs on HIP, D3D12 and the CPU), the skip add; fg_mconv's epilogue uses it - D3D12: float16 rounding of whole fragments by the driver conversion instead of the software wg_f2h; lanes past the grid end compute a clamped pixel (a validity array corrupted other lanes' matrix rows); both in the README's driver exceptions - runner/fg_net1_mma.py: paths fused / tierb / exact; gates HIP == D3D12 (sentinels, slack, half-grid negative control per kernel incl. a 768 x 768 case), fused == tierb, the leaky check; report with absolute and relative differences; timing; records/net1-fused-2026-11-14.json Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com> --- clean/dx12/README.md | 12 +- clean/dx12/kernels/fg_leaky_fast.hlsl | 28 + clean/dx12/kernels/fg_mconv.hlsl | 52 +- clean/dx12/kernels/fg_mpair.hlsl | 249 + clean/fg/FORMATS.md | 19 +- clean/fg/README.md | 8 +- clean/fg/kernels/fg_fast16.h | 25 + clean/fg/kernels/fg_net1_mma.hip | 167 +- clean/fg/records/net1-fused-2026-11-14.json | 5926 +++++++++++++++++++ clean/fg/runner/fg_net1_mma.py | 354 +- clean/fg/tests/test_fg_net1_mma_plan.py | 49 + 11 files changed, 6762 insertions(+), 127 deletions(-) create mode 100644 clean/dx12/kernels/fg_leaky_fast.hlsl create mode 100644 clean/dx12/kernels/fg_mpair.hlsl create mode 100644 clean/fg/kernels/fg_fast16.h create mode 100644 clean/fg/records/net1-fused-2026-11-14.json diff --git a/clean/dx12/README.md b/clean/dx12/README.md index 66f711db..35330d61 100644 --- a/clean/dx12/README.md +++ b/clean/dx12/README.md @@ -20,7 +20,7 @@ as its HIP kernel (`clean/dx12/compare.py` proves it per kernel on synthetic fra | `dxil_asm.cpp` | tool used by the build (assembles the rewritten DXIL listing) | | `compare.py` | HIP vs hybrid D3D12, every stage output / state buffer byte for byte | | `kernels/exposure.hlsl` | the reference port (`exposure_auto_diet`): copy its structure | -| `kernels/fg_*.hlsl` | frame generation's ports (#96, `co=fg_*.co`): groundwork, built only when `--only` names them, never by a full build (`is_frame_gen`), so the Model M / Model L sets stay as they are; checks: `clean/fg/runner/fg_d3d12_check.py` (each kernel), `clean/fg/runner/fg_net1_gpu.py` (net1's 32 steps as a `kernel_replay` chain) | +| `kernels/fg_*.hlsl` | frame generation's ports (#96, `co=fg_*.co`): groundwork, built only when `--only` names them, never by a full build (`is_frame_gen`), so the Model M / Model L sets stay as they are; checks: `clean/fg/runner/fg_d3d12_check.py` (each kernel), `clean/fg/runner/fg_net1_gpu.py` (net1's 32 steps as a `kernel_replay` chain), `clean/fg/runner/fg_net1_mma.py` (net1's fast path on the matrix instructions, fused / unfused / exact) | | `tests/kernel_replay.cpp` | replays launches from a case file on the native D3D12 device; `chain` blocks run several launches on buffers that persist between them (a whole network, optionally timed) | ## Arithmetic mode (why build_dx12.py and nothing else) @@ -71,6 +71,16 @@ The rules above hold per operation. Across operations the gfx1201 D3D12 shader c (`n + (wg_grid_ >> 31)`; `swin_common.hlsli` `sw_zero()`), and fold LDS offsets with `sw_zero_bits()`. * HLSL 2021 `?:`, `&&`, `||` short-circuit and become branches (one load in flight per branch): use `select()`, `and()`, `or()` in hot code. +* **lanes past the end of the grid corrupted other lanes' matrix results** (frame generation's `fg_mpair`, 2026-11-14): + a per-lane `bool valid[]` with `pc = select(valid, p, 0)` for the pixel, then WMMAs, then `if (valid) store`. With part + of the last 16-pixel group past the end, the valid lanes got NaN in exactly the output rows whose A-fragment row sits in + an invalid lane; HIP was right. Remedy: no validity array; every lane computes a clamped pixel (`min(p, n - 1)`) and + only the store tests `p < n`. Check odd grid sizes in every matrix port. +* **`wg_f2h` is software** (~20 instructions per value; a `(half)` cast rounds toward zero here). In a hot loop round + a whole fragment with the driver conversion, `wg_to_f16_ags` (v_cvt_f16_f32, HIP's `(_Float16)` bits), and widen back + with `wg_h2f`; for 8 values that are not a matrix result (an element-wise stage), XOR each with an opaque zero first + (`fg_f2h8` in `fg_mpair.hlsl`) so the producing multiply is not folded into the conversion (see above: a folded + product turns -0 into +0). Frame generation's net1 fast path went from 3.5x to 1.5x HIP's GPU time with this. The native helper regression additionally constructed tiny exact values that round to the smallest normal FP32 number: `0x00800000 * 0x3f7fffff` and `0x00ffffff / 0x40000000`. The multiply flushes before rounding on this driver; diff --git a/clean/dx12/kernels/fg_leaky_fast.hlsl b/clean/dx12/kernels/fg_leaky_fast.hlsl new file mode 100644 index 00000000..9ef83465 --- /dev/null +++ b/clean/dx12/kernels/fg_leaky_fast.hlsl @@ -0,0 +1,28 @@ +// SPDX-License-Identifier: MIT +// D3D12 port of fg_leaky_fast_f16 of fg_net1_mma.co (clean/fg/kernels/fg_net1_mma.hip): fg_leaky_fast16 on n float16 +// values, the exhaustive check of the fast path's leaky ReLU (runner/fg_net1_mma.py). Built only when --only names it. +// +// @wg-kernel fg_leaky_fast_f16 co=fg_net1_mma.co block=256 wave=32 args=p,p,u +#include "wg_platform.hlsli" + +#define FG_FN +#define FG_I64 int64_t +#define FG_FBH32(v) firstbithigh((uint)(v)) +#include "../../fg/kernels/fg_exact16.h" +#define FG_F2H(f) wg_f2h(f) +#define FG_H2F(h) wg_h2f(h) +#define FG_SEL(c, a, b) select(c, a, b) +#include "../../fg/kernels/fg_fast16.h" + +WG_ARGS_BEGIN + uint x, y; // pointers (arena byte offsets) + int n; +WG_ARGS_END + +WG_KERNEL(fg_leaky_fast_f16) +{ + WG_SETUP(); + const int idx = (int)(wg_block_id() * 256u + wg_lane_id()); + if (idx >= n) return; + wg_st16(y, (uint)idx * 2u, fg_leaky_fast16(wg_ld16(x, (uint)idx * 2u))); +} diff --git a/clean/dx12/kernels/fg_mconv.hlsl b/clean/dx12/kernels/fg_mconv.hlsl index 3e60ae08..9f337998 100644 --- a/clean/dx12/kernels/fg_mconv.hlsl +++ b/clean/dx12/kernels/fg_mconv.hlsl @@ -2,8 +2,8 @@ // D3D12 port of frame generation's matrix convolution (issue #96; tier B of the net1 fast path): fg_mconv of // fg_net1_mma.co (clean/fg/kernels/fg_net1_mma.hip), byte-identical to HIP: the same fragments and chunk order, // v_wmma_f32_16x16x16_f16 through the driver channel (wg_wmma_f16) with the float16 accumulator as C, its result rounded -// to float16 after every chunk (wg_f2h = v_cvt_f16_f32, nearest even), the exact integer leaky ReLU and pool -// (fg_exact16.h). Driver rules (clean/dx12/README.md): every load of a chunk before its first matrix call; branchless +// to float16 after every chunk (wg_f2h = v_cvt_f16_f32, nearest even), the leaky ReLU of fg_fast16.h (fg_leaky16's +// bits) and the exact pool (fg_exact16.h). Driver rules (clean/dx12/README.md): every load of a chunk before its first matrix call; branchless // selects; the chunk loop bound through an opaque zero (no forced unrolling); store pointers through wg_uniform(). // Built only when --only names the kernels (fg_ kernels are in no model's set). // @@ -16,6 +16,10 @@ #define FG_I64 int64_t #define FG_FBH32(v) firstbithigh((uint)(v)) #include "../../fg/kernels/fg_exact16.h" +#define FG_F2H(f) wg_f2h(f) +#define FG_H2F(h) wg_h2f(h) +#define FG_SEL(c, a, b) select(c, a, b) +#include "../../fg/kernels/fg_fast16.h" #ifndef FG_MT #define FG_MT 4 @@ -29,6 +33,27 @@ WG_ARGS_END uint fg_opq0() { return wg_grid_ >> 31; } // an opaque zero (the grid size is below 2^31) uint4 fg_pack8(uint r[8]) { return uint4(r[0] | (r[1] << 16), r[2] | (r[3] << 16), r[4] | (r[5] << 16), r[6] | (r[7] << 16)); } +uint fg_half(uint4 u, uint j) +{ + const uint d = select(j < 2u, u.x, select(j < 4u, u.y, select(j < 6u, u.z, u.w))); + return (d >> ((j & 1u) * 16u)) & 0xffffu; +} +// 8 packed float16 values -> the float32 accumulator fragment (exact) +v8f fg_widen(uint4 hp) +{ + v8f r; + [unroll] for (uint v = 0; v < 8; ++v) r.v[v] = wg_h2f(fg_half(hp, v)); + return r; +} +// One chunk (tier B): the matrix instruction, then the whole fragment rounded to float16 by the driver channel's +// conversion (v_cvt_f16_f32, nearest even: HIP's (_Float16) of each element; the software wg_f2h costs ~20 instructions +// per element on this driver, where a (half) cast rounds toward zero). hp keeps the packed float16 accumulator. +void fg_chunk_b(uint4 av, uint4 bv, inout v8f c, inout uint4 hp) +{ + const v8f d = wg_wmma_f16(av, bv, c); + hp = wg_to_f16_ags(d); + c = fg_widen(hp); +} WG_KERNEL(fg_mconv) { @@ -44,13 +69,15 @@ WG_KERNEL(fg_mconv) const uint py = (uint)wg_uniform((int)y), pp = (uint)wg_uniform((int)p); v8f a32[FG_MT][2]; + uint4 h16[FG_MT][2]; // the same accumulator as packed float16 [unroll] for (int mt = 0; mt < FG_MT; ++mt) { const int o0 = (mg * FG_MT + mt) * 16 + 8 * hh; - [unroll] for (uint v = 0; v < 8; ++v) { - const float bv = wg_h2f(wg_ld16(b, (uint)(o0 + (int)v) * 2u)); - a32[mt][0].v[v] = bv; - a32[mt][1].v[v] = bv; - } + uint bb[8]; + [unroll] for (uint v = 0; v < 8; ++v) bb[v] = wg_ld16(b, (uint)(o0 + (int)v) * 2u); + h16[mt][0] = fg_pack8(bb); + h16[mt][1] = h16[mt][0]; + a32[mt][0] = fg_widen(h16[mt][0]); + a32[mt][1] = a32[mt][0]; } const int nq_loop = nq + (int)fg_opq0(); for (int q = 0; q < nq_loop; ++q) { @@ -72,18 +99,15 @@ WG_KERNEL(fg_mconv) [unroll] for (int mt2 = 0; mt2 < FG_MT; ++mt2) fa[mt2] = wg_ld128(wf, (uint)((((mg * FG_MT + mt2) * nq + q) * 32 + (int)lane) * 16)); [unroll] for (int mt3 = 0; mt3 < FG_MT; ++mt3) - [unroll] for (int nt2 = 0; nt2 < 2; ++nt2) { - const v8f d = wg_wmma_f16(fa[mt3], fb[nt2], a32[mt3][nt2]); - [unroll] for (uint v3 = 0; v3 < 8; ++v3) a32[mt3][nt2].v[v3] = wg_h2f(wg_f2h(d.v[v3])); - } + [unroll] for (int nt2 = 0; nt2 < 2; ++nt2) fg_chunk_b(fa[mt3], fb[nt2], a32[mt3][nt2], h16[mt3][nt2]); } [unroll] for (int mt4 = 0; mt4 < FG_MT; ++mt4) { const int o0 = (mg * FG_MT + mt4) * 16 + 8 * hh; uint r0[8], r1[8]; [unroll] for (uint v4 = 0; v4 < 8; ++v4) { - const uint h0 = wg_f2h(a32[mt4][0].v[v4]), h1 = wg_f2h(a32[mt4][1].v[v4]); - r0[v4] = select(act == 1, fg_leaky16(h0), h0); - r1[v4] = select(act == 1, fg_leaky16(h1), h1); + const uint h0 = fg_half(h16[mt4][0], v4), h1 = fg_half(h16[mt4][1], v4); + r0[v4] = select(act == 1, fg_leaky_fast16(h0), h0); + r1[v4] = select(act == 1, fg_leaky_fast16(h1), h1); } if (px < W && py0 < H) wg_st128(py, (uint)((py0 * W + px) * cout + o0) * 2u, fg_pack8(r0)); if (px < W && py0 + 1 < H) wg_st128(py, (uint)(((py0 + 1) * W + px) * cout + o0) * 2u, fg_pack8(r1)); diff --git a/clean/dx12/kernels/fg_mpair.hlsl b/clean/dx12/kernels/fg_mpair.hlsl new file mode 100644 index 00000000..46c56eb3 --- /dev/null +++ b/clean/dx12/kernels/fg_mpair.hlsl @@ -0,0 +1,249 @@ +// SPDX-License-Identifier: MIT +// D3D12 port of frame generation's fused 1 x 1 pairs (issue #96; tier B): fg_mpair of +// fg_net1_mma.co (clean/fg/kernels/fg_net1_mma.hip), byte-identical to HIP. Two chained 1 x 1 convolutions in registers +// (the first's result fragment is the second's input fragment), each chunk one v_wmma_f32_16x16x16_f16 through the driver +// channel with float16 rounding after it; MODE 0: input buffer (bottleneck); MODE 1: net1's upscale of the coarse input +// plus the skip, computed per input fragment with the exact upscale / add arithmetic. Driver rules (clean/dx12/README.md): +// loads before the matrix calls of a group, branchless selects, runtime loop bounds through an opaque zero, the store +// pointer through wg_uniform(). Built only when --only names the kernels. +// +// @wg-kernel fg_mpair_b co=fg_net1_mma.co entry=fg_mpair block=256 wave=32 args=p,p,p,p,p,p,p,u,u,u,u,u,u,u,u defines=FG_MODE=0,FG_C1T=32,FG_C2T=16,FG_NT=1,FG_LAZY=1 +// @wg-kernel fg_mpair_d4 co=fg_net1_mma.co entry=fg_mpair block=256 wave=32 args=p,p,p,p,p,p,p,u,u,u,u,u,u,u,u defines=FG_MODE=1,FG_C1T=16,FG_C2T=8,FG_NT=1,FG_LAZY=1,FG_CINT=16 +// @wg-kernel fg_mpair_d3 co=fg_net1_mma.co entry=fg_mpair block=256 wave=32 args=p,p,p,p,p,p,p,u,u,u,u,u,u,u,u defines=FG_MODE=1,FG_C1T=8,FG_C2T=8,FG_NT=1,FG_LAZY=0 +// @wg-kernel fg_mpair_d2 co=fg_net1_mma.co entry=fg_mpair block=256 wave=32 args=p,p,p,p,p,p,p,u,u,u,u,u,u,u,u defines=FG_MODE=1,FG_C1T=8,FG_C2T=4,FG_NT=1,FG_LAZY=0 +// @wg-kernel fg_mpair_d1 co=fg_net1_mma.co entry=fg_mpair block=256 wave=32 args=p,p,p,p,p,p,p,u,u,u,u,u,u,u,u defines=FG_MODE=1,FG_C1T=4,FG_C2T=2,FG_NT=2,FG_LAZY=0 +// @wg-kernel fg_mpair_d0 co=fg_net1_mma.co entry=fg_mpair block=256 wave=32 args=p,p,p,p,p,p,p,u,u,u,u,u,u,u,u defines=FG_MODE=1,FG_C1T=2,FG_C2T=1,FG_NT=2,FG_LAZY=0 +#include "wg_platform.hlsli" + +#define FG_FN +#define FG_I64 int64_t +#define FG_FBH32(v) firstbithigh((uint)(v)) +#include "../../fg/kernels/fg_exact16.h" +#define FG_F2H(f) wg_f2h(f) +#define FG_H2F(h) wg_h2f(h) +#define FG_SEL(c, a, b) select(c, a, b) +#include "../../fg/kernels/fg_fast16.h" + +#ifndef FG_MODE +#define FG_MODE 1 +#define FG_C1T 2 +#define FG_C2T 1 +#define FG_NT 2 +#define FG_LAZY 0 +#endif + +WG_ARGS_BEGIN + uint x, a, wf1, b1, wf2, b2, y; // pointers (arena byte offsets) + int C, H, W, hi, wi; + uint rx, ry; + int act2; +WG_ARGS_END + +uint fg_opq0() { return wg_grid_ >> 31; } // an opaque zero (the grid size is below 2^31) + +struct FgTap { int i0; int i1; float w0; float w1; }; + +FgTap fg_axis(float r, int o, int n_in) +{ + FgTap t; + const float s = r * (float)o; + t.i0 = (int)s; + t.i1 = (int)(s + 1.0f); + if (t.i1 >= n_in) { t.i0 = n_in - 1; t.i1 = n_in - 1; } + t.w1 = wg_h2f(wg_f2h(s - (float)t.i0)); + t.w0 = wg_h2f(wg_f2h(((float)t.i0 - s) + 1.0f)); + return t; +} + +float fg_lerp16(float wa, float av, float wb, float bv) +{ + return wg_h2f(wg_f2h(wg_h2f(wg_f2h(wa * av)) + wg_h2f(wg_f2h(wb * bv)))); +} + +uint fg_half(uint4 u, uint j) +{ + const uint d = select(j < 2u, u.x, select(j < 4u, u.y, select(j < 6u, u.z, u.w))); + return (d >> ((j & 1u) * 16u)) & 0xffffu; +} +uint4 fg_pack8(uint r[8]) { return uint4(r[0] | (r[1] << 16), r[2] | (r[3] << 16), r[4] | (r[5] << 16), r[6] | (r[7] << 16)); } + +// 8 single-precision values -> 8 packed float16 (nearest even) by one driver-channel conversion (v_cvt_f16_f32 per +// element, HIP's (_Float16)). The opaque XOR keeps the driver from folding the producing operation into the +// conversion (README "Driver exceptions": a folded product becomes v_fma_mixlo_f16 x, y, 0, which turns -0 into +0). +uint4 fg_f2h8(float m[8]) +{ + v8f t; + const uint z = fg_opq0(); + [unroll] for (uint i = 0; i < 8; ++i) t.v[i] = asfloat(asuint(m[i]) ^ z); + return wg_to_f16_ags(t); +} + +// h(h(wa * a_j) + h(wb * b_j)) for the 8 channels of two packed fragments (fg_lerp16 per channel) +uint4 fg_lerp16x8(float wa, uint4 av, float wb, uint4 bv) +{ + float m[8]; + [unroll] for (uint i = 0; i < 8; ++i) m[i] = wa * wg_h2f(fg_half(av, i)); + const uint4 pa = fg_f2h8(m); + [unroll] for (uint i2 = 0; i2 < 8; ++i2) m[i2] = wb * wg_h2f(fg_half(bv, i2)); + const uint4 pb = fg_f2h8(m); + [unroll] for (uint i3 = 0; i3 < 8; ++i3) m[i3] = wg_h2f(fg_half(pa, i3)) + wg_h2f(fg_half(pb, i3)); + return fg_f2h8(m); +} + +// the 8 channels with every NaN as 0x7E00 +uint4 fg_canon8(uint4 v) +{ + uint r[8]; + [unroll] for (uint i = 0; i < 8; ++i) { const uint h = fg_half(v, i); r[i] = select(fg_is_nan16(h) != 0u, FG_NAN16, h); } + return fg_pack8(r); +} + +// one input fragment: channels c0 .. c0 + 7 of pixel pc (MODE 1: net1's upscale of x plus the skip a, the arithmetic of +// fg_upscale_f16 and fg_add_f16, with the float16 roundings of the 8 channels done together) +uint4 fg_pair_in(int pc, int c0, FgTap tx, FgTap ty) +{ +#if FG_MODE == 0 + return wg_ld128(x, (uint)(pc * C + c0) * 2u); +#else + const uint4 q00 = wg_ld128(x, (uint)((ty.i0 * wi + tx.i0) * C + c0) * 2u); + const uint4 q01 = wg_ld128(x, (uint)((ty.i0 * wi + tx.i1) * C + c0) * 2u); + const uint4 q10 = wg_ld128(x, (uint)((ty.i1 * wi + tx.i0) * C + c0) * 2u); + const uint4 q11 = wg_ld128(x, (uint)((ty.i1 * wi + tx.i1) * C + c0) * 2u); + const uint4 sk = wg_ld128(a, (uint)(pc * C + c0) * 2u); + const uint4 top = fg_lerp16x8(tx.w0, q00, tx.w1, q01); + const uint4 bot = fg_lerp16x8(tx.w0, q10, tx.w1, q11); + const uint4 u = fg_canon8(fg_lerp16x8(ty.w0, top, ty.w1, bot)); + float m[8]; + [unroll] for (uint i = 0; i < 8; ++i) m[i] = wg_h2f(fg_half(u, i)) + wg_h2f(fg_half(sk, i)); + return fg_canon8(fg_f2h8(m)); +#endif +} + +// 8 packed float16 values -> the float32 accumulator fragment (exact) +v8f fg_widen(uint4 hp) +{ + v8f r; + [unroll] for (uint v = 0; v < 8; ++v) r.v[v] = wg_h2f(fg_half(hp, v)); + return r; +} + +// One chunk (tier B): the matrix instruction, then the whole fragment rounded to float16 by the driver channel's +// conversion (v_cvt_f16_f32, nearest even; see fg_mconv.hlsl). hp keeps the packed float16 accumulator. +void fg_chunk_b(uint4 av, uint4 bv, inout v8f c, inout uint4 hp) +{ + const v8f d = wg_wmma_f16(av, bv, c); + hp = wg_to_f16_ags(d); + c = fg_widen(hp); +} + +// the packed float16 accumulator, leaky ReLU if act +uint4 fg_acc_out(uint4 hp, int act) +{ + uint r[8]; + [unroll] for (uint v = 0; v < 8; ++v) { + const uint hb = fg_half(hp, v); + r[v] = select(act == 1, fg_leaky_fast16(hb), hb); + } + return fg_pack8(r); +} + +// the bias of output tile mt as packed float16 +uint4 fg_bias8(uint bp, int mt, int hh) +{ + uint bb[8]; + [unroll] for (uint v = 0; v < 8; ++v) bb[v] = wg_ld16(bp, (uint)(16 * mt + 8 * hh + (int)v) * 2u); + return fg_pack8(bb); +} + +WG_KERNEL(fg_mpair) +{ + WG_SETUP(); + const uint lane = wg_lane_id() & 31u, wave = wg_lane_id() >> 5; + const int n = (int)(lane & 15u), hh = (int)(lane >> 4); + const int p0 = ((int)wg_block_id() * 8 + (int)wave) * 16 * FG_NT; + const int nq = C / 16; + const uint py = (uint)wg_uniform((int)y); + // every lane computes a pixel inside the grid (the last one for lanes past the end); only the store tests the range + int pc[FG_NT]; + FgTap tx[FG_NT], ty[FG_NT]; + [unroll] for (int nt = 0; nt < FG_NT; ++nt) { + pc[nt] = min(p0 + 16 * nt + n, H * W - 1); + const int yy = pc[nt] / W, xx = pc[nt] - (pc[nt] / W) * W; + tx[nt] = fg_axis(asfloat(rx), xx, wi); + ty[nt] = fg_axis(asfloat(ry), yy, hi); + } + v8f acc2[FG_C2T][FG_NT]; + uint4 h2[FG_C2T][FG_NT]; + [unroll] for (int mt = 0; mt < FG_C2T; ++mt) { + const uint4 bh = fg_bias8(b2, mt, hh); + [unroll] for (int nt = 0; nt < FG_NT; ++nt) { h2[mt][nt] = bh; acc2[mt][nt] = fg_widen(bh); } + } +#if FG_LAZY == 0 + v8f acc1[FG_C1T][FG_NT]; + uint4 h1[FG_C1T][FG_NT]; + [unroll] for (int mt1 = 0; mt1 < FG_C1T; ++mt1) { + const uint4 bh = fg_bias8(b1, mt1, hh); + [unroll] for (int nt1 = 0; nt1 < FG_NT; ++nt1) { h1[mt1][nt1] = bh; acc1[mt1][nt1] = fg_widen(bh); } + } + const int nq_loop = nq + (int)fg_opq0(); + for (int cb = 0; cb < nq_loop; ++cb) { + uint4 fb[FG_NT], fa[FG_C1T]; + [unroll] for (int nt2 = 0; nt2 < FG_NT; ++nt2) fb[nt2] = fg_pair_in(pc[nt2], cb * 16 + 8 * hh, tx[nt2], ty[nt2]); + [unroll] for (int mt2 = 0; mt2 < FG_C1T; ++mt2) + fa[mt2] = wg_ld128(wf1, (uint)(((mt2 * nq + cb) * 32 + (int)lane) * 16)); + [unroll] for (int mt3 = 0; mt3 < FG_C1T; ++mt3) + [unroll] for (int nt3 = 0; nt3 < FG_NT; ++nt3) fg_chunk_b(fa[mt3], fb[nt3], acc1[mt3][nt3], h1[mt3][nt3]); + } + uint4 e[FG_C1T][FG_NT]; + [unroll] for (int mt4 = 0; mt4 < FG_C1T; ++mt4) + [unroll] for (int nt4 = 0; nt4 < FG_NT; ++nt4) e[mt4][nt4] = fg_acc_out(h1[mt4][nt4], 1); + [unroll] for (int cb2 = 0; cb2 < FG_C1T; ++cb2) { + uint4 fa2[FG_C2T]; + [unroll] for (int mt5 = 0; mt5 < FG_C2T; ++mt5) + fa2[mt5] = wg_ld128(wf2, (uint)(((mt5 * FG_C1T + cb2) * 32 + (int)lane) * 16)); + [unroll] for (int mt6 = 0; mt6 < FG_C2T; ++mt6) + [unroll] for (int nt6 = 0; nt6 < FG_NT; ++nt6) fg_chunk_b(fa2[mt6], e[cb2][nt6], acc2[mt6][nt6], h2[mt6][nt6]); + } +#else +#ifdef FG_CINT + // the input fragments (upscale + add) once, FG_CINT channel blocks (= C / 16), instead of once per output tile + uint4 sc[FG_CINT][FG_NT]; + [unroll] for (int ci = 0; ci < FG_CINT; ++ci) + [unroll] for (int nti = 0; nti < FG_NT; ++nti) sc[ci][nti] = fg_pair_in(pc[nti], ci * 16 + 8 * hh, tx[nti], ty[nti]); +#endif + const int c1t_loop = FG_C1T + (int)fg_opq0(); + for (int cb2 = 0; cb2 < c1t_loop; ++cb2) { + v8f a1[FG_NT]; + uint4 hl[FG_NT]; + const uint4 bh1 = fg_bias8(b1, cb2, hh); + [unroll] for (int nt7 = 0; nt7 < FG_NT; ++nt7) { hl[nt7] = bh1; a1[nt7] = fg_widen(bh1); } +#ifdef FG_CINT + [unroll] for (int cb = 0; cb < FG_CINT; ++cb) { + const uint4 fa = wg_ld128(wf1, (uint)(((cb2 * FG_CINT + cb) * 32 + (int)lane) * 16)); + [unroll] for (int nt9 = 0; nt9 < FG_NT; ++nt9) fg_chunk_b(fa, sc[cb][nt9], a1[nt9], hl[nt9]); + } +#else + const int nq_loop = nq + (int)fg_opq0(); + for (int cb = 0; cb < nq_loop; ++cb) { + uint4 fb[FG_NT]; + [unroll] for (int nt8 = 0; nt8 < FG_NT; ++nt8) fb[nt8] = fg_pair_in(pc[nt8], cb * 16 + 8 * hh, tx[nt8], ty[nt8]); + const uint4 fa = wg_ld128(wf1, (uint)(((cb2 * nq + cb) * 32 + (int)lane) * 16)); + [unroll] for (int nt9 = 0; nt9 < FG_NT; ++nt9) fg_chunk_b(fa, fb[nt9], a1[nt9], hl[nt9]); + } +#endif + uint4 eb[FG_NT]; + [unroll] for (int nt10 = 0; nt10 < FG_NT; ++nt10) eb[nt10] = fg_acc_out(hl[nt10], 1); + uint4 fa2[FG_C2T]; + [unroll] for (int mt11 = 0; mt11 < FG_C2T; ++mt11) + fa2[mt11] = wg_ld128(wf2, (uint)(((mt11 * FG_C1T + cb2) * 32 + (int)lane) * 16)); + [unroll] for (int mt12 = 0; mt12 < FG_C2T; ++mt12) + [unroll] for (int nt12 = 0; nt12 < FG_NT; ++nt12) fg_chunk_b(fa2[mt12], eb[nt12], acc2[mt12][nt12], h2[mt12][nt12]); + } +#endif + const int C2 = 16 * FG_C2T; + [unroll] for (int mt13 = 0; mt13 < FG_C2T; ++mt13) + [unroll] for (int nt13 = 0; nt13 < FG_NT; ++nt13) { + const uint4 r = fg_acc_out(h2[mt13][nt13], act2); + if (p0 + 16 * nt13 + n < H * W) wg_st128(py, (uint)(pc[nt13] * C2 + 16 * mt13 + 8 * hh) * 2u, r); + } +} diff --git a/clean/fg/FORMATS.md b/clean/fg/FORMATS.md index 19ea0f0b..e5fc0c59 100644 --- a/clean/fg/FORMATS.md +++ b/clean/fg/FORMATS.md @@ -136,9 +136,22 @@ delivered by the spec side; the code never guesses it (it raises, or takes the c `pool` 1, the 2 x 2 max-pool are the exact helpers of `fg_exact16.h`, in the epilogue. 1 / 2 / 4 output-channel tiles of 16 per wave; a workgroup is 8 waves over 16 x 16 pixels. - `fg_upscale_hwc_f16`: `fg_upscale_f16`'s arithmetic on NHWC tensors. The adds are `fg_add_f16`. -- net1 is 27 launches: five encoder convolutions with the pool fused, the bottleneck's two, and per decoder level an - upscale, an add and two convolutions. HIP and D3D12 are byte-identical; against the CPU reference the output is a - report (net1's output is not gated; the gate is the generated frame against the oracle). +- `fg_mpair_{b,d4,d3,d2,d1,d0}(x, a, wf1, b1, wf2, b2, y, C, H, W, hi, wi, rx, ry, act2)`: two chained 1 x 1 + convolutions (chunks ascending), the first with leaky ReLU, kept in registers: the result fragment of output tile mt + (lane = pixel, 8 consecutive channels) is exactly the second convolution's input fragment of channel block mt. `_b`: + the input is the buffer x (the bottleneck, net1_06 + net1_07). `_d`: the input is net1's upscale of the coarse + x [hi][wi][C] plus the skip a [H][W][C], computed per input fragment with the exact upscale and add arithmetic (ratio + bits rx / ry from the host); act2 0 for net1_17 (no activation). Pixels row-major, 16 (or 32) per wave; lanes past the + end compute the last pixel and do not store. +- Leaky ReLU on the fast path: `fg_leaky_fast16` (`kernels/fg_fast16.h`): one single-precision product with the slope, + one float16 rounding, then the max of `fg_leaky16`; the same bits as `fg_leaky16` for all 65,536 inputs. +- Paths (`runner/fg_net1_mma.py --paths`): `fused`, 11 launches (five encoder convolutions with the pool fused, the + bottleneck pair, five decoder pairs); `tierb`, 27 launches (every convolution, upscale and add on its own); `exact`, + #191's 32 launches. fused and tierb compute the same arithmetic and write byte-identical common buffers. HIP and D3D12 + are byte-identical on every path; against the CPU reference the tier-B output is a report (net1's output is not + gated; the gate is the generated frame against the oracle), the exact path is bit-exact. +- D3D12 rounds float16 with the driver channel's conversion (`wg_to_f16_ags`, the bits of HIP's `(_Float16)`), a whole + fragment at a time (clean/dx12/README.md "Driver exceptions"). ## Configuration (`reference/config.py`) diff --git a/clean/fg/README.md b/clean/fg/README.md index 975a7391..88226445 100644 --- a/clean/fg/README.md +++ b/clean/fg/README.md @@ -26,9 +26,11 @@ front end or the launcher yet. Status, open items and formats: [FORMATS.md](FORM | `tests/test_fg_wmma_probe.py` | the probe's CPU parts: the float16-midpoint test against brute force, the RN32 reference against exact fractions, the case classes | | `tests/test_fg_net1_gpu_plan.py` | the chain as planned on the CPU: every step output's shape against the reference's buffers, launch arguments, natural weight order, chain lines | | `kernels/fg_net1_mma.hip`, `clean/dx12/kernels/fg_mconv.hlsl`, `fg_upscale_hwc.hlsl` | net1's fast path, tier B (code object `fg_net1_mma.co`): `fg_mconv1/2/4` (one `v_wmma_f32_16x16x16_f16` per spec chunk in the layer's chunk order, the float16 accumulator from the bias as C, the result rounded to float16 after every chunk; leaky ReLU and the fused 2 x 2 pool in the epilogue; NHWC float16) and `fg_upscale_hwc_f16`. Not bit-exact to the CPU reference (the matrix unit's chunk sum is not exact); HIP and D3D12 byte-identical | -| `runner/fg_net1_mma.py` | net1 on the fast path in 27 launches, HIP and D3D12: every buffer byte for byte between the back ends (sentinels, slack, a half-grid negative control per kernel; synthetic weights, odd sizes, special values, `--model` execute-only); against the CPU reference as a report (largest step distance, values over 1 and over 4 steps, per buffer and per output value); `--timing` at 1080p- and 1440p-sized inputs (information only, after a launch-length probe) | -| `records/net1-tierb-2026-11-14.json` | the fast path's record: the gate results, the report against the CPU reference (synthetic and converted weights, counts only) and the timing | -| `tests/test_fg_net1_mma_plan.py` | the fast path as planned on the CPU: every weight fragment element against the weights, chunk order and tap; buffers and launches of the fused plan | +| `kernels/fg_net1_mma.hip` `fg_mpair_*`, `clean/dx12/kernels/fg_mpair.hlsl` | two chained 1 x 1 convolutions in registers (a result fragment is the next convolution's input fragment): the bottleneck (net1_06 + net1_07) and each decoder level (net1's upscale and skip add computed per input fragment, then net1_08/09 ... net1_16/17); u / s / e are never stored | +| `kernels/fg_fast16.h`, `clean/dx12/kernels/fg_leaky_fast.hlsl` | the fast path's leaky ReLU (one single-precision product, one float16 rounding; `fg_leaky16`'s bits, checked on all 65,536 inputs) and skip add | +| `runner/fg_net1_mma.py` | net1 on three selectable paths, HIP and D3D12: `fused` (11 launches), `tierb` (27 launches) and `exact` (#191's kernels, bit-exact: the validation mode and the fallback). Gates: every buffer byte for byte between the back ends (sentinels, slack, a half-grid negative control per kernel, incl. a 768 x 768 case where every kernel has one; synthetic weights, odd sizes, special values, `--model` execute-only), fused == tierb, the leaky check. Report against the CPU reference: values over 1 and over 4 steps, largest step distance, largest absolute difference and that over the largest reference magnitude, per buffer and per output value. `--timing` at 1080p- and 1440p-sized inputs (information only, after a launch-length probe) | +| `records/net1-tierb-2026-11-14.json`, `records/net1-fused-2026-11-14.json` | the fast path's records: gate results, the report against the CPU reference (synthetic and converted weights, counts only), timing, and (fused) the D3D12 profile per launch before and after the driver conversion | +| `tests/test_fg_net1_mma_plan.py` | the fast path as planned on the CPU: every weight fragment element against the weights, chunk order and tap; buffers and launches of the 27- and 11-launch plans; the fast leaky ReLU's formula on all 65,536 inputs | | `../converter` (preset FG) | the converter reads a version-1 map with `"preset": "FG"`: one block source per weight blob; see the converter's README, "Preset FG" | | `../../data/fg.v1.map.json` | the spec side's converter map, revision v1.1 (weights in natural order); `tests/test_fg_map.py` pins its digest and checks it against `layout.py` | | `reference/natural.py` | the natural weight order from the map itself: its offsets as gather indices (stored blob weights to natural), natural to canonical `[out, k, k, in]` | diff --git a/clean/fg/kernels/fg_fast16.h b/clean/fg/kernels/fg_fast16.h new file mode 100644 index 00000000..d64d5296 --- /dev/null +++ b/clean/fg/kernels/fg_fast16.h @@ -0,0 +1,25 @@ +// SPDX-License-Identifier: MIT +// Frame generation (issue #96): cheap float16 helpers of the fast path with the same bits as the exact ones of +// fg_exact16.h, shared by HIP (fg_net1_mma.hip) and the D3D12 ports. The including file defines FG_FN, FG_F2H(float) -> +// float16 bits (nearest even), FG_H2F(bits) -> float (exact), FG_SEL(c, a, b), and includes fg_exact16.h first. +#ifndef FG_FAST16_H +#define FG_FAST16_H + +// net1's leaky ReLU, y = max(x, h(s * x)) with the delivered slope (0x211E): fg_leaky16's result for every input. The +// product of two float16 values is exact in single precision (22 significant bits; never a single-precision subnormal), +// so one float16 rounding of it is h(s * x). The only possible difference to the integer path is the sign of a zero +// product, and the max (by fg_key16, which treats -0 and +0 as equal, keeping x) discards it. NaN stays as it is. +// Checked on all 65,536 inputs (runner/fg_net1_mma.py, leaky check). +FG_FN uint fg_leaky_fast16(uint x) { + const uint t = FG_F2H(FG_H2F(FG_LEAKY_SLOPE16) * FG_H2F(x)); + const uint y = FG_SEL(fg_key16(t) > fg_key16(x), t, x); + return FG_SEL(fg_is_nan16(x) != 0u, x, y); +} + +// net1's skip add of an upscaled value u and a skip value a, as fg_add_f16 writes it: h(u + a), NaN as 0x7E00 +FG_FN uint fg_add_fast16(uint u, uint a) { + const uint s = FG_F2H(FG_H2F(u) + FG_H2F(a)); + return FG_SEL(fg_is_nan16(s) != 0u, FG_NAN16, s); +} + +#endif diff --git a/clean/fg/kernels/fg_net1_mma.hip b/clean/fg/kernels/fg_net1_mma.hip index 20b55090..8d776fd8 100644 --- a/clean/fg/kernels/fg_net1_mma.hip +++ b/clean/fg/kernels/fg_net1_mma.hip @@ -14,14 +14,24 @@ // accumulator (widened exactly), its float32 result rounded to float16 after every chunk (v_cvt_f16_f32, nearest // even), so the accumulator stays float16 as in the spec. An exact-zero sum gives +0, the reference's convention // (the probe found a -0 only where the matrix unit dropped a tiny term). -// Then leaky ReLU (act 1; fg_leaky16, exact) and the output y; with pool 1 also net1's 2 x 2 max-pool of the +// Then leaky ReLU (act 1; fg_leaky_fast16, fg_leaky16's bits) and the output y; with pool 1 also net1's 2 x 2 max-pool of the // activated output into p (floor sizes; fg_pool_step16 from tap (0, 0), (0, 1), (1, 0), (1, 1)). // Weights wf: A fragments in chunk order, [cout / 16][chunks][32 lanes][8] float16: lane l, row o = 16 mt + l % 16, // element j = input channel 16 cb + 8 (l / 16) + j of the chunk's tap (built by the runner, fg_net1_mma.py). // Work: a workgroup is 8 waves over a 16 x 16 pixel tile; wave w takes rows 2w and 2w + 1 (two 16-pixel N tiles) and // MT output-channel tiles (16 MT channels). Grid: tiles_x * tiles_y * (cout / (16 MT)) workgroups of 256 lanes; // block id = (mg * tiles_y + ty) * tiles_x + tx. +// fg_mpair(x, a, wf1, b1, wf2, b2, y, C, H, W, hi, wi, rx, ry, act2): two chained 1 x 1 +// convolutions (chunks in ascending order, tier B per chunk), the first with leaky ReLU, in registers: the result +// fragment of output tile mt (lane = pixel, 8 consecutive channels) is exactly the second convolution's input fragment +// of channel block mt, so nothing goes through memory. MODE 0 (the bottleneck, net1_06 + net1_07): the input is the +// NHWC buffer x [H][W][C]. MODE 1 (a decoder level, net1_08/09 ... net1_16/17): the input is net1's upscale of the +// coarse x [hi][wi][C] plus the skip a [H][W][C], computed per input fragment with the exact upscale and add +// arithmetic (u and s are never stored). C1T / C2T: output tiles of 16 channels of the first / second convolution; +// NT: 16-pixel groups per wave; LAZY 1 computes the first convolution one output tile at a time (for wide layers). +// Pixels in row-major order: wave w of workgroup g takes pixels (8 g + w) 16 NT ... + 16 NT - 1. // fg_upscale_hwc_f16: net1's bilinear upscale (fg_upscale_f16 of fg_net1.hip, the same arithmetic) on NHWC tensors. +// fg_leaky_fast_f16: fg_leaky_fast16 on n float16 values (the exhaustive check of the fast leaky ReLU). #include "wg_platform.h" #include "wg_mem.h" @@ -38,6 +48,10 @@ typedef uint v4u32 __attribute__((ext_vector_type(4))); WG_FN uint fg_f2h(float f) { return (uint)__builtin_bit_cast(u16, (_Float16)f); } // round to nearest even WG_FN float fg_h2f(uint h) { return (float)__builtin_bit_cast(_Float16, (u16)h); } // exact +#define FG_F2H(f) fg_f2h(f) +#define FG_H2F(h) fg_h2f(h) +#define FG_SEL(c, a, b) ((c) ? (a) : (b)) +#include "fg_fast16.h" WG_FN uint fg_xor1(uint v) { // v of lane (lane ^ 1) return (uint)__builtin_amdgcn_ds_bpermute((int)(((wg_lane_id() & 31u) ^ 1u) << 2), (int)v); } @@ -103,7 +117,7 @@ WG_FN void fg_mconv(const u16* __restrict__ x, const u16* __restrict__ wf, const for (int v = 0; v < 8; ++v) { const float t = a32[mt][nt][v]; uint hb = fg_f2h(t); - if (act == 1) hb = fg_leaky16(hb); + if (act == 1) hb = fg_leaky_fast16(hb); r[nt][v] = hb; } for (int nt = 0; nt < 2; ++nt) { @@ -173,3 +187,152 @@ WG_KERNEL_N(fg_upscale_hwc_f16, 256)(const u16* __restrict__ x, u16* __restrict_ if (fg_is_nan16(out) != 0u) out = FG_NAN16; y[idx] = (u16)out; } + +// ---- two chained 1 x 1 convolutions in registers (bottleneck, decoder levels) --------------------------------------- +WG_FN uint fg_half(v4u32 u, int j) { return (u[j >> 1] >> ((j & 1) * 16)) & 0xffffu; } +WG_FN v4u32 fg_pack8(const uint* r) { + return (v4u32){r[0] | (r[1] << 16), r[2] | (r[3] << 16), r[4] | (r[5] << 16), r[6] | (r[7] << 16)}; +} + +// one input fragment of fg_mpair: channels c0 .. c0 + 7 of pixel pc (MODE 0: of x; MODE 1: upscale of x plus a) +template +WG_FN v4u32 fg_pair_in(const u16* x, const u16* a, int C, int pc, int c0, FgTap tx, FgTap ty, int wi) { + if (MODE == 0) return fg_ld128(x, (uint)(pc * C + c0)); + const v4u32 q00 = fg_ld128(x, (uint)((ty.i0 * wi + tx.i0) * C + c0)); + const v4u32 q01 = fg_ld128(x, (uint)((ty.i0 * wi + tx.i1) * C + c0)); + const v4u32 q10 = fg_ld128(x, (uint)((ty.i1 * wi + tx.i0) * C + c0)); + const v4u32 q11 = fg_ld128(x, (uint)((ty.i1 * wi + tx.i1) * C + c0)); + const v4u32 sk = fg_ld128(a, (uint)(pc * C + c0)); + uint r[8]; + for (int j = 0; j < 8; ++j) { + const float top = fg_lerp16(tx.w0, fg_h2f(fg_half(q00, j)), tx.w1, fg_h2f(fg_half(q01, j))); + const float bot = fg_lerp16(tx.w0, fg_h2f(fg_half(q10, j)), tx.w1, fg_h2f(fg_half(q11, j))); + uint u = fg_f2h(fg_lerp16(ty.w0, top, ty.w1, bot)); + if (fg_is_nan16(u) != 0u) u = FG_NAN16; + r[j] = fg_add_fast16(u, fg_half(sk, j)); + } + return fg_pack8(r); +} + +// one chunk on one accumulator: tier B (float32 accumulate, float16 rounding) +WG_FN v8f fg_chunk_b(v8h a, v8h b, v8f c) { + v8f d = __builtin_amdgcn_wmma_f32_16x16x16_f16_w32_gfx12(a, b, c); + for (int v = 0; v < 8; ++v) { const float t = d[v]; d[v] = fg_h2f(fg_f2h(t)); } + return d; +} + +// the 8 channels of an accumulator as packed float16, leaky ReLU if act +WG_FN v4u32 fg_acc_out(v8f acc, int act) { + uint r[8]; + for (int v = 0; v < 8; ++v) { + const float t = acc[v]; + const uint hb = fg_f2h(t); + r[v] = act == 1 ? fg_leaky_fast16(hb) : hb; + } + return fg_pack8(r); +} + +template +WG_FN void fg_mpair(const u16* __restrict__ x, const u16* __restrict__ a, const u16* __restrict__ wf1, + const u16* __restrict__ b1, const u16* __restrict__ wf2, const u16* __restrict__ b2, + u16* __restrict__ y, int C, int H, int W, int hi, int wi, uint rx, uint ry, int act2) { + const uint lane = wg_lane_id() & 31u, wave = wg_lane_id() >> 5; + const int n = (int)(lane & 15u), hh = (int)(lane >> 4); + const int p0 = ((int)wg_block_id() * 8 + (int)wave) * 16 * NT; + const int nq = C / 16; + int pc[NT]; + bool valid[NT]; + FgTap tx[NT], ty[NT]; + for (int nt = 0; nt < NT; ++nt) { + const int p = p0 + 16 * nt + n; + valid[nt] = p < H * W; + pc[nt] = p < H * W - 1 ? p : H * W - 1; // lanes past the end compute the last pixel; only the store tests + const int yy = pc[nt] / W, xx = pc[nt] - (pc[nt] / W) * W; + if (MODE == 1) { + tx[nt] = fg_axis(__builtin_bit_cast(float, rx), xx, wi); + ty[nt] = fg_axis(__builtin_bit_cast(float, ry), yy, hi); + } else { + tx[nt] = ty[nt] = FgTap{0, 0, 0.0f, 0.0f}; + } + } + v8f acc2[C2T][NT]; + for (int mt = 0; mt < C2T; ++mt) + for (int v = 0; v < 8; ++v) { + const float bv = fg_h2f(b2[16 * mt + 8 * hh + v]); + for (int nt = 0; nt < NT; ++nt) acc2[mt][nt][v] = bv; + } + if (LAZY == 0) { // a template constant: the other branch is removed + v8f acc1[C1T][NT]; + for (int mt = 0; mt < C1T; ++mt) + for (int v = 0; v < 8; ++v) { + const float bv = fg_h2f(b1[16 * mt + 8 * hh + v]); + for (int nt = 0; nt < NT; ++nt) acc1[mt][nt][v] = bv; + } + for (int cb = 0; cb < nq; ++cb) { + v8h fb[NT], fa[C1T]; + for (int nt = 0; nt < NT; ++nt) + fb[nt] = fg_as_v8h(fg_pair_in(x, a, C, pc[nt], cb * 16 + 8 * hh, tx[nt], ty[nt], wi)); + for (int mt = 0; mt < C1T; ++mt) + fa[mt] = fg_as_v8h(fg_ld128(wf1, (uint)(((mt * nq + cb) * 32 + (int)lane) * 8))); + for (int mt = 0; mt < C1T; ++mt) + for (int nt = 0; nt < NT; ++nt) acc1[mt][nt] = fg_chunk_b(fa[mt], fb[nt], acc1[mt][nt]); + } + v4u32 e[C1T][NT]; + for (int mt = 0; mt < C1T; ++mt) + for (int nt = 0; nt < NT; ++nt) e[mt][nt] = fg_acc_out(acc1[mt][nt], 1); + for (int cb2 = 0; cb2 < C1T; ++cb2) { + v8h fa2[C2T]; + for (int mt = 0; mt < C2T; ++mt) + fa2[mt] = fg_as_v8h(fg_ld128(wf2, (uint)(((mt * C1T + cb2) * 32 + (int)lane) * 8))); + for (int mt = 0; mt < C2T; ++mt) + for (int nt = 0; nt < NT; ++nt) acc2[mt][nt] = fg_chunk_b(fa2[mt], fg_as_v8h(e[cb2][nt]), acc2[mt][nt]); + } + } else { +#pragma unroll 1 + for (int cb2 = 0; cb2 < C1T; ++cb2) { // the first convolution one output tile (= input block) at a time + v8f a1[NT]; + for (int v = 0; v < 8; ++v) { + const float bv = fg_h2f(b1[16 * cb2 + 8 * hh + v]); + for (int nt = 0; nt < NT; ++nt) a1[nt][v] = bv; + } +#pragma unroll 1 + for (int cb = 0; cb < nq; ++cb) { + v8h fb[NT]; + for (int nt = 0; nt < NT; ++nt) + fb[nt] = fg_as_v8h(fg_pair_in(x, a, C, pc[nt], cb * 16 + 8 * hh, tx[nt], ty[nt], wi)); + const v8h fa = fg_as_v8h(fg_ld128(wf1, (uint)(((cb2 * nq + cb) * 32 + (int)lane) * 8))); + for (int nt = 0; nt < NT; ++nt) a1[nt] = fg_chunk_b(fa, fb[nt], a1[nt]); + } + v4u32 eb[NT]; + for (int nt = 0; nt < NT; ++nt) eb[nt] = fg_acc_out(a1[nt], 1); + v8h fa2[C2T]; + for (int mt = 0; mt < C2T; ++mt) + fa2[mt] = fg_as_v8h(fg_ld128(wf2, (uint)(((mt * C1T + cb2) * 32 + (int)lane) * 8))); + for (int mt = 0; mt < C2T; ++mt) + for (int nt = 0; nt < NT; ++nt) acc2[mt][nt] = fg_chunk_b(fa2[mt], fg_as_v8h(eb[nt]), acc2[mt][nt]); + } + } + const int C2 = 16 * C2T; + for (int mt = 0; mt < C2T; ++mt) + for (int nt = 0; nt < NT; ++nt) { + const v4u32 r = fg_acc_out(acc2[mt][nt], act2); + if (valid[nt]) *(v4u32*)(y + (size_t)pc[nt] * C2 + 16 * mt + 8 * hh) = r; + } +} + +#define FG_MPAIR_ARGS const u16* __restrict__ x, const u16* __restrict__ a, const u16* __restrict__ wf1, \ + const u16* __restrict__ b1, const u16* __restrict__ wf2, const u16* __restrict__ b2, u16* __restrict__ y, int C, \ + int H, int W, int hi, int wi, uint rx, uint ry, int act2 +#define FG_MPAIR_CALL x, a, wf1, b1, wf2, b2, y, C, H, W, hi, wi, rx, ry, act2 +WG_KERNEL_N(fg_mpair_b, 256)(FG_MPAIR_ARGS) { fg_mpair<0, 32, 16, 1, 1>(FG_MPAIR_CALL); } +WG_KERNEL_N(fg_mpair_d4, 256)(FG_MPAIR_ARGS) { fg_mpair<1, 16, 8, 1, 1>(FG_MPAIR_CALL); } +WG_KERNEL_N(fg_mpair_d3, 256)(FG_MPAIR_ARGS) { fg_mpair<1, 8, 8, 1, 0>(FG_MPAIR_CALL); } +WG_KERNEL_N(fg_mpair_d2, 256)(FG_MPAIR_ARGS) { fg_mpair<1, 8, 4, 1, 0>(FG_MPAIR_CALL); } +WG_KERNEL_N(fg_mpair_d1, 256)(FG_MPAIR_ARGS) { fg_mpair<1, 4, 2, 2, 0>(FG_MPAIR_CALL); } +WG_KERNEL_N(fg_mpair_d0, 256)(FG_MPAIR_ARGS) { fg_mpair<1, 2, 1, 2, 0>(FG_MPAIR_CALL); } + +WG_KERNEL_N(fg_leaky_fast_f16, 256)(const u16* __restrict__ x, u16* __restrict__ y, int n) { + const int idx = (int)(wg_block_id() * 256u + wg_lane_id()); + if (idx >= n) return; + y[idx] = (u16)fg_leaky_fast16(x[idx]); +} diff --git a/clean/fg/records/net1-fused-2026-11-14.json b/clean/fg/records/net1-fused-2026-11-14.json new file mode 100644 index 00000000..df892895 --- /dev/null +++ b/clean/fg/records/net1-fused-2026-11-14.json @@ -0,0 +1,5926 @@ +{ + "cases": [ + { + "case": "synthetic_64", + "fused_equals_tierb": { + "a0": true, + "a1": true, + "a2": true, + "a3": true, + "a4": true, + "d1": true, + "d2": true, + "d3": true, + "d4": true, + "d5": true, + "out": true, + "p1": true, + "p2": true, + "p3": true, + "p4": true, + "p5": true + }, + "hip_equals_d3d12": true, + "input_pixels": [ + 64, + 64 + ], + "launches": 11, + "negative_controls": { + "fg_mconv2": { + "caught": true, + "differ": 40873, + "step": 0 + }, + "fg_mconv4": { + "caught": true, + "differ": 1274, + "step": 4 + }, + "fg_mpair_d0": { + "caught": true, + "differ": 16346, + "step": 10 + } + }, + "ok": true, + "path": "fused", + "vs_cpu_buffers": { + "a0": { + "max_abs_diff": 0.0009765625, + "max_abs_ref": 1.736328125, + "nonfinite_mismatch": 0, + "over_1_step": 11, + "over_4_steps": 2, + "rel": 0.0005624296962879641, + "steps_max": 16, + "values": 32768 + }, + "a1": { + "max_abs_diff": 0.00048828125, + "max_abs_ref": 1.453125, + "nonfinite_mismatch": 0, + "over_1_step": 36, + "over_4_steps": 12, + "rel": 0.0003360215053763441, + "steps_max": 20, + "values": 16384 + }, + "a2": { + "max_abs_diff": 0.00048828125, + "max_abs_ref": 1.2412109375, + "nonfinite_mismatch": 0, + "over_1_step": 227, + "over_4_steps": 57, + "rel": 0.0003933910306845004, + "steps_max": 60, + "values": 8192 + }, + "a3": { + "max_abs_diff": 0.0009765625, + "max_abs_ref": 0.8583984375, + "nonfinite_mismatch": 0, + "over_1_step": 351, + "over_4_steps": 94, + "rel": 0.0011376564277588168, + "steps_max": 512, + "values": 2048 + }, + "a4": { + "max_abs_diff": 0.00048828125, + "max_abs_ref": 0.49169921875, + "nonfinite_mismatch": 0, + "over_1_step": 421, + "over_4_steps": 133, + "rel": 0.0009930486593843098, + "steps_max": 982, + "values": 1024 + }, + "d1": { + "max_abs_diff": 0.00048828125, + "max_abs_ref": 0.4560546875, + "nonfinite_mismatch": 0, + "over_1_step": 2873, + "over_4_steps": 891, + "rel": 0.0010706638115631692, + "steps_max": 1117, + "values": 8192 + }, + "d2": { + "max_abs_diff": 0.0006103515625, + "max_abs_ref": 0.465087890625, + "nonfinite_mismatch": 0, + "over_1_step": 1707, + "over_4_steps": 471, + "rel": 0.0013123359580052493, + "steps_max": 1796, + "values": 4096 + }, + "d3": { + "max_abs_diff": 0.000732421875, + "max_abs_ref": 0.37060546875, + "nonfinite_mismatch": 0, + "over_1_step": 1150, + "over_4_steps": 467, + "rel": 0.001976284584980237, + "steps_max": 1218, + "values": 2048 + }, + "d4": { + "max_abs_diff": 0.0006103515625, + "max_abs_ref": 0.373046875, + "nonfinite_mismatch": 0, + "over_1_step": 297, + "over_4_steps": 137, + "rel": 0.0016361256544502618, + "steps_max": 761, + "values": 512 + }, + "d5": { + "max_abs_diff": 0.00048828125, + "max_abs_ref": 0.369384765625, + "nonfinite_mismatch": 0, + "over_1_step": 153, + "over_4_steps": 56, + "rel": 0.0013218770654329147, + "steps_max": 215, + "values": 256 + }, + "out": { + "max_abs_diff": 0.00048828125, + "max_abs_ref": 0.75146484375, + "nonfinite_mismatch": 0, + "over_1_step": 3727, + "over_4_steps": 1283, + "rel": 0.000649772579597141, + "steps_max": 4201, + "values": 16384 + }, + "p1": { + "max_abs_diff": 0.0009765625, + "max_abs_ref": 1.736328125, + "nonfinite_mismatch": 0, + "over_1_step": 3, + "over_4_steps": 1, + "rel": 0.0005624296962879641, + "steps_max": 16, + "values": 8192 + }, + "p2": { + "max_abs_diff": 0.00048828125, + "max_abs_ref": 1.453125, + "nonfinite_mismatch": 0, + "over_1_step": 10, + "over_4_steps": 3, + "rel": 0.0003360215053763441, + "steps_max": 16, + "values": 4096 + }, + "p3": { + "max_abs_diff": 0.00048828125, + "max_abs_ref": 1.2412109375, + "nonfinite_mismatch": 0, + "over_1_step": 61, + "over_4_steps": 13, + "rel": 0.0003933910306845004, + "steps_max": 20, + "values": 2048 + }, + "p4": { + "max_abs_diff": 0.0009765625, + "max_abs_ref": 0.8583984375, + "nonfinite_mismatch": 0, + "over_1_step": 78, + "over_4_steps": 21, + "rel": 0.0011376564277588168, + "steps_max": 53, + "values": 512 + }, + "p5": { + "max_abs_diff": 0.00048828125, + "max_abs_ref": 0.49169921875, + "nonfinite_mismatch": 0, + "over_1_step": 94, + "over_4_steps": 26, + "rel": 0.0009930486593843098, + "steps_max": 41, + "values": 256 + } + }, + "vs_cpu_output": { + "max_abs_diff": 0.00048828125, + "max_abs_ref": 0.75146484375, + "nonfinite_mismatch": 0, + "over_1_step": 3727, + "over_4_steps": 1283, + "rel": 0.000649772579597141, + "steps_max": 4201, + "values": 16384 + }, + "vs_cpu_output_per_value": [ + { + "max_abs_diff": 0.00048828125, + "max_abs_ref": 0.5205078125, + "nonfinite_mismatch": 0, + "over_1_step": 1425, + "over_4_steps": 502, + "rel": 0.0009380863039399625, + "steps_max": 630, + "values": 4096 + }, + { + "max_abs_diff": 0.00048828125, + "max_abs_ref": 0.75146484375, + "nonfinite_mismatch": 0, + "over_1_step": 530, + "over_4_steps": 188, + "rel": 0.000649772579597141, + "steps_max": 230, + "values": 4096 + }, + { + "max_abs_diff": 0.00048828125, + "max_abs_ref": 0.5107421875, + "nonfinite_mismatch": 0, + "over_1_step": 954, + "over_4_steps": 317, + "rel": 0.0009560229445506692, + "steps_max": 4201, + "values": 4096 + }, + { + "max_abs_diff": 0.00048828125, + "max_abs_ref": 0.72265625, + "nonfinite_mismatch": 0, + "over_1_step": 818, + "over_4_steps": 276, + "rel": 0.0006756756756756757, + "steps_max": 1889, + "values": 4096 + } + ] + }, + { + "case": "synthetic_64", + "fused_equals_tierb": null, + "hip_equals_d3d12": true, + "input_pixels": [ + 64, + 64 + ], + "launches": 27, + "negative_controls": { + "fg_add_f16": { + "caught": true, + "differ": 1024, + "step": 8 + }, + "fg_mconv1": { + "caught": true, + "differ": 16346, + "step": 26 + }, + "fg_mconv2": { + "caught": true, + "differ": 40873, + "step": 0 + }, + "fg_mconv4": { + "caught": true, + "differ": 1274, + "step": 4 + }, + "fg_upscale_hwc_f16": { + "caught": true, + "differ": 1018, + "step": 7 + } + }, + "ok": true, + "path": "tierb", + "vs_cpu_buffers": { + "a0": { + "max_abs_diff": 0.0009765625, + "max_abs_ref": 1.736328125, + "nonfinite_mismatch": 0, + "over_1_step": 11, + "over_4_steps": 2, + "rel": 0.0005624296962879641, + "steps_max": 16, + "values": 32768 + }, + "a1": { + "max_abs_diff": 0.00048828125, + "max_abs_ref": 1.453125, + "nonfinite_mismatch": 0, + "over_1_step": 36, + "over_4_steps": 12, + "rel": 0.0003360215053763441, + "steps_max": 20, + "values": 16384 + }, + "a2": { + "max_abs_diff": 0.00048828125, + "max_abs_ref": 1.2412109375, + "nonfinite_mismatch": 0, + "over_1_step": 227, + "over_4_steps": 57, + "rel": 0.0003933910306845004, + "steps_max": 60, + "values": 8192 + }, + "a3": { + "max_abs_diff": 0.0009765625, + "max_abs_ref": 0.8583984375, + "nonfinite_mismatch": 0, + "over_1_step": 351, + "over_4_steps": 94, + "rel": 0.0011376564277588168, + "steps_max": 512, + "values": 2048 + }, + "a4": { + "max_abs_diff": 0.00048828125, + "max_abs_ref": 0.49169921875, + "nonfinite_mismatch": 0, + "over_1_step": 421, + "over_4_steps": 133, + "rel": 0.0009930486593843098, + "steps_max": 982, + "values": 1024 + }, + "b5": { + "max_abs_diff": 0.000732421875, + "max_abs_ref": 0.435302734375, + "nonfinite_mismatch": 0, + "over_1_step": 265, + "over_4_steps": 84, + "rel": 0.0016825574873808188, + "steps_max": 161, + "values": 512 + }, + "d1": { + "max_abs_diff": 0.00048828125, + "max_abs_ref": 0.4560546875, + "nonfinite_mismatch": 0, + "over_1_step": 2873, + "over_4_steps": 891, + "rel": 0.0010706638115631692, + "steps_max": 1117, + "values": 8192 + }, + "d2": { + "max_abs_diff": 0.0006103515625, + "max_abs_ref": 0.465087890625, + "nonfinite_mismatch": 0, + "over_1_step": 1707, + "over_4_steps": 471, + "rel": 0.0013123359580052493, + "steps_max": 1796, + "values": 4096 + }, + "d3": { + "max_abs_diff": 0.000732421875, + "max_abs_ref": 0.37060546875, + "nonfinite_mismatch": 0, + "over_1_step": 1150, + "over_4_steps": 467, + "rel": 0.001976284584980237, + "steps_max": 1218, + "values": 2048 + }, + "d4": { + "max_abs_diff": 0.0006103515625, + "max_abs_ref": 0.373046875, + "nonfinite_mismatch": 0, + "over_1_step": 297, + "over_4_steps": 137, + "rel": 0.0016361256544502618, + "steps_max": 761, + "values": 512 + }, + "d5": { + "max_abs_diff": 0.00048828125, + "max_abs_ref": 0.369384765625, + "nonfinite_mismatch": 0, + "over_1_step": 153, + "over_4_steps": 56, + "rel": 0.0013218770654329147, + "steps_max": 215, + "values": 256 + }, + "e0": { + "max_abs_diff": 0.001953125, + "max_abs_ref": 1.201171875, + "nonfinite_mismatch": 0, + "over_1_step": 4215, + "over_4_steps": 1119, + "rel": 0.0016260162601626016, + "steps_max": 1036, + "values": 32768 + }, + "e1": { + "max_abs_diff": 0.0009765625, + "max_abs_ref": 1.015625, + "nonfinite_mismatch": 0, + "over_1_step": 3589, + "over_4_steps": 1118, + "rel": 0.0009615384615384616, + "steps_max": 2702, + "values": 16384 + }, + "e2": { + "max_abs_diff": 0.0009765625, + "max_abs_ref": 0.796875, + "nonfinite_mismatch": 0, + "over_1_step": 2359, + "over_4_steps": 681, + "rel": 0.0012254901960784314, + "steps_max": 1936, + "values": 8192 + }, + "e3": { + "max_abs_diff": 0.0006103515625, + "max_abs_ref": 0.576171875, + "nonfinite_mismatch": 0, + "over_1_step": 867, + "over_4_steps": 264, + "rel": 0.001059322033898305, + "steps_max": 1846, + "values": 2048 + }, + "e4": { + "max_abs_diff": 0.000732421875, + "max_abs_ref": 0.38720703125, + "nonfinite_mismatch": 0, + "over_1_step": 549, + "over_4_steps": 207, + "rel": 0.0018915510718789407, + "steps_max": 3224, + "values": 1024 + }, + "out": { + "max_abs_diff": 0.00048828125, + "max_abs_ref": 0.75146484375, + "nonfinite_mismatch": 0, + "over_1_step": 3727, + "over_4_steps": 1283, + "rel": 0.000649772579597141, + "steps_max": 4201, + "values": 16384 + }, + "p1": { + "max_abs_diff": 0.0009765625, + "max_abs_ref": 1.736328125, + "nonfinite_mismatch": 0, + "over_1_step": 3, + "over_4_steps": 1, + "rel": 0.0005624296962879641, + "steps_max": 16, + "values": 8192 + }, + "p2": { + "max_abs_diff": 0.00048828125, + "max_abs_ref": 1.453125, + "nonfinite_mismatch": 0, + "over_1_step": 10, + "over_4_steps": 3, + "rel": 0.0003360215053763441, + "steps_max": 16, + "values": 4096 + }, + "p3": { + "max_abs_diff": 0.00048828125, + "max_abs_ref": 1.2412109375, + "nonfinite_mismatch": 0, + "over_1_step": 61, + "over_4_steps": 13, + "rel": 0.0003933910306845004, + "steps_max": 20, + "values": 2048 + }, + "p4": { + "max_abs_diff": 0.0009765625, + "max_abs_ref": 0.8583984375, + "nonfinite_mismatch": 0, + "over_1_step": 78, + "over_4_steps": 21, + "rel": 0.0011376564277588168, + "steps_max": 53, + "values": 512 + }, + "p5": { + "max_abs_diff": 0.00048828125, + "max_abs_ref": 0.49169921875, + "nonfinite_mismatch": 0, + "over_1_step": 94, + "over_4_steps": 26, + "rel": 0.0009930486593843098, + "steps_max": 41, + "values": 256 + }, + "s0": { + "max_abs_diff": 0.0009765625, + "max_abs_ref": 1.736328125, + "nonfinite_mismatch": 0, + "over_1_step": 4199, + "over_4_steps": 1306, + "rel": 0.0005624296962879641, + "steps_max": 2624, + "values": 32768 + }, + "s1": { + "max_abs_diff": 0.0009765625, + "max_abs_ref": 1.62109375, + "nonfinite_mismatch": 0, + "over_1_step": 2013, + "over_4_steps": 509, + "rel": 0.0006024096385542169, + "steps_max": 992, + "values": 16384 + }, + "s2": { + "max_abs_diff": 0.0009765625, + "max_abs_ref": 1.244140625, + "nonfinite_mismatch": 0, + "over_1_step": 1668, + "over_4_steps": 590, + "rel": 0.0007849293563579278, + "steps_max": 4136, + "values": 8192 + }, + "s3": { + "max_abs_diff": 0.0009765625, + "max_abs_ref": 0.857421875, + "nonfinite_mismatch": 0, + "over_1_step": 648, + "over_4_steps": 172, + "rel": 0.0011389521640091116, + "steps_max": 1456, + "values": 2048 + }, + "s4": { + "max_abs_diff": 0.0009765625, + "max_abs_ref": 0.6640625, + "nonfinite_mismatch": 0, + "over_1_step": 447, + "over_4_steps": 116, + "rel": 0.0014705882352941176, + "steps_max": 948, + "values": 1024 + }, + "u0": { + "max_abs_diff": 0.00048828125, + "max_abs_ref": 0.43017578125, + "nonfinite_mismatch": 0, + "over_1_step": 10113, + "over_4_steps": 2831, + "rel": 0.0011350737797956867, + "steps_max": 1462, + "values": 32768 + }, + "u1": { + "max_abs_diff": 0.00048828125, + "max_abs_ref": 0.44384765625, + "nonfinite_mismatch": 0, + "over_1_step": 5516, + "over_4_steps": 1312, + "rel": 0.0011001100110011, + "steps_max": 1796, + "values": 16384 + }, + "u2": { + "max_abs_diff": 0.000732421875, + "max_abs_ref": 0.369140625, + "nonfinite_mismatch": 0, + "over_1_step": 4092, + "over_4_steps": 1447, + "rel": 0.001984126984126984, + "steps_max": 2349, + "values": 8192 + }, + "u3": { + "max_abs_diff": 0.0006103515625, + "max_abs_ref": 0.373046875, + "nonfinite_mismatch": 0, + "over_1_step": 1120, + "over_4_steps": 405, + "rel": 0.0016361256544502618, + "steps_max": 1045, + "values": 2048 + }, + "u4": { + "max_abs_diff": 0.00048828125, + "max_abs_ref": 0.369384765625, + "nonfinite_mismatch": 0, + "over_1_step": 612, + "over_4_steps": 224, + "rel": 0.0013218770654329147, + "steps_max": 215, + "values": 1024 + } + }, + "vs_cpu_output": { + "max_abs_diff": 0.00048828125, + "max_abs_ref": 0.75146484375, + "nonfinite_mismatch": 0, + "over_1_step": 3727, + "over_4_steps": 1283, + "rel": 0.000649772579597141, + "steps_max": 4201, + "values": 16384 + }, + "vs_cpu_output_per_value": [ + { + "max_abs_diff": 0.00048828125, + "max_abs_ref": 0.5205078125, + "nonfinite_mismatch": 0, + "over_1_step": 1425, + "over_4_steps": 502, + "rel": 0.0009380863039399625, + "steps_max": 630, + "values": 4096 + }, + { + "max_abs_diff": 0.00048828125, + "max_abs_ref": 0.75146484375, + "nonfinite_mismatch": 0, + "over_1_step": 530, + "over_4_steps": 188, + "rel": 0.000649772579597141, + "steps_max": 230, + "values": 4096 + }, + { + "max_abs_diff": 0.00048828125, + "max_abs_ref": 0.5107421875, + "nonfinite_mismatch": 0, + "over_1_step": 954, + "over_4_steps": 317, + "rel": 0.0009560229445506692, + "steps_max": 4201, + "values": 4096 + }, + { + "max_abs_diff": 0.00048828125, + "max_abs_ref": 0.72265625, + "nonfinite_mismatch": 0, + "over_1_step": 818, + "over_4_steps": 276, + "rel": 0.0006756756756756757, + "steps_max": 1889, + "values": 4096 + } + ] + }, + { + "case": "synthetic_64", + "fused_equals_tierb": null, + "hip_equals_d3d12": true, + "input_pixels": [ + 64, + 64 + ], + "launches": 32, + "negative_controls": { + "fg_add_f16": { + "caught": true, + "differ": 1022, + "step": 13 + }, + "fg_conv_f16": { + "caught": true, + "differ": 32699, + "step": 0 + }, + "fg_maxpool2_f16": { + "caught": true, + "differ": 8169, + "step": 1 + }, + "fg_upscale_f16": { + "caught": true, + "differ": 1020, + "step": 12 + } + }, + "ok": true, + "path": "exact", + "vs_cpu_buffers": { + "a0": { + "max_abs_diff": 0.0, + "max_abs_ref": 1.736328125, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 32768 + }, + "a1": { + "max_abs_diff": 0.0, + "max_abs_ref": 1.453125, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 16384 + }, + "a2": { + "max_abs_diff": 0.0, + "max_abs_ref": 1.2412109375, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 8192 + }, + "a3": { + "max_abs_diff": 0.0, + "max_abs_ref": 0.8583984375, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 2048 + }, + "a4": { + "max_abs_diff": 0.0, + "max_abs_ref": 0.49169921875, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 1024 + }, + "b5": { + "max_abs_diff": 0.0, + "max_abs_ref": 0.435302734375, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 512 + }, + "d1": { + "max_abs_diff": 0.0, + "max_abs_ref": 0.4560546875, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 8192 + }, + "d2": { + "max_abs_diff": 0.0, + "max_abs_ref": 0.465087890625, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 4096 + }, + "d3": { + "max_abs_diff": 0.0, + "max_abs_ref": 0.37060546875, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 2048 + }, + "d4": { + "max_abs_diff": 0.0, + "max_abs_ref": 0.373046875, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 512 + }, + "d5": { + "max_abs_diff": 0.0, + "max_abs_ref": 0.369384765625, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 256 + }, + "e0": { + "max_abs_diff": 0.0, + "max_abs_ref": 1.201171875, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 32768 + }, + "e1": { + "max_abs_diff": 0.0, + "max_abs_ref": 1.015625, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 16384 + }, + "e2": { + "max_abs_diff": 0.0, + "max_abs_ref": 0.796875, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 8192 + }, + "e3": { + "max_abs_diff": 0.0, + "max_abs_ref": 0.576171875, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 2048 + }, + "e4": { + "max_abs_diff": 0.0, + "max_abs_ref": 0.38720703125, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 1024 + }, + "out": { + "max_abs_diff": 0.0, + "max_abs_ref": 0.75146484375, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 16384 + }, + "p1": { + "max_abs_diff": 0.0, + "max_abs_ref": 1.736328125, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 8192 + }, + "p2": { + "max_abs_diff": 0.0, + "max_abs_ref": 1.453125, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 4096 + }, + "p3": { + "max_abs_diff": 0.0, + "max_abs_ref": 1.2412109375, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 2048 + }, + "p4": { + "max_abs_diff": 0.0, + "max_abs_ref": 0.8583984375, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 512 + }, + "p5": { + "max_abs_diff": 0.0, + "max_abs_ref": 0.49169921875, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 256 + }, + "s0": { + "max_abs_diff": 0.0, + "max_abs_ref": 1.736328125, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 32768 + }, + "s1": { + "max_abs_diff": 0.0, + "max_abs_ref": 1.62109375, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 16384 + }, + "s2": { + "max_abs_diff": 0.0, + "max_abs_ref": 1.244140625, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 8192 + }, + "s3": { + "max_abs_diff": 0.0, + "max_abs_ref": 0.857421875, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 2048 + }, + "s4": { + "max_abs_diff": 0.0, + "max_abs_ref": 0.6640625, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 1024 + }, + "u0": { + "max_abs_diff": 0.0, + "max_abs_ref": 0.43017578125, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 32768 + }, + "u1": { + "max_abs_diff": 0.0, + "max_abs_ref": 0.44384765625, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 16384 + }, + "u2": { + "max_abs_diff": 0.0, + "max_abs_ref": 0.369140625, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 8192 + }, + "u3": { + "max_abs_diff": 0.0, + "max_abs_ref": 0.373046875, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 2048 + }, + "u4": { + "max_abs_diff": 0.0, + "max_abs_ref": 0.369384765625, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 1024 + } + }, + "vs_cpu_output": { + "max_abs_diff": 0.0, + "max_abs_ref": 0.75146484375, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 16384 + }, + "vs_cpu_output_per_value": [ + { + "max_abs_diff": 0.0, + "max_abs_ref": 0.5205078125, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 4096 + }, + { + "max_abs_diff": 0.0, + "max_abs_ref": 0.75146484375, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 4096 + }, + { + "max_abs_diff": 0.0, + "max_abs_ref": 0.5107421875, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 4096 + }, + { + "max_abs_diff": 0.0, + "max_abs_ref": 0.72265625, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 4096 + } + ] + }, + { + "case": "synthetic_70x90", + "fused_equals_tierb": { + "a0": true, + "a1": true, + "a2": true, + "a3": true, + "a4": true, + "d1": true, + "d2": true, + "d3": true, + "d4": true, + "d5": true, + "out": true, + "p1": true, + "p2": true, + "p3": true, + "p4": true, + "p5": true + }, + "hip_equals_d3d12": true, + "input_pixels": [ + 90, + 70 + ], + "launches": 11, + "negative_controls": { + "fg_mconv2": { + "caught": true, + "differ": 46798, + "step": 0 + }, + "fg_mconv4": { + "caught": true, + "differ": 2812, + "step": 1 + }, + "fg_mpair_d0": { + "caught": true, + "differ": 25770, + "step": 10 + }, + "fg_mpair_d1": { + "caught": true, + "differ": 7533, + "step": 9 + } + }, + "ok": true, + "path": "fused", + "vs_cpu_buffers": { + "a0": { + "max_abs_diff": 0.00048828125, + "max_abs_ref": 2.109375, + "nonfinite_mismatch": 0, + "over_1_step": 25, + "over_4_steps": 3, + "rel": 0.0002314814814814815, + "steps_max": 41, + "values": 50400 + }, + "a1": { + "max_abs_diff": 0.00048828125, + "max_abs_ref": 1.76953125, + "nonfinite_mismatch": 0, + "over_1_step": 59, + "over_4_steps": 15, + "rel": 0.0002759381898454746, + "steps_max": 71, + "values": 23936 + }, + "a2": { + "max_abs_diff": 0.0009765625, + "max_abs_ref": 1.2353515625, + "nonfinite_mismatch": 0, + "over_1_step": 466, + "over_4_steps": 120, + "rel": 0.0007905138339920949, + "steps_max": 64, + "values": 11264 + }, + "a3": { + "max_abs_diff": 0.00048828125, + "max_abs_ref": 0.76611328125, + "nonfinite_mismatch": 0, + "over_1_step": 607, + "over_4_steps": 169, + "rel": 0.0006373486297004461, + "steps_max": 440, + "values": 2560 + }, + "a4": { + "max_abs_diff": 0.0006103515625, + "max_abs_ref": 0.4697265625, + "nonfinite_mismatch": 0, + "over_1_step": 481, + "over_4_steps": 175, + "rel": 0.0012993762993762994, + "steps_max": 1330, + "values": 1024 + }, + "d1": { + "max_abs_diff": 0.00048828125, + "max_abs_ref": 0.5712890625, + "nonfinite_mismatch": 0, + "over_1_step": 3675, + "over_4_steps": 1150, + "rel": 0.0008547008547008547, + "steps_max": 2564, + "values": 11968 + }, + "d2": { + "max_abs_diff": 0.00048828125, + "max_abs_ref": 0.385986328125, + "nonfinite_mismatch": 0, + "over_1_step": 2347, + "over_4_steps": 705, + "rel": 0.001265022137887413, + "steps_max": 1250, + "values": 5632 + }, + "d3": { + "max_abs_diff": 0.00048828125, + "max_abs_ref": 0.3896484375, + "nonfinite_mismatch": 0, + "over_1_step": 1181, + "over_4_steps": 417, + "rel": 0.0012531328320802004, + "steps_max": 2379, + "values": 2560 + }, + "d4": { + "max_abs_diff": 0.000518798828125, + "max_abs_ref": 0.218017578125, + "nonfinite_mismatch": 0, + "over_1_step": 312, + "over_4_steps": 128, + "rel": 0.002379619260918253, + "steps_max": 1572, + "values": 512 + }, + "d5": { + "max_abs_diff": 0.0006103515625, + "max_abs_ref": 0.336669921875, + "nonfinite_mismatch": 0, + "over_1_step": 159, + "over_4_steps": 72, + "rel": 0.0018129079042784628, + "steps_max": 311, + "values": 256 + }, + "out": { + "max_abs_diff": 0.0009765625, + "max_abs_ref": 1.0244140625, + "nonfinite_mismatch": 0, + "over_1_step": 6221, + "over_4_steps": 2004, + "rel": 0.0009532888465204957, + "steps_max": 2027, + "values": 25200 + }, + "p1": { + "max_abs_diff": 0.00048828125, + "max_abs_ref": 2.109375, + "nonfinite_mismatch": 0, + "over_1_step": 3, + "over_4_steps": 0, + "rel": 0.0002314814814814815, + "steps_max": 2, + "values": 11968 + }, + "p2": { + "max_abs_diff": 0.00048828125, + "max_abs_ref": 1.76953125, + "nonfinite_mismatch": 0, + "over_1_step": 9, + "over_4_steps": 4, + "rel": 0.0002759381898454746, + "steps_max": 71, + "values": 5632 + }, + "p3": { + "max_abs_diff": 0.0009765625, + "max_abs_ref": 1.2353515625, + "nonfinite_mismatch": 0, + "over_1_step": 103, + "over_4_steps": 27, + "rel": 0.0007905138339920949, + "steps_max": 20, + "values": 2560 + }, + "p4": { + "max_abs_diff": 0.00048828125, + "max_abs_ref": 0.76611328125, + "nonfinite_mismatch": 0, + "over_1_step": 114, + "over_4_steps": 35, + "rel": 0.0006373486297004461, + "steps_max": 72, + "values": 512 + }, + "p5": { + "max_abs_diff": 0.0006103515625, + "max_abs_ref": 0.4697265625, + "nonfinite_mismatch": 0, + "over_1_step": 111, + "over_4_steps": 45, + "rel": 0.0012993762993762994, + "steps_max": 51, + "values": 256 + } + }, + "vs_cpu_output": { + "max_abs_diff": 0.0009765625, + "max_abs_ref": 1.0244140625, + "nonfinite_mismatch": 0, + "over_1_step": 6221, + "over_4_steps": 2004, + "rel": 0.0009532888465204957, + "steps_max": 2027, + "values": 25200 + }, + "vs_cpu_output_per_value": [ + { + "max_abs_diff": 0.00048828125, + "max_abs_ref": 0.576171875, + "nonfinite_mismatch": 0, + "over_1_step": 1596, + "over_4_steps": 521, + "rel": 0.000847457627118644, + "steps_max": 1035, + "values": 6300 + }, + { + "max_abs_diff": 0.00048828125, + "max_abs_ref": 0.73291015625, + "nonfinite_mismatch": 0, + "over_1_step": 1721, + "over_4_steps": 584, + "rel": 0.0006662225183211193, + "steps_max": 258, + "values": 6300 + }, + { + "max_abs_diff": 0.0009765625, + "max_abs_ref": 1.0244140625, + "nonfinite_mismatch": 0, + "over_1_step": 1204, + "over_4_steps": 342, + "rel": 0.0009532888465204957, + "steps_max": 2027, + "values": 6300 + }, + { + "max_abs_diff": 0.00048828125, + "max_abs_ref": 0.53466796875, + "nonfinite_mismatch": 0, + "over_1_step": 1700, + "over_4_steps": 557, + "rel": 0.0009132420091324201, + "steps_max": 1547, + "values": 6300 + } + ] + }, + { + "case": "synthetic_70x90", + "fused_equals_tierb": null, + "hip_equals_d3d12": true, + "input_pixels": [ + 90, + 70 + ], + "launches": 27, + "negative_controls": { + "fg_add_f16": { + "caught": true, + "differ": 1024, + "step": 8 + }, + "fg_mconv1": { + "caught": true, + "differ": 19127, + "step": 26 + }, + "fg_mconv2": { + "caught": true, + "differ": 46798, + "step": 0 + }, + "fg_mconv4": { + "caught": true, + "differ": 2812, + "step": 1 + }, + "fg_upscale_hwc_f16": { + "caught": true, + "differ": 1024, + "step": 7 + } + }, + "ok": true, + "path": "tierb", + "vs_cpu_buffers": { + "a0": { + "max_abs_diff": 0.00048828125, + "max_abs_ref": 2.109375, + "nonfinite_mismatch": 0, + "over_1_step": 25, + "over_4_steps": 3, + "rel": 0.0002314814814814815, + "steps_max": 41, + "values": 50400 + }, + "a1": { + "max_abs_diff": 0.00048828125, + "max_abs_ref": 1.76953125, + "nonfinite_mismatch": 0, + "over_1_step": 59, + "over_4_steps": 15, + "rel": 0.0002759381898454746, + "steps_max": 71, + "values": 23936 + }, + "a2": { + "max_abs_diff": 0.0009765625, + "max_abs_ref": 1.2353515625, + "nonfinite_mismatch": 0, + "over_1_step": 466, + "over_4_steps": 120, + "rel": 0.0007905138339920949, + "steps_max": 64, + "values": 11264 + }, + "a3": { + "max_abs_diff": 0.00048828125, + "max_abs_ref": 0.76611328125, + "nonfinite_mismatch": 0, + "over_1_step": 607, + "over_4_steps": 169, + "rel": 0.0006373486297004461, + "steps_max": 440, + "values": 2560 + }, + "a4": { + "max_abs_diff": 0.0006103515625, + "max_abs_ref": 0.4697265625, + "nonfinite_mismatch": 0, + "over_1_step": 481, + "over_4_steps": 175, + "rel": 0.0012993762993762994, + "steps_max": 1330, + "values": 1024 + }, + "b5": { + "max_abs_diff": 0.000732421875, + "max_abs_ref": 0.466796875, + "nonfinite_mismatch": 0, + "over_1_step": 276, + "over_4_steps": 85, + "rel": 0.0015690376569037657, + "steps_max": 298, + "values": 512 + }, + "d1": { + "max_abs_diff": 0.00048828125, + "max_abs_ref": 0.5712890625, + "nonfinite_mismatch": 0, + "over_1_step": 3675, + "over_4_steps": 1150, + "rel": 0.0008547008547008547, + "steps_max": 2564, + "values": 11968 + }, + "d2": { + "max_abs_diff": 0.00048828125, + "max_abs_ref": 0.385986328125, + "nonfinite_mismatch": 0, + "over_1_step": 2347, + "over_4_steps": 705, + "rel": 0.001265022137887413, + "steps_max": 1250, + "values": 5632 + }, + "d3": { + "max_abs_diff": 0.00048828125, + "max_abs_ref": 0.3896484375, + "nonfinite_mismatch": 0, + "over_1_step": 1181, + "over_4_steps": 417, + "rel": 0.0012531328320802004, + "steps_max": 2379, + "values": 2560 + }, + "d4": { + "max_abs_diff": 0.000518798828125, + "max_abs_ref": 0.218017578125, + "nonfinite_mismatch": 0, + "over_1_step": 312, + "over_4_steps": 128, + "rel": 0.002379619260918253, + "steps_max": 1572, + "values": 512 + }, + "d5": { + "max_abs_diff": 0.0006103515625, + "max_abs_ref": 0.336669921875, + "nonfinite_mismatch": 0, + "over_1_step": 159, + "over_4_steps": 72, + "rel": 0.0018129079042784628, + "steps_max": 311, + "values": 256 + }, + "e0": { + "max_abs_diff": 0.0009765625, + "max_abs_ref": 1.3369140625, + "nonfinite_mismatch": 0, + "over_1_step": 9672, + "over_4_steps": 2835, + "rel": 0.0007304601899196494, + "steps_max": 1332, + "values": 50400 + }, + "e1": { + "max_abs_diff": 0.0009765625, + "max_abs_ref": 1.1337890625, + "nonfinite_mismatch": 0, + "over_1_step": 5061, + "over_4_steps": 1466, + "rel": 0.0008613264427217916, + "steps_max": 1552, + "values": 23936 + }, + "e2": { + "max_abs_diff": 0.000732421875, + "max_abs_ref": 0.72265625, + "nonfinite_mismatch": 0, + "over_1_step": 3339, + "over_4_steps": 847, + "rel": 0.0010135135135135136, + "steps_max": 2076, + "values": 11264 + }, + "e3": { + "max_abs_diff": 0.000732421875, + "max_abs_ref": 0.53466796875, + "nonfinite_mismatch": 0, + "over_1_step": 1074, + "over_4_steps": 338, + "rel": 0.0013698630136986301, + "steps_max": 1685, + "values": 2560 + }, + "e4": { + "max_abs_diff": 0.00048828125, + "max_abs_ref": 0.359130859375, + "nonfinite_mismatch": 0, + "over_1_step": 588, + "over_4_steps": 239, + "rel": 0.0013596193065941536, + "steps_max": 820, + "values": 1024 + }, + "out": { + "max_abs_diff": 0.0009765625, + "max_abs_ref": 1.0244140625, + "nonfinite_mismatch": 0, + "over_1_step": 6221, + "over_4_steps": 2004, + "rel": 0.0009532888465204957, + "steps_max": 2027, + "values": 25200 + }, + "p1": { + "max_abs_diff": 0.00048828125, + "max_abs_ref": 2.109375, + "nonfinite_mismatch": 0, + "over_1_step": 3, + "over_4_steps": 0, + "rel": 0.0002314814814814815, + "steps_max": 2, + "values": 11968 + }, + "p2": { + "max_abs_diff": 0.00048828125, + "max_abs_ref": 1.76953125, + "nonfinite_mismatch": 0, + "over_1_step": 9, + "over_4_steps": 4, + "rel": 0.0002759381898454746, + "steps_max": 71, + "values": 5632 + }, + "p3": { + "max_abs_diff": 0.0009765625, + "max_abs_ref": 1.2353515625, + "nonfinite_mismatch": 0, + "over_1_step": 103, + "over_4_steps": 27, + "rel": 0.0007905138339920949, + "steps_max": 20, + "values": 2560 + }, + "p4": { + "max_abs_diff": 0.00048828125, + "max_abs_ref": 0.76611328125, + "nonfinite_mismatch": 0, + "over_1_step": 114, + "over_4_steps": 35, + "rel": 0.0006373486297004461, + "steps_max": 72, + "values": 512 + }, + "p5": { + "max_abs_diff": 0.0006103515625, + "max_abs_ref": 0.4697265625, + "nonfinite_mismatch": 0, + "over_1_step": 111, + "over_4_steps": 45, + "rel": 0.0012993762993762994, + "steps_max": 51, + "values": 256 + }, + "s0": { + "max_abs_diff": 0.0009765625, + "max_abs_ref": 2.10546875, + "nonfinite_mismatch": 0, + "over_1_step": 6190, + "over_4_steps": 1652, + "rel": 0.00046382189239332097, + "steps_max": 992, + "values": 50400 + }, + "s1": { + "max_abs_diff": 0.0009765625, + "max_abs_ref": 1.912109375, + "nonfinite_mismatch": 0, + "over_1_step": 3214, + "over_4_steps": 880, + "rel": 0.0005107252298263534, + "steps_max": 2048, + "values": 23936 + }, + "s2": { + "max_abs_diff": 0.0009765625, + "max_abs_ref": 1.234375, + "nonfinite_mismatch": 0, + "over_1_step": 2272, + "over_4_steps": 761, + "rel": 0.0007911392405063291, + "steps_max": 2319, + "values": 11264 + }, + "s3": { + "max_abs_diff": 0.0009765625, + "max_abs_ref": 0.79541015625, + "nonfinite_mismatch": 0, + "over_1_step": 886, + "over_4_steps": 307, + "rel": 0.0012277470841006752, + "steps_max": 1136, + "values": 2560 + }, + "s4": { + "max_abs_diff": 0.000732421875, + "max_abs_ref": 0.57861328125, + "nonfinite_mismatch": 0, + "over_1_step": 500, + "over_4_steps": 166, + "rel": 0.0012658227848101266, + "steps_max": 2336, + "values": 1024 + }, + "u0": { + "max_abs_diff": 0.000732421875, + "max_abs_ref": 0.51904296875, + "nonfinite_mismatch": 0, + "over_1_step": 13349, + "over_4_steps": 3401, + "rel": 0.0014111006585136407, + "steps_max": 1776, + "values": 50400 + }, + "u1": { + "max_abs_diff": 0.0006103515625, + "max_abs_ref": 0.362548828125, + "nonfinite_mismatch": 0, + "over_1_step": 8316, + "over_4_steps": 2040, + "rel": 0.0016835016835016834, + "steps_max": 1907, + "values": 23936 + }, + "u2": { + "max_abs_diff": 0.0006103515625, + "max_abs_ref": 0.359375, + "nonfinite_mismatch": 0, + "over_1_step": 4523, + "over_4_steps": 1454, + "rel": 0.0016983695652173913, + "steps_max": 2319, + "values": 11264 + }, + "u3": { + "max_abs_diff": 0.000518798828125, + "max_abs_ref": 0.218017578125, + "nonfinite_mismatch": 0, + "over_1_step": 1381, + "over_4_steps": 499, + "rel": 0.002379619260918253, + "steps_max": 1815, + "values": 2560 + }, + "u4": { + "max_abs_diff": 0.0006103515625, + "max_abs_ref": 0.336669921875, + "nonfinite_mismatch": 0, + "over_1_step": 636, + "over_4_steps": 288, + "rel": 0.0018129079042784628, + "steps_max": 311, + "values": 1024 + } + }, + "vs_cpu_output": { + "max_abs_diff": 0.0009765625, + "max_abs_ref": 1.0244140625, + "nonfinite_mismatch": 0, + "over_1_step": 6221, + "over_4_steps": 2004, + "rel": 0.0009532888465204957, + "steps_max": 2027, + "values": 25200 + }, + "vs_cpu_output_per_value": [ + { + "max_abs_diff": 0.00048828125, + "max_abs_ref": 0.576171875, + "nonfinite_mismatch": 0, + "over_1_step": 1596, + "over_4_steps": 521, + "rel": 0.000847457627118644, + "steps_max": 1035, + "values": 6300 + }, + { + "max_abs_diff": 0.00048828125, + "max_abs_ref": 0.73291015625, + "nonfinite_mismatch": 0, + "over_1_step": 1721, + "over_4_steps": 584, + "rel": 0.0006662225183211193, + "steps_max": 258, + "values": 6300 + }, + { + "max_abs_diff": 0.0009765625, + "max_abs_ref": 1.0244140625, + "nonfinite_mismatch": 0, + "over_1_step": 1204, + "over_4_steps": 342, + "rel": 0.0009532888465204957, + "steps_max": 2027, + "values": 6300 + }, + { + "max_abs_diff": 0.00048828125, + "max_abs_ref": 0.53466796875, + "nonfinite_mismatch": 0, + "over_1_step": 1700, + "over_4_steps": 557, + "rel": 0.0009132420091324201, + "steps_max": 1547, + "values": 6300 + } + ] + }, + { + "case": "synthetic_70x90", + "fused_equals_tierb": null, + "hip_equals_d3d12": true, + "input_pixels": [ + 90, + 70 + ], + "launches": 32, + "negative_controls": { + "fg_add_f16": { + "caught": true, + "differ": 1023, + "step": 13 + }, + "fg_conv_f16": { + "caught": true, + "differ": 50481, + "step": 0 + }, + "fg_maxpool2_f16": { + "caught": true, + "differ": 12132, + "step": 1 + }, + "fg_upscale_f16": { + "caught": true, + "differ": 1024, + "step": 12 + } + }, + "ok": true, + "path": "exact", + "vs_cpu_buffers": { + "a0": { + "max_abs_diff": 0.0, + "max_abs_ref": 2.109375, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 50400 + }, + "a1": { + "max_abs_diff": 0.0, + "max_abs_ref": 1.76953125, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 23936 + }, + "a2": { + "max_abs_diff": 0.0, + "max_abs_ref": 1.2353515625, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 11264 + }, + "a3": { + "max_abs_diff": 0.0, + "max_abs_ref": 0.76611328125, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 2560 + }, + "a4": { + "max_abs_diff": 0.0, + "max_abs_ref": 0.4697265625, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 1024 + }, + "b5": { + "max_abs_diff": 0.0, + "max_abs_ref": 0.466796875, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 512 + }, + "d1": { + "max_abs_diff": 0.0, + "max_abs_ref": 0.5712890625, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 11968 + }, + "d2": { + "max_abs_diff": 0.0, + "max_abs_ref": 0.385986328125, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 5632 + }, + "d3": { + "max_abs_diff": 0.0, + "max_abs_ref": 0.3896484375, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 2560 + }, + "d4": { + "max_abs_diff": 0.0, + "max_abs_ref": 0.218017578125, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 512 + }, + "d5": { + "max_abs_diff": 0.0, + "max_abs_ref": 0.336669921875, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 256 + }, + "e0": { + "max_abs_diff": 0.0, + "max_abs_ref": 1.3369140625, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 50400 + }, + "e1": { + "max_abs_diff": 0.0, + "max_abs_ref": 1.1337890625, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 23936 + }, + "e2": { + "max_abs_diff": 0.0, + "max_abs_ref": 0.72265625, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 11264 + }, + "e3": { + "max_abs_diff": 0.0, + "max_abs_ref": 0.53466796875, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 2560 + }, + "e4": { + "max_abs_diff": 0.0, + "max_abs_ref": 0.359130859375, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 1024 + }, + "out": { + "max_abs_diff": 0.0, + "max_abs_ref": 1.0244140625, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 25200 + }, + "p1": { + "max_abs_diff": 0.0, + "max_abs_ref": 2.109375, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 11968 + }, + "p2": { + "max_abs_diff": 0.0, + "max_abs_ref": 1.76953125, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 5632 + }, + "p3": { + "max_abs_diff": 0.0, + "max_abs_ref": 1.2353515625, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 2560 + }, + "p4": { + "max_abs_diff": 0.0, + "max_abs_ref": 0.76611328125, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 512 + }, + "p5": { + "max_abs_diff": 0.0, + "max_abs_ref": 0.4697265625, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 256 + }, + "s0": { + "max_abs_diff": 0.0, + "max_abs_ref": 2.10546875, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 50400 + }, + "s1": { + "max_abs_diff": 0.0, + "max_abs_ref": 1.912109375, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 23936 + }, + "s2": { + "max_abs_diff": 0.0, + "max_abs_ref": 1.234375, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 11264 + }, + "s3": { + "max_abs_diff": 0.0, + "max_abs_ref": 0.79541015625, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 2560 + }, + "s4": { + "max_abs_diff": 0.0, + "max_abs_ref": 0.57861328125, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 1024 + }, + "u0": { + "max_abs_diff": 0.0, + "max_abs_ref": 0.51904296875, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 50400 + }, + "u1": { + "max_abs_diff": 0.0, + "max_abs_ref": 0.362548828125, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 23936 + }, + "u2": { + "max_abs_diff": 0.0, + "max_abs_ref": 0.359375, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 11264 + }, + "u3": { + "max_abs_diff": 0.0, + "max_abs_ref": 0.218017578125, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 2560 + }, + "u4": { + "max_abs_diff": 0.0, + "max_abs_ref": 0.336669921875, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 1024 + } + }, + "vs_cpu_output": { + "max_abs_diff": 0.0, + "max_abs_ref": 1.0244140625, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 25200 + }, + "vs_cpu_output_per_value": [ + { + "max_abs_diff": 0.0, + "max_abs_ref": 0.576171875, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 6300 + }, + { + "max_abs_diff": 0.0, + "max_abs_ref": 0.73291015625, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 6300 + }, + { + "max_abs_diff": 0.0, + "max_abs_ref": 1.0244140625, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 6300 + }, + { + "max_abs_diff": 0.0, + "max_abs_ref": 0.53466796875, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 6300 + } + ] + }, + { + "case": "specials_64", + "fused_equals_tierb": { + "a0": true, + "a1": true, + "a2": true, + "a3": true, + "a4": true, + "d1": true, + "d2": true, + "d3": true, + "d4": true, + "d5": true, + "out": true, + "p1": true, + "p2": true, + "p3": true, + "p4": true, + "p5": true + }, + "hip_equals_d3d12": true, + "input_pixels": [ + 64, + 64 + ], + "launches": 11, + "negative_controls": { + "fg_mconv2": { + "caught": true, + "differ": 40873, + "step": 0 + }, + "fg_mconv4": { + "caught": true, + "differ": 1280, + "step": 4 + }, + "fg_mpair_d0": { + "caught": true, + "differ": 16384, + "step": 10 + } + }, + "ok": true, + "path": "fused", + "vs_cpu_buffers": { + "a0": { + "max_abs_diff": 4.0, + "max_abs_ref": 11512.0, + "nonfinite_mismatch": 0, + "over_1_step": 4, + "over_4_steps": 1, + "rel": 0.00034746351633078526, + "steps_max": 10, + "values": 32768 + }, + "a1": { + "max_abs_diff": 4.0, + "max_abs_ref": 9864.0, + "nonfinite_mismatch": 0, + "over_1_step": 11, + "over_4_steps": 2, + "rel": 0.00040551500405515005, + "steps_max": 10, + "values": 16384 + }, + "a2": { + "max_abs_diff": 0.0, + "max_abs_ref": 0.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 8192 + }, + "a3": { + "max_abs_diff": 0.0, + "max_abs_ref": 0.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 2048 + }, + "a4": { + "max_abs_diff": 0.0, + "max_abs_ref": 0.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 1024 + }, + "d1": { + "max_abs_diff": 0.0, + "max_abs_ref": 0.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 8192 + }, + "d2": { + "max_abs_diff": 0.0, + "max_abs_ref": 0.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 4096 + }, + "d3": { + "max_abs_diff": 0.0, + "max_abs_ref": 0.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 2048 + }, + "d4": { + "max_abs_diff": 0.0, + "max_abs_ref": 0.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 512 + }, + "d5": { + "max_abs_diff": 0.0, + "max_abs_ref": 0.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 256 + }, + "out": { + "max_abs_diff": 0.0, + "max_abs_ref": 0.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 16384 + }, + "p1": { + "max_abs_diff": 0.000244140625, + "max_abs_ref": 11512.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 2.1207490010423905e-08, + "steps_max": 1, + "values": 8192 + }, + "p2": { + "max_abs_diff": 4.0, + "max_abs_ref": 8216.0, + "nonfinite_mismatch": 0, + "over_1_step": 4, + "over_4_steps": 0, + "rel": 0.0004868549172346641, + "steps_max": 4, + "values": 4096 + }, + "p3": { + "max_abs_diff": 0.0, + "max_abs_ref": 0.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 2048 + }, + "p4": { + "max_abs_diff": 0.0, + "max_abs_ref": 0.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 512 + }, + "p5": { + "max_abs_diff": 0.0, + "max_abs_ref": 0.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 256 + } + }, + "vs_cpu_output": { + "max_abs_diff": 0.0, + "max_abs_ref": 0.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 16384 + }, + "vs_cpu_output_per_value": [ + { + "max_abs_diff": 0.0, + "max_abs_ref": 0.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 4096 + }, + { + "max_abs_diff": 0.0, + "max_abs_ref": 0.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 4096 + }, + { + "max_abs_diff": 0.0, + "max_abs_ref": 0.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 4096 + }, + { + "max_abs_diff": 0.0, + "max_abs_ref": 0.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 4096 + } + ] + }, + { + "case": "specials_64", + "fused_equals_tierb": null, + "hip_equals_d3d12": true, + "input_pixels": [ + 64, + 64 + ], + "launches": 27, + "negative_controls": { + "fg_add_f16": { + "caught": true, + "differ": 1024, + "step": 8 + }, + "fg_mconv1": { + "caught": true, + "differ": 16384, + "step": 26 + }, + "fg_mconv2": { + "caught": true, + "differ": 40873, + "step": 0 + }, + "fg_mconv4": { + "caught": true, + "differ": 1280, + "step": 4 + }, + "fg_upscale_hwc_f16": { + "caught": true, + "differ": 1024, + "step": 7 + } + }, + "ok": true, + "path": "tierb", + "vs_cpu_buffers": { + "a0": { + "max_abs_diff": 4.0, + "max_abs_ref": 11512.0, + "nonfinite_mismatch": 0, + "over_1_step": 4, + "over_4_steps": 1, + "rel": 0.00034746351633078526, + "steps_max": 10, + "values": 32768 + }, + "a1": { + "max_abs_diff": 4.0, + "max_abs_ref": 9864.0, + "nonfinite_mismatch": 0, + "over_1_step": 11, + "over_4_steps": 2, + "rel": 0.00040551500405515005, + "steps_max": 10, + "values": 16384 + }, + "a2": { + "max_abs_diff": 0.0, + "max_abs_ref": 0.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 8192 + }, + "a3": { + "max_abs_diff": 0.0, + "max_abs_ref": 0.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 2048 + }, + "a4": { + "max_abs_diff": 0.0, + "max_abs_ref": 0.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 1024 + }, + "b5": { + "max_abs_diff": 0.0, + "max_abs_ref": 0.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 512 + }, + "d1": { + "max_abs_diff": 0.0, + "max_abs_ref": 0.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 8192 + }, + "d2": { + "max_abs_diff": 0.0, + "max_abs_ref": 0.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 4096 + }, + "d3": { + "max_abs_diff": 0.0, + "max_abs_ref": 0.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 2048 + }, + "d4": { + "max_abs_diff": 0.0, + "max_abs_ref": 0.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 512 + }, + "d5": { + "max_abs_diff": 0.0, + "max_abs_ref": 0.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 256 + }, + "e0": { + "max_abs_diff": 0.0, + "max_abs_ref": 0.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 32768 + }, + "e1": { + "max_abs_diff": 0.0, + "max_abs_ref": 0.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 16384 + }, + "e2": { + "max_abs_diff": 0.0, + "max_abs_ref": 0.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 8192 + }, + "e3": { + "max_abs_diff": 0.0, + "max_abs_ref": 0.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 2048 + }, + "e4": { + "max_abs_diff": 0.0, + "max_abs_ref": 0.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 1024 + }, + "out": { + "max_abs_diff": 0.0, + "max_abs_ref": 0.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 16384 + }, + "p1": { + "max_abs_diff": 0.000244140625, + "max_abs_ref": 11512.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 2.1207490010423905e-08, + "steps_max": 1, + "values": 8192 + }, + "p2": { + "max_abs_diff": 4.0, + "max_abs_ref": 8216.0, + "nonfinite_mismatch": 0, + "over_1_step": 4, + "over_4_steps": 0, + "rel": 0.0004868549172346641, + "steps_max": 4, + "values": 4096 + }, + "p3": { + "max_abs_diff": 0.0, + "max_abs_ref": 0.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 2048 + }, + "p4": { + "max_abs_diff": 0.0, + "max_abs_ref": 0.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 512 + }, + "p5": { + "max_abs_diff": 0.0, + "max_abs_ref": 0.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 256 + }, + "s0": { + "max_abs_diff": 0.0, + "max_abs_ref": 0.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 32768 + }, + "s1": { + "max_abs_diff": 0.0, + "max_abs_ref": 0.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 16384 + }, + "s2": { + "max_abs_diff": 0.0, + "max_abs_ref": 0.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 8192 + }, + "s3": { + "max_abs_diff": 0.0, + "max_abs_ref": 0.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 2048 + }, + "s4": { + "max_abs_diff": 0.0, + "max_abs_ref": 0.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 1024 + }, + "u0": { + "max_abs_diff": 0.0, + "max_abs_ref": 0.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 32768 + }, + "u1": { + "max_abs_diff": 0.0, + "max_abs_ref": 0.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 16384 + }, + "u2": { + "max_abs_diff": 0.0, + "max_abs_ref": 0.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 8192 + }, + "u3": { + "max_abs_diff": 0.0, + "max_abs_ref": 0.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 2048 + }, + "u4": { + "max_abs_diff": 0.0, + "max_abs_ref": 0.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 1024 + } + }, + "vs_cpu_output": { + "max_abs_diff": 0.0, + "max_abs_ref": 0.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 16384 + }, + "vs_cpu_output_per_value": [ + { + "max_abs_diff": 0.0, + "max_abs_ref": 0.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 4096 + }, + { + "max_abs_diff": 0.0, + "max_abs_ref": 0.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 4096 + }, + { + "max_abs_diff": 0.0, + "max_abs_ref": 0.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 4096 + }, + { + "max_abs_diff": 0.0, + "max_abs_ref": 0.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 4096 + } + ] + }, + { + "case": "specials_64", + "fused_equals_tierb": null, + "hip_equals_d3d12": true, + "input_pixels": [ + 64, + 64 + ], + "launches": 32, + "negative_controls": { + "fg_add_f16": { + "caught": true, + "differ": 1024, + "step": 13 + }, + "fg_conv_f16": { + "caught": true, + "differ": 32690, + "step": 0 + }, + "fg_maxpool2_f16": { + "caught": true, + "differ": 8177, + "step": 1 + }, + "fg_upscale_f16": { + "caught": true, + "differ": 1024, + "step": 12 + } + }, + "ok": true, + "path": "exact", + "vs_cpu_buffers": { + "a0": { + "max_abs_diff": 0.0, + "max_abs_ref": 11512.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 32768 + }, + "a1": { + "max_abs_diff": 0.0, + "max_abs_ref": 9864.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 16384 + }, + "a2": { + "max_abs_diff": 0.0, + "max_abs_ref": 0.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 8192 + }, + "a3": { + "max_abs_diff": 0.0, + "max_abs_ref": 0.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 2048 + }, + "a4": { + "max_abs_diff": 0.0, + "max_abs_ref": 0.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 1024 + }, + "b5": { + "max_abs_diff": 0.0, + "max_abs_ref": 0.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 512 + }, + "d1": { + "max_abs_diff": 0.0, + "max_abs_ref": 0.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 8192 + }, + "d2": { + "max_abs_diff": 0.0, + "max_abs_ref": 0.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 4096 + }, + "d3": { + "max_abs_diff": 0.0, + "max_abs_ref": 0.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 2048 + }, + "d4": { + "max_abs_diff": 0.0, + "max_abs_ref": 0.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 512 + }, + "d5": { + "max_abs_diff": 0.0, + "max_abs_ref": 0.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 256 + }, + "e0": { + "max_abs_diff": 0.0, + "max_abs_ref": 0.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 32768 + }, + "e1": { + "max_abs_diff": 0.0, + "max_abs_ref": 0.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 16384 + }, + "e2": { + "max_abs_diff": 0.0, + "max_abs_ref": 0.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 8192 + }, + "e3": { + "max_abs_diff": 0.0, + "max_abs_ref": 0.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 2048 + }, + "e4": { + "max_abs_diff": 0.0, + "max_abs_ref": 0.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 1024 + }, + "out": { + "max_abs_diff": 0.0, + "max_abs_ref": 0.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 16384 + }, + "p1": { + "max_abs_diff": 0.0, + "max_abs_ref": 11512.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 8192 + }, + "p2": { + "max_abs_diff": 0.0, + "max_abs_ref": 8216.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 4096 + }, + "p3": { + "max_abs_diff": 0.0, + "max_abs_ref": 0.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 2048 + }, + "p4": { + "max_abs_diff": 0.0, + "max_abs_ref": 0.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 512 + }, + "p5": { + "max_abs_diff": 0.0, + "max_abs_ref": 0.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 256 + }, + "s0": { + "max_abs_diff": 0.0, + "max_abs_ref": 0.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 32768 + }, + "s1": { + "max_abs_diff": 0.0, + "max_abs_ref": 0.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 16384 + }, + "s2": { + "max_abs_diff": 0.0, + "max_abs_ref": 0.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 8192 + }, + "s3": { + "max_abs_diff": 0.0, + "max_abs_ref": 0.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 2048 + }, + "s4": { + "max_abs_diff": 0.0, + "max_abs_ref": 0.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 1024 + }, + "u0": { + "max_abs_diff": 0.0, + "max_abs_ref": 0.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 32768 + }, + "u1": { + "max_abs_diff": 0.0, + "max_abs_ref": 0.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 16384 + }, + "u2": { + "max_abs_diff": 0.0, + "max_abs_ref": 0.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 8192 + }, + "u3": { + "max_abs_diff": 0.0, + "max_abs_ref": 0.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 2048 + }, + "u4": { + "max_abs_diff": 0.0, + "max_abs_ref": 0.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 1024 + } + }, + "vs_cpu_output": { + "max_abs_diff": 0.0, + "max_abs_ref": 0.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 16384 + }, + "vs_cpu_output_per_value": [ + { + "max_abs_diff": 0.0, + "max_abs_ref": 0.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 4096 + }, + { + "max_abs_diff": 0.0, + "max_abs_ref": 0.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 4096 + }, + { + "max_abs_diff": 0.0, + "max_abs_ref": 0.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 4096 + }, + { + "max_abs_diff": 0.0, + "max_abs_ref": 0.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 4096 + } + ] + }, + { + "case": "finite_specials_64", + "fused_equals_tierb": { + "a0": true, + "a1": true, + "a2": true, + "a3": true, + "a4": true, + "d1": true, + "d2": true, + "d3": true, + "d4": true, + "d5": true, + "out": true, + "p1": true, + "p2": true, + "p3": true, + "p4": true, + "p5": true + }, + "hip_equals_d3d12": true, + "input_pixels": [ + 64, + 64 + ], + "launches": 11, + "negative_controls": { + "fg_mconv2": { + "caught": true, + "differ": 40815, + "step": 0 + }, + "fg_mconv4": { + "caught": true, + "differ": 1267, + "step": 4 + }, + "fg_mpair_d0": { + "caught": true, + "differ": 16181, + "step": 10 + } + }, + "ok": true, + "path": "fused", + "vs_cpu_buffers": { + "a0": { + "max_abs_diff": 0.5, + "max_abs_ref": 14512.0, + "nonfinite_mismatch": 0, + "over_1_step": 4, + "over_4_steps": 1, + "rel": 3.44542447629548e-05, + "steps_max": 8, + "values": 32768 + }, + "a1": { + "max_abs_diff": 0.03125, + "max_abs_ref": 14992.0, + "nonfinite_mismatch": 0, + "over_1_step": 5, + "over_4_steps": 1, + "rel": 2.084445037353255e-06, + "steps_max": 10, + "values": 16384 + }, + "a2": { + "max_abs_diff": 4.0, + "max_abs_ref": 8160.0, + "nonfinite_mismatch": 0, + "over_1_step": 10, + "over_4_steps": 3, + "rel": 0.0004901960784313725, + "steps_max": 8, + "values": 8192 + }, + "a3": { + "max_abs_diff": 2.0, + "max_abs_ref": 5880.0, + "nonfinite_mismatch": 0, + "over_1_step": 88, + "over_4_steps": 25, + "rel": 0.0003401360544217687, + "steps_max": 655, + "values": 2048 + }, + "a4": { + "max_abs_diff": 2.0, + "max_abs_ref": 3530.0, + "nonfinite_mismatch": 0, + "over_1_step": 284, + "over_4_steps": 80, + "rel": 0.0005665722379603399, + "steps_max": 369, + "values": 1024 + }, + "d1": { + "max_abs_diff": 4.0, + "max_abs_ref": 5480.0, + "nonfinite_mismatch": 0, + "over_1_step": 3170, + "over_4_steps": 1188, + "rel": 0.00072992700729927, + "steps_max": 19781, + "values": 8192 + }, + "d2": { + "max_abs_diff": 4.0, + "max_abs_ref": 3238.0, + "nonfinite_mismatch": 0, + "over_1_step": 1428, + "over_4_steps": 466, + "rel": 0.0012353304508956147, + "steps_max": 2852, + "values": 4096 + }, + "d3": { + "max_abs_diff": 3.0, + "max_abs_ref": 2630.0, + "nonfinite_mismatch": 0, + "over_1_step": 883, + "over_4_steps": 330, + "rel": 0.0011406844106463879, + "steps_max": 2767, + "values": 2048 + }, + "d4": { + "max_abs_diff": 3.0, + "max_abs_ref": 1673.0, + "nonfinite_mismatch": 0, + "over_1_step": 300, + "over_4_steps": 138, + "rel": 0.0017931858936043037, + "steps_max": 573, + "values": 512 + }, + "d5": { + "max_abs_diff": 3.0, + "max_abs_ref": 2024.0, + "nonfinite_mismatch": 0, + "over_1_step": 151, + "over_4_steps": 53, + "rel": 0.0014822134387351778, + "steps_max": 1209, + "values": 256 + }, + "out": { + "max_abs_diff": 4.375, + "max_abs_ref": 6672.0, + "nonfinite_mismatch": 0, + "over_1_step": 5079, + "over_4_steps": 1753, + "rel": 0.0006557254196642686, + "steps_max": 27578, + "values": 16384 + }, + "p1": { + "max_abs_diff": 0.00048828125, + "max_abs_ref": 14512.0, + "nonfinite_mismatch": 0, + "over_1_step": 2, + "over_4_steps": 1, + "rel": 3.3646723401323044e-08, + "steps_max": 8, + "values": 8192 + }, + "p2": { + "max_abs_diff": 0.03125, + "max_abs_ref": 14992.0, + "nonfinite_mismatch": 0, + "over_1_step": 2, + "over_4_steps": 0, + "rel": 2.084445037353255e-06, + "steps_max": 3, + "values": 4096 + }, + "p3": { + "max_abs_diff": 4.0, + "max_abs_ref": 8160.0, + "nonfinite_mismatch": 0, + "over_1_step": 4, + "over_4_steps": 1, + "rel": 0.0004901960784313725, + "steps_max": 6, + "values": 2048 + }, + "p4": { + "max_abs_diff": 2.0, + "max_abs_ref": 5880.0, + "nonfinite_mismatch": 0, + "over_1_step": 24, + "over_4_steps": 7, + "rel": 0.0003401360544217687, + "steps_max": 128, + "values": 512 + }, + "p5": { + "max_abs_diff": 2.0, + "max_abs_ref": 3530.0, + "nonfinite_mismatch": 0, + "over_1_step": 58, + "over_4_steps": 12, + "rel": 0.0005665722379603399, + "steps_max": 23, + "values": 256 + } + }, + "vs_cpu_output": { + "max_abs_diff": 4.375, + "max_abs_ref": 6672.0, + "nonfinite_mismatch": 0, + "over_1_step": 5079, + "over_4_steps": 1753, + "rel": 0.0006557254196642686, + "steps_max": 27578, + "values": 16384 + }, + "vs_cpu_output_per_value": [ + { + "max_abs_diff": 4.0, + "max_abs_ref": 6672.0, + "nonfinite_mismatch": 0, + "over_1_step": 972, + "over_4_steps": 253, + "rel": 0.0005995203836930455, + "steps_max": 431, + "values": 4096 + }, + { + "max_abs_diff": 4.375, + "max_abs_ref": 5636.0, + "nonfinite_mismatch": 0, + "over_1_step": 1536, + "over_4_steps": 591, + "rel": 0.0007762597586941093, + "steps_max": 27578, + "values": 4096 + }, + { + "max_abs_diff": 4.0, + "max_abs_ref": 5500.0, + "nonfinite_mismatch": 0, + "over_1_step": 1367, + "over_4_steps": 558, + "rel": 0.0007272727272727272, + "steps_max": 26282, + "values": 4096 + }, + { + "max_abs_diff": 4.0, + "max_abs_ref": 5820.0, + "nonfinite_mismatch": 0, + "over_1_step": 1204, + "over_4_steps": 351, + "rel": 0.0006872852233676976, + "steps_max": 24864, + "values": 4096 + } + ] + }, + { + "case": "finite_specials_64", + "fused_equals_tierb": null, + "hip_equals_d3d12": true, + "input_pixels": [ + 64, + 64 + ], + "launches": 27, + "negative_controls": { + "fg_add_f16": { + "caught": true, + "differ": 1015, + "step": 8 + }, + "fg_mconv1": { + "caught": true, + "differ": 16181, + "step": 26 + }, + "fg_mconv2": { + "caught": true, + "differ": 40815, + "step": 0 + }, + "fg_mconv4": { + "caught": true, + "differ": 1267, + "step": 4 + }, + "fg_upscale_hwc_f16": { + "caught": true, + "differ": 1012, + "step": 7 + } + }, + "ok": true, + "path": "tierb", + "vs_cpu_buffers": { + "a0": { + "max_abs_diff": 0.5, + "max_abs_ref": 14512.0, + "nonfinite_mismatch": 0, + "over_1_step": 4, + "over_4_steps": 1, + "rel": 3.44542447629548e-05, + "steps_max": 8, + "values": 32768 + }, + "a1": { + "max_abs_diff": 0.03125, + "max_abs_ref": 14992.0, + "nonfinite_mismatch": 0, + "over_1_step": 5, + "over_4_steps": 1, + "rel": 2.084445037353255e-06, + "steps_max": 10, + "values": 16384 + }, + "a2": { + "max_abs_diff": 4.0, + "max_abs_ref": 8160.0, + "nonfinite_mismatch": 0, + "over_1_step": 10, + "over_4_steps": 3, + "rel": 0.0004901960784313725, + "steps_max": 8, + "values": 8192 + }, + "a3": { + "max_abs_diff": 2.0, + "max_abs_ref": 5880.0, + "nonfinite_mismatch": 0, + "over_1_step": 88, + "over_4_steps": 25, + "rel": 0.0003401360544217687, + "steps_max": 655, + "values": 2048 + }, + "a4": { + "max_abs_diff": 2.0, + "max_abs_ref": 3530.0, + "nonfinite_mismatch": 0, + "over_1_step": 284, + "over_4_steps": 80, + "rel": 0.0005665722379603399, + "steps_max": 369, + "values": 1024 + }, + "b5": { + "max_abs_diff": 3.0, + "max_abs_ref": 2992.0, + "nonfinite_mismatch": 0, + "over_1_step": 223, + "over_4_steps": 71, + "rel": 0.001002673796791444, + "steps_max": 287, + "values": 512 + }, + "d1": { + "max_abs_diff": 4.0, + "max_abs_ref": 5480.0, + "nonfinite_mismatch": 0, + "over_1_step": 3170, + "over_4_steps": 1188, + "rel": 0.00072992700729927, + "steps_max": 19781, + "values": 8192 + }, + "d2": { + "max_abs_diff": 4.0, + "max_abs_ref": 3238.0, + "nonfinite_mismatch": 0, + "over_1_step": 1428, + "over_4_steps": 466, + "rel": 0.0012353304508956147, + "steps_max": 2852, + "values": 4096 + }, + "d3": { + "max_abs_diff": 3.0, + "max_abs_ref": 2630.0, + "nonfinite_mismatch": 0, + "over_1_step": 883, + "over_4_steps": 330, + "rel": 0.0011406844106463879, + "steps_max": 2767, + "values": 2048 + }, + "d4": { + "max_abs_diff": 3.0, + "max_abs_ref": 1673.0, + "nonfinite_mismatch": 0, + "over_1_step": 300, + "over_4_steps": 138, + "rel": 0.0017931858936043037, + "steps_max": 573, + "values": 512 + }, + "d5": { + "max_abs_diff": 3.0, + "max_abs_ref": 2024.0, + "nonfinite_mismatch": 0, + "over_1_step": 151, + "over_4_steps": 53, + "rel": 0.0014822134387351778, + "steps_max": 1209, + "values": 256 + }, + "e0": { + "max_abs_diff": 8.0, + "max_abs_ref": 10424.0, + "nonfinite_mismatch": 0, + "over_1_step": 8098, + "over_4_steps": 2751, + "rel": 0.0007674597083653108, + "steps_max": 22606, + "values": 32768 + }, + "e1": { + "max_abs_diff": 6.0, + "max_abs_ref": 9624.0, + "nonfinite_mismatch": 0, + "over_1_step": 4437, + "over_4_steps": 1401, + "rel": 0.0006234413965087282, + "steps_max": 19876, + "values": 16384 + }, + "e2": { + "max_abs_diff": 4.0, + "max_abs_ref": 6676.0, + "nonfinite_mismatch": 0, + "over_1_step": 2231, + "over_4_steps": 663, + "rel": 0.0005991611743559018, + "steps_max": 24074, + "values": 8192 + }, + "e3": { + "max_abs_diff": 4.0, + "max_abs_ref": 3646.0, + "nonfinite_mismatch": 0, + "over_1_step": 735, + "over_4_steps": 249, + "rel": 0.0010970927043335162, + "steps_max": 980, + "values": 2048 + }, + "e4": { + "max_abs_diff": 4.0, + "max_abs_ref": 2804.0, + "nonfinite_mismatch": 0, + "over_1_step": 503, + "over_4_steps": 171, + "rel": 0.0014265335235378032, + "steps_max": 23282, + "values": 1024 + }, + "out": { + "max_abs_diff": 4.375, + "max_abs_ref": 6672.0, + "nonfinite_mismatch": 0, + "over_1_step": 5079, + "over_4_steps": 1753, + "rel": 0.0006557254196642686, + "steps_max": 27578, + "values": 16384 + }, + "p1": { + "max_abs_diff": 0.00048828125, + "max_abs_ref": 14512.0, + "nonfinite_mismatch": 0, + "over_1_step": 2, + "over_4_steps": 1, + "rel": 3.3646723401323044e-08, + "steps_max": 8, + "values": 8192 + }, + "p2": { + "max_abs_diff": 0.03125, + "max_abs_ref": 14992.0, + "nonfinite_mismatch": 0, + "over_1_step": 2, + "over_4_steps": 0, + "rel": 2.084445037353255e-06, + "steps_max": 3, + "values": 4096 + }, + "p3": { + "max_abs_diff": 4.0, + "max_abs_ref": 8160.0, + "nonfinite_mismatch": 0, + "over_1_step": 4, + "over_4_steps": 1, + "rel": 0.0004901960784313725, + "steps_max": 6, + "values": 2048 + }, + "p4": { + "max_abs_diff": 2.0, + "max_abs_ref": 5880.0, + "nonfinite_mismatch": 0, + "over_1_step": 24, + "over_4_steps": 7, + "rel": 0.0003401360544217687, + "steps_max": 128, + "values": 512 + }, + "p5": { + "max_abs_diff": 2.0, + "max_abs_ref": 3530.0, + "nonfinite_mismatch": 0, + "over_1_step": 58, + "over_4_steps": 12, + "rel": 0.0005665722379603399, + "steps_max": 23, + "values": 256 + }, + "s0": { + "max_abs_diff": 8.0, + "max_abs_ref": 14480.0, + "nonfinite_mismatch": 0, + "over_1_step": 8018, + "over_4_steps": 2764, + "rel": 0.0005524861878453039, + "steps_max": 21845, + "values": 32768 + }, + "s1": { + "max_abs_diff": 8.0, + "max_abs_ref": 15120.0, + "nonfinite_mismatch": 0, + "over_1_step": 2836, + "over_4_steps": 868, + "rel": 0.0005291005291005291, + "steps_max": 25088, + "values": 16384 + }, + "s2": { + "max_abs_diff": 8.0, + "max_abs_ref": 8904.0, + "nonfinite_mismatch": 0, + "over_1_step": 1435, + "over_4_steps": 462, + "rel": 0.0008984725965858042, + "steps_max": 29116, + "values": 8192 + }, + "s3": { + "max_abs_diff": 4.0, + "max_abs_ref": 6008.0, + "nonfinite_mismatch": 0, + "over_1_step": 550, + "over_4_steps": 209, + "rel": 0.0006657789613848203, + "steps_max": 28448, + "values": 2048 + }, + "s4": { + "max_abs_diff": 4.0, + "max_abs_ref": 4820.0, + "nonfinite_mismatch": 0, + "over_1_step": 368, + "over_4_steps": 93, + "rel": 0.0008298755186721991, + "steps_max": 54, + "values": 1024 + }, + "u0": { + "max_abs_diff": 4.0, + "max_abs_ref": 4812.0, + "nonfinite_mismatch": 0, + "over_1_step": 11535, + "over_4_steps": 3676, + "rel": 0.0008312551953449709, + "steps_max": 25216, + "values": 32768 + }, + "u1": { + "max_abs_diff": 4.0, + "max_abs_ref": 3088.0, + "nonfinite_mismatch": 0, + "over_1_step": 5006, + "over_4_steps": 1451, + "rel": 0.0012953367875647669, + "steps_max": 24963, + "values": 16384 + }, + "u2": { + "max_abs_diff": 2.75, + "max_abs_ref": 2456.0, + "nonfinite_mismatch": 0, + "over_1_step": 3194, + "over_4_steps": 964, + "rel": 0.0011197068403908795, + "steps_max": 25706, + "values": 8192 + }, + "u3": { + "max_abs_diff": 3.0, + "max_abs_ref": 1673.0, + "nonfinite_mismatch": 0, + "over_1_step": 1159, + "over_4_steps": 456, + "rel": 0.0017931858936043037, + "steps_max": 6918, + "values": 2048 + }, + "u4": { + "max_abs_diff": 3.0, + "max_abs_ref": 2024.0, + "nonfinite_mismatch": 0, + "over_1_step": 604, + "over_4_steps": 212, + "rel": 0.0014822134387351778, + "steps_max": 1209, + "values": 1024 + } + }, + "vs_cpu_output": { + "max_abs_diff": 4.375, + "max_abs_ref": 6672.0, + "nonfinite_mismatch": 0, + "over_1_step": 5079, + "over_4_steps": 1753, + "rel": 0.0006557254196642686, + "steps_max": 27578, + "values": 16384 + }, + "vs_cpu_output_per_value": [ + { + "max_abs_diff": 4.0, + "max_abs_ref": 6672.0, + "nonfinite_mismatch": 0, + "over_1_step": 972, + "over_4_steps": 253, + "rel": 0.0005995203836930455, + "steps_max": 431, + "values": 4096 + }, + { + "max_abs_diff": 4.375, + "max_abs_ref": 5636.0, + "nonfinite_mismatch": 0, + "over_1_step": 1536, + "over_4_steps": 591, + "rel": 0.0007762597586941093, + "steps_max": 27578, + "values": 4096 + }, + { + "max_abs_diff": 4.0, + "max_abs_ref": 5500.0, + "nonfinite_mismatch": 0, + "over_1_step": 1367, + "over_4_steps": 558, + "rel": 0.0007272727272727272, + "steps_max": 26282, + "values": 4096 + }, + { + "max_abs_diff": 4.0, + "max_abs_ref": 5820.0, + "nonfinite_mismatch": 0, + "over_1_step": 1204, + "over_4_steps": 351, + "rel": 0.0006872852233676976, + "steps_max": 24864, + "values": 4096 + } + ] + }, + { + "case": "finite_specials_64", + "fused_equals_tierb": null, + "hip_equals_d3d12": true, + "input_pixels": [ + 64, + 64 + ], + "launches": 32, + "negative_controls": { + "fg_add_f16": { + "caught": true, + "differ": 1013, + "step": 13 + }, + "fg_conv_f16": { + "caught": true, + "differ": 32651, + "step": 0 + }, + "fg_maxpool2_f16": { + "caught": true, + "differ": 8167, + "step": 1 + }, + "fg_upscale_f16": { + "caught": true, + "differ": 996, + "step": 12 + } + }, + "ok": true, + "path": "exact", + "vs_cpu_buffers": { + "a0": { + "max_abs_diff": 0.0, + "max_abs_ref": 14512.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 32768 + }, + "a1": { + "max_abs_diff": 0.0, + "max_abs_ref": 14992.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 16384 + }, + "a2": { + "max_abs_diff": 0.0, + "max_abs_ref": 8160.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 8192 + }, + "a3": { + "max_abs_diff": 0.0, + "max_abs_ref": 5880.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 2048 + }, + "a4": { + "max_abs_diff": 0.0, + "max_abs_ref": 3530.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 1024 + }, + "b5": { + "max_abs_diff": 0.0, + "max_abs_ref": 2992.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 512 + }, + "d1": { + "max_abs_diff": 0.0, + "max_abs_ref": 5480.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 8192 + }, + "d2": { + "max_abs_diff": 0.0, + "max_abs_ref": 3238.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 4096 + }, + "d3": { + "max_abs_diff": 0.0, + "max_abs_ref": 2630.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 2048 + }, + "d4": { + "max_abs_diff": 0.0, + "max_abs_ref": 1673.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 512 + }, + "d5": { + "max_abs_diff": 0.0, + "max_abs_ref": 2024.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 256 + }, + "e0": { + "max_abs_diff": 0.0, + "max_abs_ref": 10424.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 32768 + }, + "e1": { + "max_abs_diff": 0.0, + "max_abs_ref": 9624.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 16384 + }, + "e2": { + "max_abs_diff": 0.0, + "max_abs_ref": 6676.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 8192 + }, + "e3": { + "max_abs_diff": 0.0, + "max_abs_ref": 3646.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 2048 + }, + "e4": { + "max_abs_diff": 0.0, + "max_abs_ref": 2804.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 1024 + }, + "out": { + "max_abs_diff": 0.0, + "max_abs_ref": 6672.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 16384 + }, + "p1": { + "max_abs_diff": 0.0, + "max_abs_ref": 14512.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 8192 + }, + "p2": { + "max_abs_diff": 0.0, + "max_abs_ref": 14992.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 4096 + }, + "p3": { + "max_abs_diff": 0.0, + "max_abs_ref": 8160.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 2048 + }, + "p4": { + "max_abs_diff": 0.0, + "max_abs_ref": 5880.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 512 + }, + "p5": { + "max_abs_diff": 0.0, + "max_abs_ref": 3530.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 256 + }, + "s0": { + "max_abs_diff": 0.0, + "max_abs_ref": 14480.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 32768 + }, + "s1": { + "max_abs_diff": 0.0, + "max_abs_ref": 15120.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 16384 + }, + "s2": { + "max_abs_diff": 0.0, + "max_abs_ref": 8904.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 8192 + }, + "s3": { + "max_abs_diff": 0.0, + "max_abs_ref": 6008.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 2048 + }, + "s4": { + "max_abs_diff": 0.0, + "max_abs_ref": 4820.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 1024 + }, + "u0": { + "max_abs_diff": 0.0, + "max_abs_ref": 4812.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 32768 + }, + "u1": { + "max_abs_diff": 0.0, + "max_abs_ref": 3088.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 16384 + }, + "u2": { + "max_abs_diff": 0.0, + "max_abs_ref": 2456.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 8192 + }, + "u3": { + "max_abs_diff": 0.0, + "max_abs_ref": 1673.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 2048 + }, + "u4": { + "max_abs_diff": 0.0, + "max_abs_ref": 2024.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 1024 + } + }, + "vs_cpu_output": { + "max_abs_diff": 0.0, + "max_abs_ref": 6672.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 16384 + }, + "vs_cpu_output_per_value": [ + { + "max_abs_diff": 0.0, + "max_abs_ref": 6672.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 4096 + }, + { + "max_abs_diff": 0.0, + "max_abs_ref": 5636.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 4096 + }, + { + "max_abs_diff": 0.0, + "max_abs_ref": 5500.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 4096 + }, + { + "max_abs_diff": 0.0, + "max_abs_ref": 5820.0, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 4096 + } + ] + }, + { + "case": "converter_model_fixed_input", + "fused_equals_tierb": { + "a0": true, + "a1": true, + "a2": true, + "a3": true, + "a4": true, + "d1": true, + "d2": true, + "d3": true, + "d4": true, + "d5": true, + "out": true, + "p1": true, + "p2": true, + "p3": true, + "p4": true, + "p5": true + }, + "hip_equals_d3d12": true, + "input_pixels": [ + 64, + 64 + ], + "launches": 11, + "negative_controls": { + "fg_mconv2": { + "caught": true, + "differ": 40876, + "step": 0 + }, + "fg_mconv4": { + "caught": true, + "differ": 1275, + "step": 4 + }, + "fg_mpair_d0": { + "caught": true, + "differ": 16345, + "step": 10 + } + }, + "ok": true, + "path": "fused", + "vs_cpu_buffers": { + "a0": { + "max_abs_diff": 0.0009765625, + "max_abs_ref": 3.92578125, + "nonfinite_mismatch": 0, + "over_1_step": 15, + "over_4_steps": 5, + "rel": 0.0002487562189054726, + "steps_max": 20, + "values": 32768 + }, + "a1": { + "max_abs_diff": 0.0010986328125, + "max_abs_ref": 4.9375, + "nonfinite_mismatch": 0, + "over_1_step": 44, + "over_4_steps": 14, + "rel": 0.00022250791139240506, + "steps_max": 27, + "values": 16384 + }, + "a2": { + "max_abs_diff": 0.0009765625, + "max_abs_ref": 2.728515625, + "nonfinite_mismatch": 0, + "over_1_step": 156, + "over_4_steps": 42, + "rel": 0.00035790980672870435, + "steps_max": 180, + "values": 8192 + }, + "a3": { + "max_abs_diff": 0.0009765625, + "max_abs_ref": 2.388671875, + "nonfinite_mismatch": 0, + "over_1_step": 186, + "over_4_steps": 49, + "rel": 0.0004088307440719542, + "steps_max": 253, + "values": 2048 + }, + "a4": { + "max_abs_diff": 0.001220703125, + "max_abs_ref": 2.91015625, + "nonfinite_mismatch": 0, + "over_1_step": 233, + "over_4_steps": 76, + "rel": 0.00041946308724832214, + "steps_max": 147, + "values": 1024 + }, + "d1": { + "max_abs_diff": 0.0087890625, + "max_abs_ref": 6.140625, + "nonfinite_mismatch": 0, + "over_1_step": 3897, + "over_4_steps": 1498, + "rel": 0.0014312977099236641, + "steps_max": 4837, + "values": 8192 + }, + "d2": { + "max_abs_diff": 0.00341796875, + "max_abs_ref": 2.775390625, + "nonfinite_mismatch": 0, + "over_1_step": 1937, + "over_4_steps": 739, + "rel": 0.0012315270935960591, + "steps_max": 1182, + "values": 4096 + }, + "d3": { + "max_abs_diff": 0.0029296875, + "max_abs_ref": 3.029296875, + "nonfinite_mismatch": 0, + "over_1_step": 1009, + "over_4_steps": 380, + "rel": 0.0009671179883945841, + "steps_max": 3270, + "values": 2048 + }, + "d4": { + "max_abs_diff": 0.00244140625, + "max_abs_ref": 3.021484375, + "nonfinite_mismatch": 0, + "over_1_step": 218, + "over_4_steps": 66, + "rel": 0.0008080155138978668, + "steps_max": 3759, + "values": 512 + }, + "d5": { + "max_abs_diff": 0.001953125, + "max_abs_ref": 2.03515625, + "nonfinite_mismatch": 0, + "over_1_step": 55, + "over_4_steps": 9, + "rel": 0.0009596928982725527, + "steps_max": 26, + "values": 256 + }, + "out": { + "max_abs_diff": 0.0703125, + "max_abs_ref": 29.265625, + "nonfinite_mismatch": 0, + "over_1_step": 7410, + "over_4_steps": 2881, + "rel": 0.002402562733582488, + "steps_max": 14732, + "values": 16384 + }, + "p1": { + "max_abs_diff": 0.0009765625, + "max_abs_ref": 3.92578125, + "nonfinite_mismatch": 0, + "over_1_step": 2, + "over_4_steps": 0, + "rel": 0.0002487562189054726, + "steps_max": 2, + "values": 8192 + }, + "p2": { + "max_abs_diff": 0.0009765625, + "max_abs_ref": 4.9375, + "nonfinite_mismatch": 0, + "over_1_step": 10, + "over_4_steps": 4, + "rel": 0.00019778481012658228, + "steps_max": 24, + "values": 4096 + }, + "p3": { + "max_abs_diff": 0.0009765625, + "max_abs_ref": 2.728515625, + "nonfinite_mismatch": 0, + "over_1_step": 44, + "over_4_steps": 11, + "rel": 0.00035790980672870435, + "steps_max": 180, + "values": 2048 + }, + "p4": { + "max_abs_diff": 0.0009765625, + "max_abs_ref": 2.388671875, + "nonfinite_mismatch": 0, + "over_1_step": 46, + "over_4_steps": 11, + "rel": 0.0004088307440719542, + "steps_max": 72, + "values": 512 + }, + "p5": { + "max_abs_diff": 0.0009765625, + "max_abs_ref": 2.91015625, + "nonfinite_mismatch": 0, + "over_1_step": 57, + "over_4_steps": 20, + "rel": 0.0003355704697986577, + "steps_max": 147, + "values": 256 + } + }, + "vs_cpu_output": { + "max_abs_diff": 0.0703125, + "max_abs_ref": 29.265625, + "nonfinite_mismatch": 0, + "over_1_step": 7410, + "over_4_steps": 2881, + "rel": 0.002402562733582488, + "steps_max": 14732, + "values": 16384 + }, + "vs_cpu_output_per_value": [ + { + "max_abs_diff": 0.0546875, + "max_abs_ref": 24.9375, + "nonfinite_mismatch": 0, + "over_1_step": 2257, + "over_4_steps": 849, + "rel": 0.0021929824561403508, + "steps_max": 2705, + "values": 4096 + }, + { + "max_abs_diff": 0.0546875, + "max_abs_ref": 25.15625, + "nonfinite_mismatch": 0, + "over_1_step": 2522, + "over_4_steps": 1110, + "rel": 0.002173913043478261, + "steps_max": 14732, + "values": 4096 + }, + { + "max_abs_diff": 0.0703125, + "max_abs_ref": 29.265625, + "nonfinite_mismatch": 0, + "over_1_step": 748, + "over_4_steps": 42, + "rel": 0.002402562733582488, + "steps_max": 9, + "values": 4096 + }, + { + "max_abs_diff": 0.0625, + "max_abs_ref": 16.1875, + "nonfinite_mismatch": 0, + "over_1_step": 1883, + "over_4_steps": 880, + "rel": 0.003861003861003861, + "steps_max": 13427, + "values": 4096 + } + ] + }, + { + "case": "converter_model_fixed_input", + "fused_equals_tierb": null, + "hip_equals_d3d12": true, + "input_pixels": [ + 64, + 64 + ], + "launches": 27, + "negative_controls": { + "fg_add_f16": { + "caught": true, + "differ": 1024, + "step": 8 + }, + "fg_mconv1": { + "caught": true, + "differ": 16345, + "step": 26 + }, + "fg_mconv2": { + "caught": true, + "differ": 40876, + "step": 0 + }, + "fg_mconv4": { + "caught": true, + "differ": 1275, + "step": 4 + }, + "fg_upscale_hwc_f16": { + "caught": true, + "differ": 1022, + "step": 7 + } + }, + "ok": true, + "path": "tierb", + "vs_cpu_buffers": { + "a0": { + "max_abs_diff": 0.0009765625, + "max_abs_ref": 3.92578125, + "nonfinite_mismatch": 0, + "over_1_step": 15, + "over_4_steps": 5, + "rel": 0.0002487562189054726, + "steps_max": 20, + "values": 32768 + }, + "a1": { + "max_abs_diff": 0.0010986328125, + "max_abs_ref": 4.9375, + "nonfinite_mismatch": 0, + "over_1_step": 44, + "over_4_steps": 14, + "rel": 0.00022250791139240506, + "steps_max": 27, + "values": 16384 + }, + "a2": { + "max_abs_diff": 0.0009765625, + "max_abs_ref": 2.728515625, + "nonfinite_mismatch": 0, + "over_1_step": 156, + "over_4_steps": 42, + "rel": 0.00035790980672870435, + "steps_max": 180, + "values": 8192 + }, + "a3": { + "max_abs_diff": 0.0009765625, + "max_abs_ref": 2.388671875, + "nonfinite_mismatch": 0, + "over_1_step": 186, + "over_4_steps": 49, + "rel": 0.0004088307440719542, + "steps_max": 253, + "values": 2048 + }, + "a4": { + "max_abs_diff": 0.001220703125, + "max_abs_ref": 2.91015625, + "nonfinite_mismatch": 0, + "over_1_step": 233, + "over_4_steps": 76, + "rel": 0.00041946308724832214, + "steps_max": 147, + "values": 1024 + }, + "b5": { + "max_abs_diff": 0.00146484375, + "max_abs_ref": 1.8369140625, + "nonfinite_mismatch": 0, + "over_1_step": 127, + "over_4_steps": 39, + "rel": 0.0007974481658692185, + "steps_max": 286, + "values": 512 + }, + "d1": { + "max_abs_diff": 0.0087890625, + "max_abs_ref": 6.140625, + "nonfinite_mismatch": 0, + "over_1_step": 3897, + "over_4_steps": 1498, + "rel": 0.0014312977099236641, + "steps_max": 4837, + "values": 8192 + }, + "d2": { + "max_abs_diff": 0.00341796875, + "max_abs_ref": 2.775390625, + "nonfinite_mismatch": 0, + "over_1_step": 1937, + "over_4_steps": 739, + "rel": 0.0012315270935960591, + "steps_max": 1182, + "values": 4096 + }, + "d3": { + "max_abs_diff": 0.0029296875, + "max_abs_ref": 3.029296875, + "nonfinite_mismatch": 0, + "over_1_step": 1009, + "over_4_steps": 380, + "rel": 0.0009671179883945841, + "steps_max": 3270, + "values": 2048 + }, + "d4": { + "max_abs_diff": 0.00244140625, + "max_abs_ref": 3.021484375, + "nonfinite_mismatch": 0, + "over_1_step": 218, + "over_4_steps": 66, + "rel": 0.0008080155138978668, + "steps_max": 3759, + "values": 512 + }, + "d5": { + "max_abs_diff": 0.001953125, + "max_abs_ref": 2.03515625, + "nonfinite_mismatch": 0, + "over_1_step": 55, + "over_4_steps": 9, + "rel": 0.0009596928982725527, + "steps_max": 26, + "values": 256 + }, + "e0": { + "max_abs_diff": 0.013671875, + "max_abs_ref": 6.45703125, + "nonfinite_mismatch": 0, + "over_1_step": 13915, + "over_4_steps": 5219, + "rel": 0.002117362371445856, + "steps_max": 6574, + "values": 32768 + }, + "e1": { + "max_abs_diff": 0.00445556640625, + "max_abs_ref": 3.458984375, + "nonfinite_mismatch": 0, + "over_1_step": 8507, + "over_4_steps": 3687, + "rel": 0.0012881140598531903, + "steps_max": 4715, + "values": 16384 + }, + "e2": { + "max_abs_diff": 0.0029296875, + "max_abs_ref": 1.8232421875, + "nonfinite_mismatch": 0, + "over_1_step": 3605, + "over_4_steps": 1188, + "rel": 0.0016068559185859668, + "steps_max": 4436, + "values": 8192 + }, + "e3": { + "max_abs_diff": 0.0029296875, + "max_abs_ref": 2.431640625, + "nonfinite_mismatch": 0, + "over_1_step": 817, + "over_4_steps": 265, + "rel": 0.0012048192771084338, + "steps_max": 2177, + "values": 2048 + }, + "e4": { + "max_abs_diff": 0.00390625, + "max_abs_ref": 2.802734375, + "nonfinite_mismatch": 0, + "over_1_step": 357, + "over_4_steps": 102, + "rel": 0.0013937282229965157, + "steps_max": 470, + "values": 1024 + }, + "out": { + "max_abs_diff": 0.0703125, + "max_abs_ref": 29.265625, + "nonfinite_mismatch": 0, + "over_1_step": 7410, + "over_4_steps": 2881, + "rel": 0.002402562733582488, + "steps_max": 14732, + "values": 16384 + }, + "p1": { + "max_abs_diff": 0.0009765625, + "max_abs_ref": 3.92578125, + "nonfinite_mismatch": 0, + "over_1_step": 2, + "over_4_steps": 0, + "rel": 0.0002487562189054726, + "steps_max": 2, + "values": 8192 + }, + "p2": { + "max_abs_diff": 0.0009765625, + "max_abs_ref": 4.9375, + "nonfinite_mismatch": 0, + "over_1_step": 10, + "over_4_steps": 4, + "rel": 0.00019778481012658228, + "steps_max": 24, + "values": 4096 + }, + "p3": { + "max_abs_diff": 0.0009765625, + "max_abs_ref": 2.728515625, + "nonfinite_mismatch": 0, + "over_1_step": 44, + "over_4_steps": 11, + "rel": 0.00035790980672870435, + "steps_max": 180, + "values": 2048 + }, + "p4": { + "max_abs_diff": 0.0009765625, + "max_abs_ref": 2.388671875, + "nonfinite_mismatch": 0, + "over_1_step": 46, + "over_4_steps": 11, + "rel": 0.0004088307440719542, + "steps_max": 72, + "values": 512 + }, + "p5": { + "max_abs_diff": 0.0009765625, + "max_abs_ref": 2.91015625, + "nonfinite_mismatch": 0, + "over_1_step": 57, + "over_4_steps": 20, + "rel": 0.0003355704697986577, + "steps_max": 147, + "values": 256 + }, + "s0": { + "max_abs_diff": 0.009765625, + "max_abs_ref": 7.27734375, + "nonfinite_mismatch": 0, + "over_1_step": 9033, + "over_4_steps": 2364, + "rel": 0.0013419216317767043, + "steps_max": 4112, + "values": 32768 + }, + "s1": { + "max_abs_diff": 0.00390625, + "max_abs_ref": 4.93359375, + "nonfinite_mismatch": 0, + "over_1_step": 4576, + "over_4_steps": 1348, + "rel": 0.000791765637371338, + "steps_max": 3264, + "values": 16384 + }, + "s2": { + "max_abs_diff": 0.002685546875, + "max_abs_ref": 2.724609375, + "nonfinite_mismatch": 0, + "over_1_step": 2441, + "over_4_steps": 706, + "rel": 0.000985663082437276, + "steps_max": 1296, + "values": 8192 + }, + "s3": { + "max_abs_diff": 0.0029296875, + "max_abs_ref": 3.126953125, + "nonfinite_mismatch": 0, + "over_1_step": 512, + "over_4_steps": 152, + "rel": 0.0009369144284821987, + "steps_max": 640, + "values": 2048 + }, + "s4": { + "max_abs_diff": 0.001953125, + "max_abs_ref": 3.333984375, + "nonfinite_mismatch": 0, + "over_1_step": 205, + "over_4_steps": 55, + "rel": 0.0005858230814294083, + "steps_max": 216, + "values": 1024 + }, + "u0": { + "max_abs_diff": 0.009765625, + "max_abs_ref": 5.99609375, + "nonfinite_mismatch": 0, + "over_1_step": 14465, + "over_4_steps": 4571, + "rel": 0.0016286644951140066, + "steps_max": 6924, + "values": 32768 + }, + "u1": { + "max_abs_diff": 0.00390625, + "max_abs_ref": 2.775390625, + "nonfinite_mismatch": 0, + "over_1_step": 6830, + "over_4_steps": 2241, + "rel": 0.0014074595355383533, + "steps_max": 6777, + "values": 16384 + }, + "u2": { + "max_abs_diff": 0.002685546875, + "max_abs_ref": 2.662109375, + "nonfinite_mismatch": 0, + "over_1_step": 3611, + "over_4_steps": 1144, + "rel": 0.0010088041085840058, + "steps_max": 1744, + "values": 8192 + }, + "u3": { + "max_abs_diff": 0.0029296875, + "max_abs_ref": 3.021484375, + "nonfinite_mismatch": 0, + "over_1_step": 762, + "over_4_steps": 216, + "rel": 0.0009696186166774402, + "steps_max": 3759, + "values": 2048 + }, + "u4": { + "max_abs_diff": 0.001953125, + "max_abs_ref": 2.03515625, + "nonfinite_mismatch": 0, + "over_1_step": 220, + "over_4_steps": 36, + "rel": 0.0009596928982725527, + "steps_max": 26, + "values": 1024 + } + }, + "vs_cpu_output": { + "max_abs_diff": 0.0703125, + "max_abs_ref": 29.265625, + "nonfinite_mismatch": 0, + "over_1_step": 7410, + "over_4_steps": 2881, + "rel": 0.002402562733582488, + "steps_max": 14732, + "values": 16384 + }, + "vs_cpu_output_per_value": [ + { + "max_abs_diff": 0.0546875, + "max_abs_ref": 24.9375, + "nonfinite_mismatch": 0, + "over_1_step": 2257, + "over_4_steps": 849, + "rel": 0.0021929824561403508, + "steps_max": 2705, + "values": 4096 + }, + { + "max_abs_diff": 0.0546875, + "max_abs_ref": 25.15625, + "nonfinite_mismatch": 0, + "over_1_step": 2522, + "over_4_steps": 1110, + "rel": 0.002173913043478261, + "steps_max": 14732, + "values": 4096 + }, + { + "max_abs_diff": 0.0703125, + "max_abs_ref": 29.265625, + "nonfinite_mismatch": 0, + "over_1_step": 748, + "over_4_steps": 42, + "rel": 0.002402562733582488, + "steps_max": 9, + "values": 4096 + }, + { + "max_abs_diff": 0.0625, + "max_abs_ref": 16.1875, + "nonfinite_mismatch": 0, + "over_1_step": 1883, + "over_4_steps": 880, + "rel": 0.003861003861003861, + "steps_max": 13427, + "values": 4096 + } + ] + }, + { + "case": "converter_model_fixed_input", + "fused_equals_tierb": null, + "hip_equals_d3d12": true, + "input_pixels": [ + 64, + 64 + ], + "launches": 32, + "negative_controls": { + "fg_add_f16": { + "caught": true, + "differ": 1024, + "step": 13 + }, + "fg_conv_f16": { + "caught": true, + "differ": 32696, + "step": 0 + }, + "fg_maxpool2_f16": { + "caught": true, + "differ": 8172, + "step": 1 + }, + "fg_upscale_f16": { + "caught": true, + "differ": 1016, + "step": 12 + } + }, + "ok": true, + "path": "exact", + "vs_cpu_buffers": { + "a0": { + "max_abs_diff": 0.0, + "max_abs_ref": 3.92578125, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 32768 + }, + "a1": { + "max_abs_diff": 0.0, + "max_abs_ref": 4.9375, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 16384 + }, + "a2": { + "max_abs_diff": 0.0, + "max_abs_ref": 2.728515625, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 8192 + }, + "a3": { + "max_abs_diff": 0.0, + "max_abs_ref": 2.388671875, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 2048 + }, + "a4": { + "max_abs_diff": 0.0, + "max_abs_ref": 2.91015625, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 1024 + }, + "b5": { + "max_abs_diff": 0.0, + "max_abs_ref": 1.8369140625, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 512 + }, + "d1": { + "max_abs_diff": 0.0, + "max_abs_ref": 6.140625, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 8192 + }, + "d2": { + "max_abs_diff": 0.0, + "max_abs_ref": 2.775390625, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 4096 + }, + "d3": { + "max_abs_diff": 0.0, + "max_abs_ref": 3.029296875, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 2048 + }, + "d4": { + "max_abs_diff": 0.0, + "max_abs_ref": 3.021484375, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 512 + }, + "d5": { + "max_abs_diff": 0.0, + "max_abs_ref": 2.03515625, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 256 + }, + "e0": { + "max_abs_diff": 0.0, + "max_abs_ref": 6.45703125, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 32768 + }, + "e1": { + "max_abs_diff": 0.0, + "max_abs_ref": 3.458984375, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 16384 + }, + "e2": { + "max_abs_diff": 0.0, + "max_abs_ref": 1.8232421875, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 8192 + }, + "e3": { + "max_abs_diff": 0.0, + "max_abs_ref": 2.431640625, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 2048 + }, + "e4": { + "max_abs_diff": 0.0, + "max_abs_ref": 2.802734375, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 1024 + }, + "out": { + "max_abs_diff": 0.0, + "max_abs_ref": 29.265625, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 16384 + }, + "p1": { + "max_abs_diff": 0.0, + "max_abs_ref": 3.92578125, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 8192 + }, + "p2": { + "max_abs_diff": 0.0, + "max_abs_ref": 4.9375, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 4096 + }, + "p3": { + "max_abs_diff": 0.0, + "max_abs_ref": 2.728515625, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 2048 + }, + "p4": { + "max_abs_diff": 0.0, + "max_abs_ref": 2.388671875, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 512 + }, + "p5": { + "max_abs_diff": 0.0, + "max_abs_ref": 2.91015625, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 256 + }, + "s0": { + "max_abs_diff": 0.0, + "max_abs_ref": 7.27734375, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 32768 + }, + "s1": { + "max_abs_diff": 0.0, + "max_abs_ref": 4.93359375, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 16384 + }, + "s2": { + "max_abs_diff": 0.0, + "max_abs_ref": 2.724609375, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 8192 + }, + "s3": { + "max_abs_diff": 0.0, + "max_abs_ref": 3.126953125, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 2048 + }, + "s4": { + "max_abs_diff": 0.0, + "max_abs_ref": 3.333984375, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 1024 + }, + "u0": { + "max_abs_diff": 0.0, + "max_abs_ref": 5.99609375, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 32768 + }, + "u1": { + "max_abs_diff": 0.0, + "max_abs_ref": 2.775390625, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 16384 + }, + "u2": { + "max_abs_diff": 0.0, + "max_abs_ref": 2.662109375, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 8192 + }, + "u3": { + "max_abs_diff": 0.0, + "max_abs_ref": 3.021484375, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 2048 + }, + "u4": { + "max_abs_diff": 0.0, + "max_abs_ref": 2.03515625, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 1024 + } + }, + "vs_cpu_output": { + "max_abs_diff": 0.0, + "max_abs_ref": 29.265625, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 16384 + }, + "vs_cpu_output_per_value": [ + { + "max_abs_diff": 0.0, + "max_abs_ref": 24.9375, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 4096 + }, + { + "max_abs_diff": 0.0, + "max_abs_ref": 25.15625, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 4096 + }, + { + "max_abs_diff": 0.0, + "max_abs_ref": 29.265625, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 4096 + }, + { + "max_abs_diff": 0.0, + "max_abs_ref": 16.1875, + "nonfinite_mismatch": 0, + "over_1_step": 0, + "over_4_steps": 0, + "rel": 0.0, + "steps_max": 0, + "values": 4096 + } + ] + }, + { + "case": "synthetic_768", + "fused_equals_tierb": { + "a0": true, + "a1": true, + "a2": true, + "a3": true, + "a4": true, + "d1": true, + "d2": true, + "d3": true, + "d4": true, + "d5": true, + "out": true, + "p1": true, + "p2": true, + "p3": true, + "p4": true, + "p5": true + }, + "hip_equals_d3d12": true, + "input_pixels": [ + 768, + 768 + ], + "launches": 11, + "negative_controls": { + "fg_mconv2": { + "caught": true, + "differ": 5884789, + "step": 0 + }, + "fg_mconv4": { + "caught": true, + "differ": 2942595, + "step": 1 + }, + "fg_mpair_b": { + "caught": true, + "differ": 8174, + "step": 5 + }, + "fg_mpair_d0": { + "caught": true, + "differ": 2354601, + "step": 10 + }, + "fg_mpair_d1": { + "caught": true, + "differ": 1176951, + "step": 9 + }, + "fg_mpair_d2": { + "caught": true, + "differ": 588523, + "step": 8 + }, + "fg_mpair_d3": { + "caught": true, + "differ": 294218, + "step": 7 + }, + "fg_mpair_d4": { + "caught": true, + "differ": 81753, + "step": 6 + } + }, + "ok": true, + "path": "fused", + "vs_cpu_buffers": {}, + "vs_cpu_output": null, + "vs_cpu_output_per_value": null + }, + { + "case": "synthetic_768", + "fused_equals_tierb": null, + "hip_equals_d3d12": true, + "input_pixels": [ + 768, + 768 + ], + "launches": 27, + "negative_controls": { + "fg_add_f16": { + "caught": true, + "differ": 147145, + "step": 8 + }, + "fg_mconv1": { + "caught": true, + "differ": 2354601, + "step": 26 + }, + "fg_mconv2": { + "caught": true, + "differ": 5884789, + "step": 0 + }, + "fg_mconv4": { + "caught": true, + "differ": 2942595, + "step": 1 + }, + "fg_upscale_hwc_f16": { + "caught": true, + "differ": 147096, + "step": 7 + } + }, + "ok": true, + "path": "tierb", + "vs_cpu_buffers": {}, + "vs_cpu_output": null, + "vs_cpu_output_per_value": null + }, + { + "case": "synthetic_768", + "fused_equals_tierb": null, + "hip_equals_d3d12": true, + "input_pixels": [ + 768, + 768 + ], + "launches": 32, + "negative_controls": { + "fg_add_f16": { + "caught": true, + "differ": 147134, + "step": 13 + }, + "fg_conv_f16": { + "caught": true, + "differ": 4707555, + "step": 0 + }, + "fg_maxpool2_f16": { + "caught": true, + "differ": 1177086, + "step": 1 + }, + "fg_upscale_f16": { + "caught": true, + "differ": 147111, + "step": 12 + } + }, + "ok": true, + "path": "exact", + "vs_cpu_buffers": {}, + "vs_cpu_output": null, + "vs_cpu_output_per_value": null + } + ], + "d3d12_profile_1080p_fused": { + "after": { + "d3d12_sum_ms": 3.988, + "hip_sum_ms": 2.716, + "steps": [ + { + "d3d12_ms": 1.1746, + "grid": 2040, + "hip_ms": 0.7401, + "kernel": "fg_mconv2", + "outs": [ + "a0", + "p1" + ], + "step": 0 + }, + { + "d3d12_ms": 0.2527, + "grid": 510, + "hip_ms": 0.1641, + "kernel": "fg_mconv4", + "outs": [ + "a1", + "p2" + ], + "step": 1 + }, + { + "d3d12_ms": 0.4246, + "grid": 270, + "hip_ms": 0.2831, + "kernel": "fg_mconv4", + "outs": [ + "a2", + "p3" + ], + "step": 2 + }, + { + "d3d12_ms": 0.3388, + "grid": 80, + "hip_ms": 0.2906, + "kernel": "fg_mconv4", + "outs": [ + "a3", + "p4" + ], + "step": 3 + }, + { + "d3d12_ms": 0.2212, + "grid": 48, + "hip_ms": 0.2193, + "kernel": "fg_mconv4", + "outs": [ + "a4", + "p5" + ], + "step": 4 + }, + { + "d3d12_ms": 0.4332, + "grid": 4, + "hip_ms": 0.3, + "kernel": "fg_mpair_b", + "outs": [ + "d5" + ], + "step": 5 + }, + { + "d3d12_ms": 0.2534, + "grid": 16, + "hip_ms": 0.2248, + "kernel": "fg_mpair_d4", + "outs": [ + "d4" + ], + "step": 6 + }, + { + "d3d12_ms": 0.0891, + "grid": 63, + "hip_ms": 0.0528, + "kernel": "fg_mpair_d3", + "outs": [ + "d3" + ], + "step": 7 + }, + { + "d3d12_ms": 0.154, + "grid": 254, + "hip_ms": 0.1004, + "kernel": "fg_mpair_d2", + "outs": [ + "d2" + ], + "step": 8 + }, + { + "d3d12_ms": 0.2508, + "grid": 507, + "hip_ms": 0.1398, + "kernel": "fg_mpair_d1", + "outs": [ + "d1" + ], + "step": 9 + }, + { + "d3d12_ms": 0.3957, + "grid": 2025, + "hip_ms": 0.2005, + "kernel": "fg_mpair_d0", + "outs": [ + "out" + ], + "step": 10 + } + ] + }, + "before_hardware_conversion": { + "d3d12_sum_ms": 10.405, + "hip_sum_ms": 2.929, + "steps": [ + { + "d3d12_ms": 2.3662, + "grid": 2040, + "hip_ms": 0.8301, + "kernel": "fg_mconv2", + "outs": [ + "a0", + "p1" + ], + "step": 0 + }, + { + "d3d12_ms": 0.3156, + "grid": 510, + "hip_ms": 0.1839, + "kernel": "fg_mconv4", + "outs": [ + "a1", + "p2" + ], + "step": 1 + }, + { + "d3d12_ms": 0.979, + "grid": 270, + "hip_ms": 0.3157, + "kernel": "fg_mconv4", + "outs": [ + "a2", + "p3" + ], + "step": 2 + }, + { + "d3d12_ms": 0.8325, + "grid": 80, + "hip_ms": 0.3179, + "kernel": "fg_mconv4", + "outs": [ + "a3", + "p4" + ], + "step": 3 + }, + { + "d3d12_ms": 0.461, + "grid": 48, + "hip_ms": 0.2313, + "kernel": "fg_mconv4", + "outs": [ + "a4", + "p5" + ], + "step": 4 + }, + { + "d3d12_ms": 0.8412, + "grid": 4, + "hip_ms": 0.3227, + "kernel": "fg_mpair_b", + "outs": [ + "d5" + ], + "step": 5 + }, + { + "d3d12_ms": 1.7986, + "grid": 16, + "hip_ms": 0.1921, + "kernel": "fg_mpair_d4", + "outs": [ + "d4" + ], + "step": 6 + }, + { + "d3d12_ms": 0.3256, + "grid": 63, + "hip_ms": 0.0559, + "kernel": "fg_mpair_d3", + "outs": [ + "d3" + ], + "step": 7 + }, + { + "d3d12_ms": 0.5708, + "grid": 254, + "hip_ms": 0.1095, + "kernel": "fg_mpair_d2", + "outs": [ + "d2" + ], + "step": 8 + }, + { + "d3d12_ms": 0.7988, + "grid": 507, + "hip_ms": 0.15, + "kernel": "fg_mpair_d1", + "outs": [ + "d1" + ], + "step": 9 + }, + { + "d3d12_ms": 1.116, + "grid": 2025, + "hip_ms": 0.2202, + "kernel": "fg_mpair_d0", + "outs": [ + "out" + ], + "step": 10 + } + ] + }, + "method": "WG_D3D12_PROFILE GPU timestamps per dispatch (median of 5 runs) against HIP events per launch; synthetic weights" + }, + "date": "2026-11-14", + "gate": { + "cases": 18, + "cases_ok": 18, + "hip_equals_d3d12_all": true, + "leaky_check": { + "differ_from_cpu": 0, + "hip_equals_d3d12": true, + "inputs": 65536 + }, + "pass": true + }, + "gpu": "gfx1201", + "report_vs_cpu_reference": "steps = distance in float16 values; rel = max |diff| / max |ref|; report only (the gate is the generated frame)", + "timing": { + "max_launch_ms": 100.0, + "method": "HIP: device events around 10 back-to-back network runs, mean per run (per-op: events around each launch). D3D12: kernel_replay chain wall time from submission to completion, synchronised after each of 10 runs, mean per run (includes host submission and the wait). Synthetic weights, buffers resident, warm-up first. Information only.", + "paths": { + "fused": { + "1080p": { + "d3d12_exit": 0, + "d3d12_wall_ms": 5.585, + "hip_ms": 2.478, + "launches": 11, + "max_launch_ms_measured": 0.974, + "out_hip_equals_d3d12": true, + "per_op_ms": { + "conv": 2.296, + "pair": 1.316 + }, + "pixels": [ + 1920, + 1080 + ], + "predicted_max_launch_ms": 2.84 + }, + "1440p": { + "d3d12_exit": 0, + "d3d12_wall_ms": 7.233, + "hip_ms": 3.566, + "launches": 11, + "max_launch_ms_measured": 1.251, + "out_hip_equals_d3d12": true, + "per_op_ms": { + "conv": 2.425, + "pair": 1.333 + }, + "pixels": [ + 2560, + 1440 + ], + "predicted_max_launch_ms": 5.05 + }, + "probe": { + "max_step": 5, + "max_step_ms": 0.359, + "pixels": [ + 512, + 512 + ], + "sum_of_steps_ms": 1.738 + } + }, + "tierb": { + "1080p": { + "d3d12_exit": 0, + "d3d12_wall_ms": 7.119, + "hip_ms": 3.219, + "launches": 27, + "max_launch_ms_measured": 0.98, + "out_hip_equals_d3d12": true, + "per_op_ms": { + "add": 0.436, + "conv": 2.961, + "upscale": 0.944 + }, + "pixels": [ + 1920, + 1080 + ], + "predicted_max_launch_ms": 1.38 + }, + "1440p": { + "d3d12_exit": 0, + "d3d12_wall_ms": 11.92, + "hip_ms": 5.351, + "launches": 27, + "max_launch_ms_measured": 1.256, + "out_hip_equals_d3d12": true, + "per_op_ms": { + "add": 0.756, + "conv": 4.075, + "upscale": 1.589 + }, + "pixels": [ + 2560, + 1440 + ], + "predicted_max_launch_ms": 2.46 + }, + "probe": { + "max_step": 4, + "max_step_ms": 0.175, + "pixels": [ + 512, + 512 + ], + "sum_of_steps_ms": 1.523 + } + } + }, + "reps": 10 + }, + "what": "net1 fused tier B (fg_mconv + fg_mpair, 11 launches), tier B unfused (27) and exact (32) on HIP and D3D12, clean/fg/runner/fg_net1_mma.py" +} diff --git a/clean/fg/runner/fg_net1_mma.py b/clean/fg/runner/fg_net1_mma.py index a865f363..5ebcf153 100644 --- a/clean/fg/runner/fg_net1_mma.py +++ b/clean/fg/runner/fg_net1_mma.py @@ -1,23 +1,32 @@ # SPDX-License-Identifier: MIT -"""Frame generation (issue #96): net1 on gfx12's matrix instructions (tier B of the fast path), HIP and D3D12. +"""Frame generation (issue #96): net1 on gfx12's matrix instructions (tier B of the fast path), HIP and D3D12, with the +exact path selectable. python clean/fg/runner/fg_net1_mma.py --build --rocm "C:\\Program Files\\AMD\\ROCm\\7.2" --prepare - python clean/fg/runner/fg_net1_mma.py --build --rocm ... --run [--model ] [--json out.json] - python clean/fg/runner/fg_net1_mma.py --build --rocm ... --timing [--json out.json] - -The network (NET1_WIRING) on NHWC float16 buffers in 27 launches: the 17 convolutions as fg_mconv (one -v_wmma_f32_16x16x16_f16 per spec chunk in the layer's chunk order, the float16 accumulator from the bias as C and the -result rounded to float16 after every chunk; leaky ReLU, and for net1_01..05 the 2 x 2 max-pool, in the epilogue), -five NHWC upscales and five adds (fg_add_f16). + python clean/fg/runner/fg_net1_mma.py --build --rocm ... --run [--paths fused,tierb] [--model ] + [--json out.json] + python clean/fg/runner/fg_net1_mma.py --build --rocm ... --timing [--paths fused,tierb] [--json out.json] + +Paths (all on the same weights and input): +- fused (11 launches): the five encoder convolutions (fg_mconv, the 2 x 2 pool in the epilogue), the bottleneck + net1_06 + net1_07 as one fg_mpair, and each decoder level (upscale + add + two 1 x 1 convolutions) as one fg_mpair; +- tierb (27 launches): every convolution as fg_mconv, the upscales and adds as their own launches; +- exact (32 launches, clean/fg/runner/fg_net1_gpu.py's kernels): bit-exact to the CPU reference; the validation mode + and the fallback. +Tier B: one v_wmma_f32_16x16x16_f16 per spec chunk in the layer's chunk order, the float16 accumulator from the bias as +C, the result rounded to float16 after every chunk. The fused and tierb paths compute the same arithmetic, so their +common buffers (a_k, p_k, d5, d_k, out) must be byte-identical. Gates (the port standard) -- HIP against D3D12, byte for byte: -- every saved buffer (a_k, p_k, b5, d5, u_k, s_k, e_k, d_k, out) compared raw, each filled with its back end's - sentinel (HIP 0xA5, D3D12 0x5A) and followed by 64 slack bytes nobody may write; -- a negative control per kernel: the first launch of that kernel (with 4 or more workgroups) on half of its grid on - D3D12 must change its output. -Reported only (oversight 2026-11-14: the gate is the generated frame against the oracle): every buffer and the -unfolded output against the CPU reference (net1.run), as the largest distance in float16 steps and the number of -values more than 1 and more than 4 steps off (non-finite disagreements counted apart). +- every buffer a path writes, each filled with its back end's sentinel (HIP 0xA5, D3D12 0x5A) and followed by 64 slack + bytes nobody may write; +- a negative control per kernel: its first launch (with 4 or more workgroups, else its only launch) on half of its + grid on D3D12 must change its output; +- the fast leaky ReLU (fg_leaky_fast16) on all 65,536 float16 inputs: HIP == D3D12 == the CPU reference's leaky; +- fused == tierb on their common buffers (HIP). +Reported only (oversight 2026-11-14: the gate is the generated frame against the oracle): every written buffer and +every output value against the CPU reference (net1.run): values more than 1 and more than 4 float16 steps off, the +largest step distance, the largest absolute difference and that divided by the buffer's largest reference magnitude. Cases: synthetic weights at 64 x 64 and 70 x 90 pixels, special values in the input and biases, and with --model the weights of a converter output file (execute-only: the files written for the replay are deleted after the run). --timing (information only): a 512 x 512 probe times every launch first; 1920 x 1080 and 2560 x 1440 input pixels run @@ -29,7 +38,6 @@ import json import os import sys -import time import numpy as np @@ -44,14 +52,20 @@ CO_MMA, CO_NET1 = "fg_net1_mma.co", "fg_net1.co" MCONV = ["fg_mconv%d" % mt for mt in (1, 2, 4)] -KERNELS = MCONV + ["fg_upscale_hwc_f16", "fg_add_f16"] -MODULE_OF = dict([(k, CO_MMA) for k in MCONV + ["fg_upscale_hwc_f16"]] + [("fg_add_f16", CO_NET1)]) +# fused 1 x 1 pairs: name -> (mode, first conv's output tiles, second conv's output tiles, 16-pixel groups per wave) +MPAIR = {"fg_mpair_b": (0, 32, 16, 1), "fg_mpair_d4": (1, 16, 8, 1), "fg_mpair_d3": (1, 8, 8, 1), + "fg_mpair_d2": (1, 8, 4, 1), "fg_mpair_d1": (1, 4, 2, 2), "fg_mpair_d0": (1, 2, 1, 2)} +EXACT = ["fg_conv_f16", "fg_maxpool2_f16", "fg_upscale_f16"] +KERNELS = MCONV + list(MPAIR) + ["fg_upscale_hwc_f16", "fg_leaky_fast_f16", "fg_add_f16"] + EXACT +MODULE_OF = dict([(k, CO_MMA) for k in MCONV + list(MPAIR) + ["fg_upscale_hwc_f16", "fg_leaky_fast_f16"]] + + [(k, CO_NET1) for k in ["fg_add_f16"] + EXACT]) +PATHS = ("fused", "tierb", "exact") MAX_LAUNCH_MS = 100.0 TIMING_SIZES = G.TIMING_SIZES PROBE = G.PROBE -# ---- the fast plan ------------------------------------------------------------------------------------------------------ +# ---- plans ---------------------------------------------------------------------------------------------------------------- def swizzle(w, order): """Canonical weights [out, k, k, in] -> A fragments in chunk order: [out / 16][chunks][32 lanes][8] float16; lane l @@ -79,10 +93,39 @@ def mconv_mt(cout): return 4 if cout % 64 == 0 else (2 if cout % 32 == 0 else 1) -def plan(H0, W0, params): - """(data, acts, steps) of net1 on cells [H0, W0, 48]: data {id: bytes}; acts {id: (shape HWC, bytes)}; steps - [(kernel, grid, args, outs, op)] with args "@id" or integers.""" - data, acts, steps = {}, {}, [] +def _conv_step(s, params, shape, data, pooled): + w, b = params[s["layer"]] + cout, k, _, cin = np.shape(w) + wid, bid = "wf_" + s["layer"], "b_" + s["layer"] + data[wid] = swizzle(w, s["chunks"]) + data[bid] = np.asarray(b, np.float16).tobytes() + H, W, C = shape[s["in"]] + if C != cin: + raise ValueError("%s: %d input channels, %s has %d" % (s["layer"], cin, s["in"], C)) + mt = mconv_mt(cout) + tx, ty = -(-W // 16), -(-H // 16) + shape[s["out"]] = (H, W, cout) + outs = [s["out"]] + pool = s["out"] in pooled + if pool: + shape[pooled[s["out"]]] = (H // 2, W // 2, cout) + outs.append(pooled[s["out"]]) + args = ["@" + s["in"], "@" + wid, "@" + bid, "@" + s["out"], "@" + outs[-1], cin, cout, H, W, k, + K.ORDER_CODE[s["chunks"]], 1 if s["act"] == "leaky" else 0, 1 if pool else 0, tx, ty] + return ("fg_mconv%d" % mt, tx * ty * (cout // (16 * mt)), args, outs, "conv") + + +def _finish(steps, shape): + acts = {} + for s in steps: + for o in s[3]: + acts[o] = (shape[o], 2 * int(np.prod(shape[o]))) + return acts + + +def plan_tierb(H0, W0, params): + """27 launches (#199): (data, acts, steps); acts {id: (shape HWC, bytes)}; steps [(kernel, grid, args, outs, op)].""" + data, steps = {}, [] shape = {"cells": (H0, W0, N.CELL)} pooled = {s["in"]: s["out"] for s in N.NET1_WIRING if s["op"] == "pool"} for s in N.NET1_WIRING: @@ -90,25 +133,7 @@ def plan(H0, W0, params): if op == "pool": continue # fused into the convolution before it if op == "conv": - w, b = params[s["layer"]] - cout, k, _, cin = np.shape(w) - wid, bid = "wf_" + s["layer"], "b_" + s["layer"] - data[wid] = swizzle(w, s["chunks"]) - data[bid] = np.asarray(b, np.float16).tobytes() - H, W, C = shape[s["in"]] - if C != cin: - raise ValueError("%s: %d input channels, %s has %d" % (s["layer"], cin, s["in"], C)) - mt = mconv_mt(cout) - tx, ty = -(-W // 16), -(-H // 16) - shape[s["out"]] = (H, W, cout) - outs = [s["out"]] - pool = s["out"] in pooled - if pool: - shape[pooled[s["out"]]] = (H // 2, W // 2, cout) - outs.append(pooled[s["out"]]) - args = ["@" + s["in"], "@" + wid, "@" + bid, "@" + s["out"], "@" + (outs[-1]), cin, cout, H, W, k, - K.ORDER_CODE[s["chunks"]], 1 if s["act"] == "leaky" else 0, 1 if pool else 0, tx, ty] - steps.append(("fg_mconv%d" % mt, tx * ty * (cout // (16 * mt)), args, outs, "conv")) + steps.append(_conv_step(s, params, shape, data, pooled)) elif op == "upscale": hi, wi, C = shape[s["in"]] ho, wo, _ = shape[s["like"]] @@ -122,10 +147,61 @@ def plan(H0, W0, params): shape[s["out"]] = shape[a] n = int(np.prod(shape[a])) steps.append(("fg_add_f16", -(-n // 256), ["@" + a, "@" + b, "@" + s["out"], n], [s["out"]], "add")) - for s in steps: - for o in s[3]: - acts[o] = (shape[o], 2 * int(np.prod(shape[o]))) - return data, acts, steps + return data, _finish(steps, shape), steps + + +plan = plan_tierb # the name #199's tests use + + +def plan_fused(H0, W0, params): + """11 launches: encoders (fg_mconv with pool), the bottleneck pair and five decoder pairs (fg_mpair).""" + data, steps = {}, [] + shape = {"cells": (H0, W0, N.CELL)} + wiring = N.NET1_WIRING + pooled = {s["in"]: s["out"] for s in wiring if s["op"] == "pool"} + by_out = {s["out"]: s for s in wiring} + for s in wiring: # encoders: a0..a4 with p1..p5 + if s["op"] == "conv" and s["out"] in pooled: + steps.append(_conv_step(s, params, shape, data, pooled)) + + def pair(kernel, x, a, l1, l2, out, coarse): + mode, c1t, c2t, nt = MPAIR[kernel] + w1, b1 = params[l1["layer"]] + w2, b2 = params[l2["layer"]] + for l, w, b in ((l1, w1, b1), (l2, w2, b2)): + data["wf_" + l["layer"]] = swizzle(w, l["chunks"]) + data["b_" + l["layer"]] = np.asarray(b, np.float16).tobytes() + H, W, C = shape[a if mode == 1 else x] + if (np.shape(w1)[3], np.shape(w1)[0], np.shape(w2)[0]) != (C, 16 * c1t, 16 * c2t) or np.shape(w1)[1] != 1: + raise ValueError("%s does not fit %s / %s" % (kernel, l1["layer"], l2["layer"])) + hi, wi = (shape[x][0], shape[x][1]) if mode == 1 else (1, 1) + shape[out] = (H, W, 16 * c2t) + args = ["@" + x, "@" + a, "@wf_" + l1["layer"], "@b_" + l1["layer"], "@wf_" + l2["layer"], "@b_" + l2["layer"], + "@" + out, C, H, W, hi, wi, K._ratio_bits(wi, W) if mode == 1 else 0, + K._ratio_bits(hi, H) if mode == 1 else 0, 1 if l2["act"] == "leaky" else 0] + steps.append((kernel, -(-(H * W) // (128 * nt)), args, [out], "pair")) + + pair("fg_mpair_b", "p5", "p5", by_out["b5"], by_out["d5"], "d5", None) + for lvl in (4, 3, 2, 1, 0): + e = by_out["e%d" % lvl] + d = by_out["d%d" % lvl] if lvl else by_out["out"] + pair("fg_mpair_d%d" % lvl, "d%d" % (lvl + 1), "a%d" % lvl, e, d, d["out"], True) + return data, _finish(steps, shape), steps + + +def plan_exact(H0, W0, params): + """#191's 32 launches on [C][H][W] buffers: (data, acts, steps) in this module's step format.""" + data, acts, steps = G.plan(H0, W0, params) + return data, acts, [(s[0], s[1], s[2], [s[3]], s[4]) for s in steps] + + +def plan_path(path, H0, W0, params, cells): + """(layout, data with the cells, acts, steps) of one path.""" + if path == "exact": + data, acts, steps = plan_exact(H0, W0, params) + return "chw", dict(cells=G.cells_bytes(cells), **data), acts, steps + data, acts, steps = (plan_fused if path == "fused" else plan_tierb)(H0, W0, params) + return "hwc", dict(cells=cells_hwc(cells), **data), acts, steps def cells_hwc(cells): @@ -190,8 +266,9 @@ def chain_lines(name, files, acts, steps, half=None, stop=None, saves=None, time # ---- report against the CPU reference ------------------------------------------------------------------------------------ def step_report(got_bits, want): - """got: float16 bits; want: float64 values (float16-valued). Largest finite distance in float16 steps, counts over - 1 and over 4 steps, non-finite disagreements.""" + """got: float16 bits; want: float64 values (float16-valued). Values over 1 / over 4 float16 steps, the largest step + distance, the largest absolute difference (finite values) and that over the largest reference magnitude, and + non-finite disagreements.""" w = np.asarray(want, np.float64).astype(np.float16).view(np.uint16).reshape(-1) g = np.asarray(got_bits, np.uint16).reshape(-1) @@ -200,16 +277,52 @@ def key(b): return np.where(b & 0x8000, -(b & 0x7FFF), b & 0x7FFF) fin = ((g & 0x7C00) != 0x7C00) & ((w & 0x7C00) != 0x7C00) d = np.where(fin, np.abs(key(g) - key(w)), 0) + gv, wv = g.view(np.float16).astype(np.float64), w.view(np.float16).astype(np.float64) + ad = np.where(fin, np.abs(gv - wv), 0.0) + mref = float(np.max(np.abs(wv[fin]))) if fin.any() else 0.0 gn = ((g & 0x7C00) == 0x7C00) & ((g & 0x3FF) != 0) wn = ((w & 0x7C00) == 0x7C00) & ((w & 0x3FF) != 0) nonfin_bad = ~fin & ~((g == w) | (gn & wn)) - return {"values": int(g.size), "steps_max": int(d.max()) if d.size else 0, "over_1_step": int(np.sum(d > 1)), - "over_4_steps": int(np.sum(d > 4)), "nonfinite_mismatch": int(np.sum(nonfin_bad))} + return {"values": int(g.size), "over_1_step": int(np.sum(d > 1)), "over_4_steps": int(np.sum(d > 4)), + "steps_max": int(d.max()) if d.size else 0, "max_abs_diff": float(ad.max()) if ad.size else 0.0, + "max_abs_ref": mref, "rel": float(ad.max() / mref) if mref else 0.0, + "nonfinite_mismatch": int(np.sum(nonfin_bad))} + + +def to_chw(raw, shape, layout): + a = np.frombuffer(raw, np.uint16).reshape(shape) + return a.transpose(2, 0, 1) if layout == "hwc" else a # ---- run -------------------------------------------------------------------------------------------------------------------- -def run(build, rocm, model): +def leaky_check(h, mods, build, cdir, lines, written): + """All 65,536 float16 inputs through fg_leaky_fast_f16 on HIP; the D3D12 case lines; the CPU reference's leaky.""" + x = np.arange(65536, dtype=np.uint32).astype(np.uint16) + n = x.size + xp = h.malloc(2 * n) + yp = h.malloc(2 * n + K.SLACK) + try: + h.upload(xp, x.tobytes()) + h.memset(yp, K.HIP_SENTINEL, 2 * n + K.SLACK) + h.launch(h.get_function(mods[CO_MMA], "fg_leaky_fast_f16"), n // 256, 256, + [ctypes.c_void_p(xp), ctypes.c_void_p(yp), ctypes.c_uint32(n)]) + h.sync() + hip = bytes(h.download(yp, 2 * n + K.SLACK)) + finally: + h.free(xp) + h.free(yp) + with open(os.path.join(cdir, "leaky.x"), "wb") as f: + f.write(x.tobytes()) + written += ["leaky.x", "leaky.y"] + lines += ["case leaky", "module " + CO_MMA, "kernel fg_leaky_fast_f16 %d 256" % (n // 256), "arg buf leaky.x", + "arg out %d leaky.y %d" % (2 * n + K.SLACK, K.D3D12_SENTINEL), "arg u32 %d" % n, ""] + with np.errstate(invalid="ignore", over="ignore"): + ref = N.leaky(x.view(np.float16).astype(np.float64)) + return hip, ref + + +def run(build, rocm, paths, model): from clean.runner.hip import Hip, clean_process_environment clean_process_environment(rocm) h = Hip(rocm) @@ -219,34 +332,42 @@ def run(build, rocm, model): lines, runs, written = [], [], [] need_mb = 256 try: - for cname, values, params in G.cases(model): + leaky_hip, leaky_ref = leaky_check(h, mods, build, cdir, lines, written) + cases = [(c[0], c[1], c[2], True) for c in G.cases(model)] + # 768 x 768 pixels: every kernel gets 2 or more workgroups (the bottleneck level is 12 x 12 cells), so each has a + # half-grid negative control (the coarse levels of the small cases fit in one workgroup); gates only, no CPU + # reference (report) at this size + rng = np.random.default_rng(768) + cases.append(("synthetic_768", rng.uniform(0, 1, (10, 768, 768)), G.synthetic_params(rng), False)) + for cname, values, params, with_ref in cases: cells = N.fold(values) _, gh, gw = values.shape H0, W0 = cells.shape[1:] - ref = N.run(cells, params) - name = cname - data, acts, steps = plan(H0, W0, params) - data = dict(cells=cells_hwc(cells), **data) - net = HipNet(h, mods, data, acts, steps) - try: - hip = net.run() - finally: - net.free() - files = G.write_files(cdir, name, data) - written += [f["name"] for f in files.values()] + ["%s.%s" % (name, i) for i in acts] - lines += chain_lines(name, files, acts, steps) - negs = {} - for kernel in sorted(set(s[0] for s in steps)): - j = next((j for j, s in enumerate(steps) if s[0] == kernel and s[1] >= 4), None) - if j is None: - continue - nn = "negative_%s_%s" % (name, kernel) - negs[kernel] = (nn, j, steps[j][3]) - lines += chain_lines(nn, files, acts, steps, half=j, stop=j, saves=steps[j][3]) - written += ["%s.%s" % (nn, o) for o in steps[j][3]] - need_mb = max(need_mb, G.arena_mb(data, acts)) - runs.append({"name": name, "case": cname, "acts": acts, "steps": steps, "hip": hip, - "ref": ref, "negs": negs, "dims": (H0, W0, gh, gw)}) + ref = N.run(cells, params) if with_ref else None + for path in paths: + name = "%s_%s" % (cname, path) + layout, data, acts, steps = plan_path(path, H0, W0, params, cells) + net = HipNet(h, mods, data, acts, steps) + try: + hip = net.run() + finally: + net.free() + files = G.write_files(cdir, name, data) + written += [f["name"] for f in files.values()] + ["%s.%s" % (name, i) for i in acts] + lines += chain_lines(name, files, acts, steps) + negs = {} + for kernel in sorted(set(s[0] for s in steps)): + cand = [j for j, s in enumerate(steps) if s[0] == kernel] + j = next((j for j in cand if steps[j][1] >= 4), cand[0]) + if steps[j][1] < 2: + continue # a single workgroup has no half grid + nn = "negative_%s_%s" % (name, kernel) + negs[kernel] = (nn, j, steps[j][3]) + lines += chain_lines(nn, files, acts, steps, half=j, stop=j, saves=steps[j][3]) + written += ["%s.%s" % (nn, o) for o in steps[j][3]] + need_mb = max(need_mb, G.arena_mb(data, acts)) + runs.append({"name": name, "case": cname, "path": path, "layout": layout, "acts": acts, "steps": steps, + "hip": hip, "ref": ref, "negs": negs, "dims": (H0, W0, gh, gw)}) r, secs = G.replay(build, cdir, lines, need_mb, timeout=150) def read(fn): @@ -256,14 +377,21 @@ def read(fn): res = {"replay_exit": r.returncode, "replay_s": round(secs, 1), "replay_tail": r.stdout[-400:] + r.stderr[-200:], "cases": []} ok = r.returncode == 0 + # the leaky check + lr = K.compare_raw(read("leaky.y"), leaky_hip, 2 * 65536) + lcpu = K.compare_cpu(leaky_hip[:2 * 65536], leaky_ref) + res["leaky_check"] = {"inputs": 65536, "hip_equals_d3d12": lr["differ"] == 0 and lr["slack_ok"], + "differ_from_cpu": lcpu["differ"]} + ok = ok and res["leaky_check"]["hip_equals_d3d12"] and lcpu["differ"] == 0 + by_name = {c["name"]: c for c in runs} for c in runs: raw_bad, rep = [], {} for out, (shape, n) in c["acts"].items(): raw = K.compare_raw(read("%s.%s" % (c["name"], out)), c["hip"][out], n) if raw["differ"] != 0 or not raw["slack_ok"]: raw_bad.append({"buffer": out, **raw}) - got = np.frombuffer(c["hip"][out][:n], np.uint16).reshape(shape) # HWC - rep[out] = step_report(got.transpose(2, 0, 1), c["ref"][out]) + if c["ref"] is not None: + rep[out] = step_report(to_chw(c["hip"][out][:n], shape, c["layout"]), c["ref"][out]) negs = {} for kernel, (nn, j, outs) in c["negs"].items(): diff = 0 @@ -272,22 +400,33 @@ def read(fn): nraw = K.compare_raw(read("%s.%s" % (nn, o)), c["hip"][o], n) diff += max(nraw["differ"], 0) + (0 if nraw["slack_ok"] else 1) negs[kernel] = {"step": j, "caught": diff != 0, "differ": diff} + fused_vs_tierb = None + if c["path"] == "fused" and ("%s_tierb" % c["case"]) in by_name: + t = by_name["%s_tierb" % c["case"]] + fused_vs_tierb = {o: c["hip"][o][:c["acts"][o][1]] == t["hip"][o][:c["acts"][o][1]] for o in c["acts"]} H0, W0, gh, gw = c["dims"] shape, n = c["acts"]["out"] - o_hwc = np.frombuffer(c["hip"]["out"][:n], np.uint16).reshape(shape).astype(np.uint16) - o = o_hwc.transpose(2, 0, 1).view(np.float16).astype(np.float64) + o = to_chw(c["hip"]["out"][:n], shape, c["layout"]).view(np.float16).astype(np.float64) px = N.unfold(o, gh, gw) - rpx = N.unfold(c["ref"]["out"], gh, gw) - out_rep = step_report(px.astype(np.float16).view(np.uint16), rpx) - per_value = [step_report(px[t].astype(np.float16).view(np.uint16), rpx[t]) for t in range(px.shape[0])] - good = not raw_bad and all(v["caught"] for v in negs.values()) and len(negs) >= 3 + out_rep, per_value = None, None + if c["ref"] is not None: + rpx = N.unfold(c["ref"]["out"], gh, gw) + out_rep = step_report(px.astype(np.float16).view(np.uint16), rpx) + per_value = [step_report(px[t].astype(np.float16).view(np.uint16), rpx[t]) for t in range(px.shape[0])] + # the 768 case must give every kernel its negative control + full_negs = c["case"] != "synthetic_768" or len(negs) == len(set(s[0] for s in c["steps"])) + good = not raw_bad and all(v["caught"] for v in negs.values()) and full_negs and \ + (fused_vs_tierb is None or all(fused_vs_tierb.values())) ok = ok and good - res["cases"].append({"case": c["case"], "input_pixels": [gw, gh], "hip_equals_d3d12": not raw_bad, + res["cases"].append({"case": c["case"], "path": c["path"], "launches": len(c["steps"]), + "input_pixels": [gw, gh], "hip_equals_d3d12": not raw_bad, "raw_differences": raw_bad[:5], "negative_controls": negs, + "fused_equals_tierb": fused_vs_tierb, "vs_cpu_output": out_rep, "vs_cpu_output_per_value": per_value, "vs_cpu_buffers": rep, "output_sha256": hashlib.sha256(px.astype("= MAX_LAUNCH_MS: entry["skipped"] = "a launch is predicted at %.0f ms (limit %.0f ms)" % (predicted, MAX_LAUNCH_MS) continue - data, acts, steps, _ = setup(w, hgt) + data, acts, steps, _ = setup(w, hgt, path) net = HipNet(h, mods, data, acts, steps) try: net.launch() h.sync() st = net.time_steps(2) + entry["launches"] = len(steps) entry["max_launch_ms_measured"] = round(max(st), 3) entry["per_op_ms"] = {op: round(sum(t for t, s in zip(st, steps) if s[4] == op), 3) - for op in ("conv", "upscale", "add")} + for op in sorted(set(s[4] for s in steps))} entry["hip_ms"] = round(net.time_network(reps), 3) hip_out = net.run()["out"] finally: net.free() - name = "timing_%s_%s" % (acc, label) + name = "timing_%s_%s" % (path, label) files = G.write_files(cdir, name, data) written = [f["name"] for f in files.values()] + ["%s.out" % name] try: @@ -356,17 +496,17 @@ def setup(w, hgt): entry["d3d12_exit"] = r.returncode for line in r.stdout.splitlines(): if line.startswith("chain %s: time" % name): - entry["d3d12_ms"] = float(line.split("time ")[1].split(" ms")[0]) + entry["d3d12_wall_ms"] = float(line.split("time ")[1].split(" ms")[0]) p = os.path.join(cdir, "%s.out" % name) got = open(p, "rb").read() if (r.returncode == 0 and os.path.exists(p)) else b"" entry["out_hip_equals_d3d12"] = bool(got) and K.compare_raw(got, hip_out, acts["out"][1])["differ"] == 0 finally: G.remove_written(cdir, written) - res["modes"][acc] = mode + res["paths"][path] = mode res["method"] = ("HIP: device events around %d back-to-back network runs, mean per run (per-op: events around each " "launch). D3D12: kernel_replay chain wall time from submission to completion, synchronised after each " - "of %d runs, mean per run. Synthetic weights, buffers resident, warm-up first. Information only." - % (reps, reps)) + "of %d runs, mean per run (includes host submission and the wait). Synthetic weights, buffers " + "resident, warm-up first. Information only." % (reps, reps)) return res @@ -390,24 +530,30 @@ def main(argv=None): ap.add_argument("--prepare", action="store_true") ap.add_argument("--run", action="store_true") ap.add_argument("--timing", action="store_true") + ap.add_argument("--paths", default="fused,tierb", help="any of %s" % ",".join(PATHS)) ap.add_argument("--model", default=None) ap.add_argument("--json", default=None) a = ap.parse_args(argv) + paths = a.paths.split(",") + if any(p not in PATHS for p in paths): + ap.error("paths: %s" % ",".join(PATHS)) if a.prepare: prepare(a.build, a.rocm) res = None if a.run: - res = run(a.build, a.rocm, a.model) + res = run(a.build, a.rocm, paths, a.model) print(json.dumps(res["summary"])) for c in res["cases"]: - print(c["case"], "ok" if c["ok"] else "FAIL", "| hip == d3d12:", c["hip_equals_d3d12"], + fv = c["fused_equals_tierb"] + print(c["case"], c["path"], "ok" if c["ok"] else "FAIL", "| hip == d3d12:", c["hip_equals_d3d12"], "| negatives caught:", sum(v["caught"] for v in c["negative_controls"].values()), "of", - len(c["negative_controls"]), "| output vs cpu:", json.dumps(c["vs_cpu_output"])) + len(c["negative_controls"]), "| fused == tierb:", None if fv is None else all(fv.values()), + "| output vs cpu:", json.dumps(c["vs_cpu_output"])) for d in c["raw_differences"]: print(" raw difference", json.dumps(d)) print("replay exit", res["replay_exit"], res["replay_tail"][-200:] if res["replay_exit"] else "") elif a.timing: - res = timing(a.build, a.rocm) + res = timing(a.build, a.rocm, paths) print(json.dumps(res, indent=1)) if res is not None and a.json: with open(a.json, "w", encoding="utf-8", newline="\n") as f: diff --git a/clean/fg/tests/test_fg_net1_mma_plan.py b/clean/fg/tests/test_fg_net1_mma_plan.py index 98492549..e3c699a4 100644 --- a/clean/fg/tests/test_fg_net1_mma_plan.py +++ b/clean/fg/tests/test_fg_net1_mma_plan.py @@ -68,5 +68,54 @@ def test_buffers_and_launches(self): self.assertEqual(pooled, [["a0", "p1"], ["a1", "p2"], ["a2", "p3"], ["a3", "p4"], ["a4", "p5"]]) +class FusedPlanTest(unittest.TestCase): + def test_eleven_launches_and_shapes(self): + params = G.synthetic_params(np.random.default_rng(4)) + for gh, gw in ((64, 64), (70, 90), (768, 768)): + cells = N.fold(np.zeros((10, gh, gw))) + H0, W0 = cells.shape[1:] + data, acts, steps = M.plan_fused(H0, W0, params) + self.assertEqual(len(steps), 11) + self.assertEqual([s[0] for s in steps][5:], + ["fg_mpair_b", "fg_mpair_d4", "fg_mpair_d3", "fg_mpair_d2", "fg_mpair_d1", "fg_mpair_d0"]) + self.assertEqual(set(acts), {"a0", "a1", "a2", "a3", "a4", "p1", "p2", "p3", "p4", "p5", + "d5", "d4", "d3", "d2", "d1", "out"}) + _, tacts, _ = M.plan_tierb(H0, W0, params) + for k, v in acts.items(): + self.assertEqual(v, tacts[k], k) # the same buffers as the 27-launch path + for kernel, grid, args, outs, op in steps[5:]: + mode, c1t, c2t, nt = M.MPAIR[kernel] + C, H, W = args[7], args[8], args[9] + self.assertEqual(len(args), 15) + self.assertEqual(grid, -(-(H * W) // (128 * nt))) + self.assertEqual(acts[outs[0]][0], (H, W, 16 * c2t)) + if mode == 1: + hi, wi = args[10], args[11] + self.assertEqual(acts[args[0][1:]][0][:2], (hi, wi)) # the coarse level + self.assertEqual(acts[args[1][1:]][0], (H, W, C)) # the skip + if (gh, gw) == (768, 768): + self.assertTrue(all(s[1] >= 2 for s in steps)) # every kernel has a half grid + + +class LeakyFastTest(unittest.TestCase): + def test_every_float16_input(self): + """fg_leaky_fast16's formula (one single-precision product, one float16 rounding, max by order with -0 == +0, + NaN kept) against the CPU reference's leaky on all 65,536 inputs.""" + x = np.arange(65536, dtype=np.uint32).astype(np.uint16) + xf = x.view(np.float16) + with np.errstate(invalid="ignore", over="ignore"): + t = (np.float32(N.LEAKY_SLOPE) * xf.astype(np.float32)).astype(np.float16).view(np.uint16) + ref = N.leaky(xf.astype(np.float64)).astype(np.float16).view(np.uint16) + + def key(b): + b = b.astype(np.int64) + return np.where(b & 0x8000, -(b & 0x7FFF), b & 0x7FFF) + nan = ((x & 0x7C00) == 0x7C00) & ((x & 0x3FF) != 0) + fast = np.where(nan, x, np.where(key(t) > key(x), t, x)) + rn = ((ref & 0x7C00) == 0x7C00) & ((ref & 0x3FF) != 0) + same = (fast == ref) | (nan & rn) + self.assertTrue(np.all(same), np.flatnonzero(~same)[:10]) + + if __name__ == "__main__": unittest.main()