Speed optimization: set DDP find_unused_parameters=False
Browse files- model/scripts/train.py +3 -3
model/scripts/train.py
CHANGED
|
@@ -1476,10 +1476,10 @@ def main():
|
|
| 1476 |
str(C("compile_mode", "reduce-overhead")), args.smoke, R0,
|
| 1477 |
device=device, vocab_size=margs.vocab_size)
|
| 1478 |
if use_dist and not args.smoke:
|
| 1479 |
-
#
|
| 1480 |
-
model = torch.nn.parallel.DistributedDataParallel(model, device_ids=[device.index], find_unused_parameters=
|
| 1481 |
if R0:
|
| 1482 |
-
print(f"[dist] DDP wrapped (find_unused=
|
| 1483 |
ckpt_model = model.module if (use_dist and not args.smoke) else model # ckpt bina module. prefix ke (resume-safe)
|
| 1484 |
total, active = ckpt_model.param_counts()
|
| 1485 |
if R0:
|
|
|
|
| 1476 |
str(C("compile_mode", "reduce-overhead")), args.smoke, R0,
|
| 1477 |
device=device, vocab_size=margs.vocab_size)
|
| 1478 |
if use_dist and not args.smoke:
|
| 1479 |
+
# All 242M parameters are 100% active in vectorized MoE -> find_unused_parameters=False (maximum throughput)
|
| 1480 |
+
model = torch.nn.parallel.DistributedDataParallel(model, device_ids=[device.index], find_unused_parameters=False)
|
| 1481 |
if R0:
|
| 1482 |
+
print(f"[dist] DDP wrapped (find_unused=False, micro={batch} accum={accum} synced)")
|
| 1483 |
ckpt_model = model.module if (use_dist and not args.smoke) else model # ckpt bina module. prefix ke (resume-safe)
|
| 1484 |
total, active = ckpt_model.param_counts()
|
| 1485 |
if R0:
|