Skip to content

fix: supcon oom - #48

Merged
EYH0602 merged 2 commits into
mainfrom
fix/supcon-oom
Feb 7, 2026
Merged

EYH0602 merged 2 commits into
mainfrom
fix/supcon-oom

Conversation

@EYH0602

@EYH0602 EYH0602 commented Feb 7, 2026

Copy link
Copy Markdown
Member

No description provided.

…ted batch

The DDP single-forward fix doubled the logit tensor [2B, seq, vocab]
causing OOM on single GPU. Split MLM head computation into two halves
so only [B, seq, vocab] logits are materialized at a time.
RobertaForMaskedLM.forward() always materializes [N, seq, vocab] logits.
With the concatenated 2B batch from the DDP fix, this doubled peak memory
(~13 GB logits on batch_size=64, seq=512) causing OOM on A100-80GB.

Introduce SplitHeadWrapper that runs the encoder on the full batch but
applies the LM head per-chunk, halving peak logit memory. DDP wraps the
wrapper so gradient sync works correctly.
@EYH0602
EYH0602 merged commit c9e0553 into main Feb 7, 2026
3 checks passed
@EYH0602
EYH0602 deleted the fix/supcon-oom branch February 7, 2026 22:29
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.

1 participant