STAC-R: Subspace-Tracked Activation Compression with Residuals
Manar Hamed ⋅ Yassine Yaakoubi
Abstract
Training-memory reduction requires identifying which saved tensors drive peak usage and ensuring high-fidelity backward contractions from compressed states. We formalize saved-activation compression as a target-surface prediction problem: estimate, before training, the resident saved surface a compressor can replace and the parameter-gradient error it induces. We introduce STAC-R (Subspace-Tracked Activation Compression with Residuals), a saved-tensor wrapper that stores activations as persistent low-rank coefficients plus a sparse quantized residual and contracts weight gradients directly from these factors, bypassing full decompression. The Saved-Surface Predictor ($\mathrm{SSP} = A_C^+/P$) estimates the peak-memory reduction available on that surface, and a gradient bridge links reconstruction error to parameter-gradient cosine similarity. On GPT-2 Medium/Large and Pythia-1.4B, full STAC-R reduces peak memory by 7.2-11.8% with mean gradient cosine $\geq 0.98$ in the GPT-2 Medium replay and the Pythia-1.4B 10k-step cohort (5 seeds: +1.14% validation perplexity); on BERT fine-tuning (SST-2), it reduces peak memory by 12.45% with a 0.15 pp accuracy decrease. Same-surface replays give 0.9813 mean gradient cosine versus 0.9236 for iso-byte SVD and 0.6949 for an untracked subspace. The speed-prioritized Turbo-fast variant reduces GPT-2 Medium peak memory by 9.50% at 0.99× baseline wall time (+1.82% perplexity at 400 steps), and, at sequence length 4096, the peak memory of Qwen-2.5-7B, Llama-3.1-8B, and Mistral-7B by 6.65-7.46% at 0.90-0.92× (memory and runtime only). Applied to the blocks that activation checkpointing does not recompute, it raises the GPT-2 Medium saving from 33.84% to 38.58% at similar wall time (+0.61% versus +0.02% perplexity); its per-GPU saving stays near 8.9% under DDP up to eight GPUs and rises with FSDP2 world size. Once recomputation has removed the target surface, compression has nothing to act on ($\mathrm{SSP} \to 0$): the memory increases observed on Qwen-2.5-1.5B and Llama-3.2-1B occur against checkpointed baselines, and in a controlled sweep against uncheckpointed baselines both models reduce peak memory by 7-8%.
Successful Page Load