wan_vae_set_streaming defaults to on; strata-vae-decode --stream off and vae_decode_set.py --stream off give the
one-pass reference. tools/image/gate/vae_identity.py is the gate: for every fixed latent of the sets named, the
row-band decode against the one-pass decode byte for byte, and the row-band decode run to run.
Spark (GB10, CUDA 13): VAE-IDENTITY PASS 16 of 16 (4 x 512, 8 x 1024, 4 x 1536x1024), bands run to run identical
16 of 16; the default-path pictures byte-identical to f7d8aa28e's one-pass pictures 16 of 16. Peak device memory
of the decoder 1388 / 2565 / 3411 MiB (one pass 1626 / 4293 / 6003 MiB); decode 450-470 / 1034-1063 /
1438-1474 ms.
wan_vae_set_streaming(on): block 3's upsample, block 4 and the head run in bands of 128 picture rows, each computed
with 7 rows more above and below (block 4's six 3x3 convolutions and conv_out need one each) from the complete
block-3 tensors. Every kept pixel goes through the same operations on the same operands, GEMM bands included, so
the picture is the one-pass picture byte for byte. The kernels take row windows (zero padding only at the picture's
own edges). Blocks 2 and 3 keep their input for the DupUp shortcut without a copy (their first resnet writes a new
tensor anyway); this does not change any value. The rule that turns the path on is not in this commit.
strata-vae-decode --stream on, vae_decode_set.py --stream on; diff_where.py says where two picture sets differ
(largest difference with its pixel and channel, share of pixels above 8/255, PSNR of the pictures as the server
sends them, flattened on white by serve/images.py flatten_png).
Spark (GB10), the 16 fixed latents: row bands against one pass, the float32 outputs byte-identical 16 of 16
(4 x 512, 8 x 1024, 4 x 1536x1024); one pass with these sources against the previous commit's pictures
byte-identical 16 of 16. Decoder peak device memory one pass / row bands: 1626 / 1388 MiB at 512, 4293 / 2565 MiB
at 1024, 6003 / 3411 MiB at 1536x1024; decode time 455-457 / 457-466 ms, 1015-1039 / 1036-1068 ms,
1404-1444 / 1460-1466 ms.
include/strata/image/wan_vae.hpp: open / decode / close, plus the latent denormalization. Pixel-major float32
activations; every convolution is a gather of f16 operand rows (RMS norm, SiLU or the nearest-2x upsample fused in,
x 2^-7 as stable-diffusion.cpp does) for fixed bands of 8192 pixels, cuBLAS GemmEx f16 x f16 with f32 accumulation,
and an epilogue (x 2^7, bias, residual, the DupUp shortcut). The mid-block attention is f32 SGEMM / softmax / SGEMM.
sd.cpp accumulates its convolutions in f16; we deliberately do not. The band size never depends on the picture size
or the card's memory, so the picture is the one-pass result everywhere. safetensors_lite.hpp reads the VAE file
(no third-party JSON code); strata-vae-decode (wan_vae_decode_main.cpp) decodes a dumped latent for the gate.
Gate on the Spark (GB10, CUDA 13), ours against sd.cpp's decode of the same fixed latents, PSNR worst / mean,
SSIM worst: 512 x4 56.80 / 57.71 dB, 0.99890; 1024 x8 56.20 / 57.50 dB, 0.99885; 1536x1024 x4 57.02 / 57.37 dB,
0.99865 (limit 45 dB / 0.998: pass). Run to run byte-identical 16 of 16. Decode, first run in a process:
0.44-0.46 / 1.02-1.05 / 1.41-1.44 s against sd.cpp's 1.03-1.06 / 3.34-4.36 / 4.89-4.95 s; opening the VAE file
1.03-1.10 s. The numpy f32 reference (vae_ref.py) is 56.77-58.34 dB from sd.cpp's pictures at 512.
tools/image/gate/vae_decode_set.py runs the decoder over a stage set for compare.py / check_limits.py;
test_safetensors_lite.py tests the reader (11 passed with test_vae_ref.py on p1004).