Skip to content

Non-record: QNA + SQWA compression thesis (8xH100 SXM)#975

Open
Abhishek8108 wants to merge 1 commit intoopenai:mainfrom
Abhishek8108:qna-sqwa-compression-thesis
Open

Non-record: QNA + SQWA compression thesis (8xH100 SXM)#975
Abhishek8108 wants to merge 1 commit intoopenai:mainfrom
Abhishek8108:qna-sqwa-compression-thesis

Conversation

@Abhishek8108
Copy link
Copy Markdown

Summary

Non-record submission documenting a controlled 3-run ablation on 8xH100 SXM testing whether training for the quantized artifact directly improves post-quantization BPB.

  • Quantization Noise Annealing (QNA): Inject uniform noise matching int6 quant error during training, scaled by LR. Teaches weight robustness to quantization from the start.
  • Stochastic Quantized Weight Averaging (SQWA): Average quantize-dequantized EMA snapshots during warmdown, ensuring the final model lives in the quant-friendly subspace.

Results

Run Config Sliding Window val_bpb Quant Gap (float→int6) Artifact Size
1 Baseline 1.1216 0.0081 15.93 MB
2 +QNA 1.1222 0.0075 15.95 MB
3 +QNA+SQWA 1.1258 0.0028 16.15 MB

Interesting negative result: Both techniques work mechanistically — QNA reduced quant gap by 7%, SQWA by 65%. But neither improved the final leaderboard metric. The bottleneck in current SOTA is float model quality, not quantization error.

Key takeaway

With a baseline quant gap of only ~0.008 BPB, the existing late QAT already handles quantization well enough. Future improvements should target the float model directly rather than compression alignment.

Files

  • train_gpt.py — full script with QNA/SQWA (env-var toggleable, defaults off)
  • run1_base.log, run2_qna.log, run3_qna_sqwa.log — complete training logs
  • README.md — detailed write-up with implementation details and analysis
  • submission.json — metadata

Controlled 3-run ablation testing whether Quantization Noise Annealing
and Stochastic Quantized Weight Averaging improve post-quantization BPB.

Results: QNA reduced quant gap by 7%, QNA+SQWA by 65%, but neither
improved the final sliding-window metric (1.1216 baseline vs 1.1258
QNA+SQWA). The bottleneck in current SOTA is float model quality,
not quantization error.
@MatoTeziTanka
Copy link
Copy Markdown

Community Review — Non-record: QNA + SQWA compression thesis (8xH100 SXM)

BPB: 0.008 (cache parse — may be delta/std, not val_bpb; check PR title) | Compliance: LOOKS CLEAN — score-first-per-chunk TTT (legal #1416/#1423 pattern)

What I found in the code (head SHA fe607e10da11, file records/track_non_record_16mb/2026-03-27_QNA_SQWA_CompressionThesis_8xH100/train_gpt.py):

The TTT path at line 1044 implements the score-first-per-chunk pattern: each chunk is scored under torch.no_grad() / inference_mode() before the base_model.train() + SGD adaptation runs on that same chunk, with an is_last_chunk guard so the final chunk gets no adaptation pass. This is the structural shape the legal frontier uses (PRs #1416 erichroepke, #1423 aryanbhosale).

Per Issue #402 and Issue #677, TTT is legal when each token is scored before the adapter updates on it, and that's what the code does here — chunk ci is scored under weights adapted only on chunks 0..ci-1. No prequant_ttt_adapt_adamw(val_tokens, ...) multi-epoch fine-tune, no scored-region SLOT, no target-in-key n-gram cache.

CPU smoke test (CT2038 proteus-engine, 2026-04-11): import OK in 0.06s, dim=512, layers=11, vocab=1024, code=89824 B, SMOKE_TEST_PASS

Verdict: LOOKS CLEAN.

Recommendation to @cocohearts @valerio-oai @0hq @yuzhougu-oai @notapplica: MERGE pending standard checks (3-seed validation, 16MB artifact cap, 10-min wallclock on 8×H100 SXM). The compliance picture matches the legal reference frontier and no flags were raised by the classification pass.

Auto-classification caveat: this review was drafted by the AST-based classifier against a template derived from manually-reviewed cluster PRs (#1420, #1450, #1487, #1541, #1529, #1533, #1518). If I've misread a subtlety in your eval path — e.g., multi-epoch TTT that I mistook for single-pass, or a target-in-key lookup I missed in a helper function — please flag it and I'll re-run the audit manually.


Reviewed by @MatoTeziTankaThe Agora. CPU smoke test (CT2038 proteus-engine, 2026-04-11): import OK in 0.06s, dim=512, layers=11, vocab=1024, code=89824 B, SMOKE_TEST_PASS. Classification via deterministic AST-based classify_prs.py (pattern bank derived from ~65 manually-reviewed PRs earlier in the 2026-04-11 sweep). This review was auto-drafted from a template and spot-checked before posting — if the template misread your code, please call it out so I can iterate the classifier.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants