Half-Resolution Haar Wavelet Decoders: Memory Bandwidth, Parseval Identity, and Gradient Isolation
Why full-resolution GroupNorm stalls on HBM traffic, how orthogonal 2D Haar subbands cut latency by 3×, and what LL.detach() actually isolates during GAN distillation.
Why Lightweight Full-Resolution Heads Still Bottleneck on HBM
In our VAE-free DiT pixel-head benchmark at on NVIDIA L4, a full-resolution GroupNorm head took 115.05 ms (904 MiB peak VRAM), whereas terminating neural layers at and reconstructing via an analytical 2D inverse Haar transform (v0.3) dropped latency to 37.51 ms (504 MiB).
Parameter count barely changes between the two heads; the gap comes from low arithmetic intensity () hitting the HBM bandwidth ceiling:
A single BF16 activation tensor occupies 256 MiB. Because GroupNorm reduces mean and variance across spatial planes before writing normalized activations back out, stacking several full-resolution norm and activation layers moves multiple gigabytes across DRAM. Keeping all learned convolutions and normalizations at cuts spatial activation traffic by , leaving only a parameter-free orthogonal Basis transform at full resolution.
Orthogonal 2D Haar Basis and Parseval Equivalence
Flattening each pixel block row-wise as , the orthonormal 2D Haar transform is:
Since , inverse reconstruction is simply , preserving exact blockwise energy:
Two practical details matter in implementation:
- Orthonormal scaling: under , equals twice the block mean (factor , vs. in average pooling); mixing conventions rescales high-frequency detail bands by .
- Cross-patch continuity: because iDWT assembles disjoint blocks, purely token-wise projections break thin diagonal strokes across DiT patch borders; a lightweight spatial bridge at restores cross-token phase continuity.
Gradient Scope of LL.detach() in Adversarial Distillation
GAN discriminators sharpen fine detail (pores, hair, micro-typography) but easily introduce low-frequency color casts. Detaching the low-pass band on the critic input isolates the direct output gradient:
ll, lh, hl, hh = pred_subbands.chunk(4, dim=1)
adv_in = torch.cat([ll.detach(), lh, hl, hh], dim=1)
loss_g = loss_rec(pred_subbands, target_subbands) + lambda_adv * gan_loss(disc(adv_in))
Specifically, ll.detach() zeroes at the head output so adversarial updates directly sculpt ; because the four subbands share upstream trunk weights, pairing this with full-subband reconstruction (MSE + LPIPS) anchors global exposure and chromatic fidelity.