Skip to content

[release/2.13] Fix test_dataloader tests for python 3.14 (#3740) - #3928

Open
BLOrange-AMD wants to merge 1 commit into
release/2.13from
bl/dataloader_py3.14_fix_2.13
Open

BLOrange-AMD wants to merge 1 commit into
release/2.13from
bl/dataloader_py3.14_fix_2.13

Conversation

@BLOrange-AMD

Copy link
Copy Markdown

Cherry-pick of #3740

forkserver preloads __main__ and then os.fork()s workers (this preload
actually runs on Python 3.14). Importing this module calls
torch.cuda.is_available(), which registers the CUDA atfork handler, so
those workers cannot initialize CUDA. Leave __main__ out of the preload
so forkserver CUDA workers still start from a clean interpreter.

Fixed unit tests:
test_dataloader.py::TestDataLoader::test_multiprocessing_contexts

test_dataloader.py::TestDataLoaderPersistentWorkers::test_multiprocessing_contexts

test_dataloader.py::TestDataLoaderDeviceTypeCUDA::test_nested_tensor_multiprocessing_context_forkserver_cuda

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant