Lightning-AI / Lightning-AI/pytorch-lightning

Questions about loading a pre-trained model using lightnining CLI for continue training

Open
#20,217 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug lightningcli ver: 2.4.x
Dominant language
Python
Stars
31.4k
Forks
3.8k
Avg merge
6d 7h
Merged PRs (30d)
6

Description

### Bug description

Hi, I tried to load a pre-trained model using lightnining cli for continue training, which works well for single gpu case. However, for multiple gpu case, I meet a bug in the optimization process:
RuntimeError: !tensors.empty() INTERNAL ASSERT FAILED at "/opt/conda/conda-bld/pytorch_1712608853085/work/torch/csrc/distributed/c10d/reducer.cpp":2090, please report a bug to PyTorch.

In both rank 0 and rank 1 gpu cores. How to properly load models for multi gpu training with the help of cli? Thanks.

### What version are you seeing the problem on?

master

### How to reproduce the bug

```python
Please see the questions above.
```

### Error messages and logs

```
# Error messages and logs here please
```

### Environment

Current environment

```
#- PyTorch Lightning Version (e.g., 2.4.0):
#- PyTorch Version (e.g., 2.4):
#- Python version (e.g., 3.12):
#- OS (e.g., Linux):
#- CUDA/cuDNN version:
#- GPU models and configuration:
#- How you installed Lightning(`conda`, `pip`, source):
```

### More info

Nope

cc @mauvilsa

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the Lightning CLI pretrained-model loading flow with multiple GPUs, using the complete PyTorch, Lightning, CUDA, OS, and GPU environment details that are missing from the report. Compare it with the working single-GPU case and determine what is needed for continued training to complete without the PyTorch distributed reducer assertion.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, pytorch
Domain
cli, distributed-systems, machine-learning
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
18/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.