lightning-thunder icon indicating copy to clipboard operation
lightning-thunder copied to clipboard

`use_cuda` deprecated, switch to `use_device = cuda` instead

Open tfogal opened this issue 1 year ago • 0 comments

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

tfogal avatar May 20 '24 21:05 tfogal