Lightning-AI / Lightning-AI/lightning-thunder
`use_cuda` deprecated, switch to `use_device = cuda` instead
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1.5k
- Forks
- 121
- PR merge metrics
- No merged PRs in 30d
Description
Our nightly (but not 2.3) CI jobs are spitting out warnings:
```
thunder/tests/distributed/test_ddp.py::CompileDDPTest::test_ddp_model_as_argument PASSED
/usr/local/lib/python3.10/dist-packages/torch/autograd/profiler.py:215: UserWarning: The attribute `use_cuda` will be deprecated soon, please use ``use_device = 'cuda'`` instead.
warn(
/usr/local/lib/python3.10/dist-packages/torch/autograd/profiler.py:215: UserWarning: The attribute `use_cuda` will be deprecated soon, please use ``use_device = 'cuda'`` instead.
warn(
thunder/tests/distributed/test_ddp.py::CompileDDPTest::test_ddp_with_no_sync_grad_accumulation_executor_nvfuser_bucket_size_in_mb_0_dataset_size_1 PASSED
```
See https://dev.azure.com/Lightning-AI/lightning/_build/results?buildId=202858&view=logs&jobId=b97dbf6d-98bd-5b68-7c01-878b39c3da28&j=b97dbf6d-98bd-5b68-7c01-878b39c3da28&t=3c72ede2-92c1-5cd2-2bac-ad2411af2aea for example.
Questions:
* Is this `use_device = cuda` possible in torch 2.3, such that we could switch to it w/o any if statements?
* why is the profiler getting pulled in to our distributed tests? do these just always get imported? is there a way we could prevent it from being imported, to limit our surface area?
* how important is this? It's not clear (to me at least) what timeline "deprecated soon" implies
cc @borda @carmocca @crcrpar
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 thunder/tests/distributed/test_ddp.py and reproduce the nightly warning in the affected distributed tests. Check whether torch 2.3 supports the suggested profiler argument and trace why the profiler is imported there. Done means resolving the compatibility question and removing the deprecation warning without breaking the tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, pytorch
- Domain
- distributed-systems
- Issue type
- Refactor
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100