Option 2 Turbo 4x 5090: micro_batch=16, grad_accum=2, ce_chunk=128
Browse files223 unmodified lines224225226227228229230223 unmodified linesloss = Noneif targets is not None:V = self.cfg.vocab_sizece_chunk = 256 # 256 tokens per chunk prevents 1GB+ tensor fragmentation during 64k vocab CEif shift_labels:# Shifted: predict token[i+1] from hidden[i]223 unmodified lines224225226227228229230223 unmodified linesloss = Noneif targets is not None:V = self.cfg.vocab_sizece_chunk = getattr(self.cfg, "ce_chunk", 128) # 128 tokens per chunk keeps intermediate logits <= 512MB even at batch 16if shift_labels:# Shifted: predict token[i+1] from hidden[i]
code/model.py+1-1