Model not saving when using distributed training
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 536
- Forks
- 69
- Avg merge
- 20h 29m
- Merged PRs (30d)
- 1
Description
Hi -
I am trying to use the DECIModule with distributed training on 4 GPUs. Saving the model in the distributed case yields an empty module whereas when training on one GPU I save the anticipated model with sem_module.
Is there a known approach to saving the model properly in the distributed training case? I am using the pytorch default DDP strategy.
trainer = pl.Trainer(
accelerator="gpu",
devices=4, # distribute training
max_epochs=1000,
fast_dev_run=test_run,
callbacks=[TQDMProgressBar(refresh_rate=19), checkpoint_callback],
enable_checkpointing=True,
)
# Training the model
trainer.fit(lightning_module, datamodule=data_module)
torch.save(lightning_module.sem_module, "model.pt")
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the DECIModule and the trainer setup shown in the issue, then compare the distributed and single-GPU paths around sem_module and checkpoint_callback. Reproduce the empty module result with the four-GPU DDP configuration and verify that the saved model contains the expected sem_module after training.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, pytorch
- Domain
- distributed-systems, machine-learning
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100