[AIR] <Part 1> Add LightningTrainer to support Pytorch Lightning DDP training. - #33161
Conversation
Signed-off-by: woshiyyya <xiaoyunxuan1998@gmail.com>
Signed-off-by: woshiyyya <xiaoyunxuan1998@gmail.com>
Signed-off-by: woshiyyya <xiaoyunxuan1998@gmail.com>
Signed-off-by: woshiyyya <xiaoyunxuan1998@gmail.com>
14e3ee3 to
01f9461
Compare
Signed-off-by: woshiyyya <xiaoyunxuan1998@gmail.com>
Signed-off-by: woshiyyya <xiaoyunxuan1998@gmail.com>
Signed-off-by: woshiyyya <xiaoyunxuan1998@gmail.com>
Signed-off-by: woshiyyya <xiaoyunxuan1998@gmail.com>
|
great work @woshiyyya! |
Co-authored-by: Amog Kamsetty <amogkam@users.noreply.github.com> Co-authored-by: Justin Yu <justinvyu@anyscale.com> Signed-off-by: Yunxuan Xiao <xiaoyunxuan1998@gmail.com>
Signed-off-by: woshiyyya <xiaoyunxuan1998@gmail.com>
Signed-off-by: woshiyyya <xiaoyunxuan1998@gmail.com>
Signed-off-by: woshiyyya <xiaoyunxuan1998@gmail.com>
Signed-off-by: woshiyyya <xiaoyunxuan1998@gmail.com>
Signed-off-by: woshiyyya <xiaoyunxuan1998@gmail.com>
Signed-off-by: woshiyyya <xiaoyunxuan1998@gmail.com>
gjoliver
left a comment
There was a problem hiding this comment.
looks quite solid. only a few minor comments.
| def _train_dataloader() -> TRAIN_DATALOADERS: | ||
| assert train_dataset | ||
| ds = RayIterableDataset(train_dataset, dataset_iter_config) | ||
| return DataLoader(ds, batch_size=1, collate_fn=lambda x: x[0]) |
There was a problem hiding this comment.
why would iter_torch_batches() add an extra dim of 1 here???
| ``pytorch_lightning.Trainer.fit``. | ||
|
|
||
| Example: | ||
| .. code-block:: python |
Signed-off-by: woshiyyya <xiaoyunxuan1998@gmail.com>
Signed-off-by: woshiyyya <xiaoyunxuan1998@gmail.com>
There was a problem hiding this comment.
Lgtm overall
- now that the api is finalized, can we test the docstring?
- Can we add a multi-node, multi-gpu release test as the next followup PR? We want to validate that multi node gpu training is working as soon as possible. We can just rewrite the existing ray Lightning release test.
| """Configuration Class to pass into LightningTrainer. | ||
|
|
||
| Example: | ||
| .. code-block:: python |
There was a problem hiding this comment.
Can we test this code snippet now that the api has been finalized?
There was a problem hiding this comment.
Just replace code-block with test-code, and I think that should work
There was a problem hiding this comment.
Sure thing. My plan is to create a separate PR for release tests. I've tested on workspace that multi-node multi-machine training works. Also I wrote some ci tests with single-node multi-gpu setting which also work. I'll post a PR tomorrow to address these testing issues.
There was a problem hiding this comment.
For the code in docstring, I'll test it as well, together with the release test PR.
β¦<Part 1>. (ray-project#33161) * init Lightning Trainer with ci tests Signed-off-by: woshiyyya <xiaoyunxuan1998@gmail.com> Signed-off-by: Jack He <jackhe2345@gmail.com>
β¦<Part 1>. (ray-project#33161) * init Lightning Trainer with ci tests Signed-off-by: woshiyyya <xiaoyunxuan1998@gmail.com> Signed-off-by: Edward Oakes <ed.nmi.oakes@gmail.com>
β¦<Part 1>. (ray-project#33161) * init Lightning Trainer with ci tests Signed-off-by: woshiyyya <xiaoyunxuan1998@gmail.com>
β¦<Part 1>. (ray-project#33161) * init Lightning Trainer with ci tests Signed-off-by: woshiyyya <xiaoyunxuan1998@gmail.com> Signed-off-by: elliottower <elliot@elliottower.com>
β¦<Part 1>. (ray-project#33161) * init Lightning Trainer with ci tests Signed-off-by: woshiyyya <xiaoyunxuan1998@gmail.com> Signed-off-by: Jack He <jackhe2345@gmail.com>
Why are these changes needed?
There will be a list of PRs for PyTorch Lightning Integration. This is the first one.
Content for this PR:
Related issue number
Checks
git commit -s) in this PR.scripts/format.shto lint the changes in this PR.