Half-resolution four-subband decoding and high-frequency adversarial gradient routing

Why Lightweight Full-Resolution Heads Still Bottleneck on HBM

In our VAE-free DiT pixel-head benchmark at 1024×10241024 \times 1024 on NVIDIA L4, a full-resolution GroupNorm head took 115.05 ms (904 MiB peak VRAM), whereas terminating neural layers at 512×512512 \times 512 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 (I=F/BI = F / B) hitting the HBM bandwidth ceiling:

T≥max⁡ ⁣(FPpeak,  BβHBM)T \ge \max\!\left(\frac{F}{P_{\text{peak}}},\; \frac{B}{\beta_{\text{HBM}}}\right)

A single 1×128×1024×10241 \times 128 \times 1024 \times 1024 BF16 activation tensor occupies 256 MiB. Because GroupNorm reduces mean and variance across spatial planes (C/G)HW(C/G)HW 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 H/2×W/2H/2 \times W/2 cuts spatial activation traffic by 4×4\times, leaving only a parameter-free orthogonal Basis transform at full resolution.

Orthogonal 2D Haar Basis and Parseval Equivalence

Flattening each 2×22 \times 2 pixel block row-wise as q=(a,b,c,d)⊤q = (a, b, c, d)^\top, the orthonormal 2D Haar transform is:

w=Qq,Q=12[11111−11−111−1−11−1−11],w=(LL,LH,HL,HH)⊤w = Q q, \qquad Q = \frac{1}{2} \begin{bmatrix} 1 & 1 & 1 & 1 \\ 1 & -1 & 1 & -1 \\ 1 & 1 & -1 & -1 \\ 1 & -1 & -1 & 1 \end{bmatrix}, \qquad w = (LL, LH, HL, HH)^\top

Since Q⊤Q=IQ^\top Q = I, inverse reconstruction is simply q=Q⊤wq = Q^\top w, preserving exact blockwise L2L_2 energy:

∥q^−q∥22=∥w^−w∥22\|\hat{q} - q\|_2^2 = \|\hat{w} - w\|_2^2

Two practical details matter in implementation:

  1. Orthonormal scaling: under QQ, LLLL equals twice the 2×22\times 2 block mean (factor 1/21/2, vs. 1/41/4 in average pooling); mixing conventions rescales high-frequency detail bands by 2×2\times.
  2. Cross-patch continuity: because iDWT assembles disjoint 2×22\times 2 blocks, purely token-wise 1×11\times 1 projections break thin diagonal strokes across 16×1616\times 16 DiT patch borders; a lightweight 3×33\times 3 spatial bridge at 5122512^2 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 ∂Ladv/∂LL\partial \mathcal{L}_{\text{adv}} / \partial LL at the head output so adversarial updates directly sculpt LH,HL,HHLH, HL, HH; because the four subbands share upstream trunk weights, pairing this with full-subband reconstruction (MSE + LPIPS) anchors global exposure and chromatic fidelity.