Archived
venc: value-parity fix — shortcut must read the raw input, not silu(norm1)
In step_venc the ResnetBlock shortcut conv (op_sc) was issued after norm1
(op_n1), but on a shortcut level norm1 normalizes the input `in` IN PLACE
(nb = E.in), so the 1x1 nin_shortcut residual was fed silu(norm1(x))
instead of the raw x the reference uses:
ResnetBlock3D.forward: x = self.nin_shortcut(x) # raw, before any norm
return self.conv2(h, pre_norm=norm2, residual=x)
This shrank the residual term on every shortcut level (cout != cin, i.e.
levels 1 and 3), producing the ~0.49x structural deficit that accumulated
down the video/image VAE trunk. Reorder op_sc to read `in` before op_n1
overwrites it -- an op reorder, not a kernel change; it corrects the SHARED
trunk so the image encoder's fidelity is fixed too.
Localised by a frame-0 per-level bisection: R4D_ENC_SEL=all now dumps
frame-0 f32 shadows of every level's post-resnet output v_lv[0..4].a
(dbg_ve_l0..l4, a 9-buffer host slab) alongside the existing tail, and
ref_venc_parity.py --evcl0..--evcl4 compares each against the reference
level output on the device's own staged pixels. The std ratio walks to the
exact entry point -- conv_in 0.999, L0 0.999, L1 0.455 (first shortcut
level) -> every level 1.000 after the fix, tail nout/q48/q2 to the bf16
floor (relFro ~4e-3, affine 1.000). Device-live: a single-image ref2va
encode generates clean with the fix loaded.
Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
1 parent
1dc850d17f
commit
40e4e3c2d8
6 files changed
+281
-63
No files matched your search
@@ -691,6 +691,18 @@ ABI_FIELD(RadVideoGenDecl, dbg_ve_nout)
|
||||
ABI_FIELD(RadVideoGenDecl, dbg_ve_nout_bytes)
|
||||
ABI_FIELD(RadVideoGenDecl, dbg_ve_trunk)
|
||||
ABI_FIELD(RadVideoGenDecl, dbg_ve_trunk_bytes)
|
||||
ABI_FIELD(RadVideoGenDecl, dbg_ve_cin)
|
||||
ABI_FIELD(RadVideoGenDecl, dbg_ve_cin_bytes)
|
||||
ABI_FIELD(RadVideoGenDecl, dbg_ve_l0)
|
||||
ABI_FIELD(RadVideoGenDecl, dbg_ve_l0_bytes)
|
||||
ABI_FIELD(RadVideoGenDecl, dbg_ve_l1)
|
||||
ABI_FIELD(RadVideoGenDecl, dbg_ve_l1_bytes)
|
||||
ABI_FIELD(RadVideoGenDecl, dbg_ve_l2)
|
||||
ABI_FIELD(RadVideoGenDecl, dbg_ve_l2_bytes)
|
||||
ABI_FIELD(RadVideoGenDecl, dbg_ve_l3)
|
||||
ABI_FIELD(RadVideoGenDecl, dbg_ve_l3_bytes)
|
||||
ABI_FIELD(RadVideoGenDecl, dbg_ve_l4)
|
||||
ABI_FIELD(RadVideoGenDecl, dbg_ve_l4_bytes)
|
||||
ABI_STRUCT(RadVideoGeom)
|
||||
ABI_FIELD(RadVideoGeom, n_text)
|
||||
ABI_FIELD(RadVideoGeom, frames)
|
||||
|
||||
Reference in new issue
Block a user