KEMBAR78
Add current_device() to torch.cpu by wz337 · Pull Request #110987 · pytorch/pytorch · GitHub
Skip to content

Conversation

@wz337
Copy link
Contributor

@wz337 wz337 commented Oct 10, 2023

Better support device agnostic, add a "cpu" return for current_device() in torch.cpu so that we won't run into AttributeError: module 'torch.cpu' has no attribute 'current_device'.

cc @ptrblck @jgong5 @mingfeima @XiaobingSuper @sanchitintel @ashokei @jingxu10

@pytorch-bot
Copy link

pytorch-bot bot commented Oct 10, 2023

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/110987

Note: Links to docs will display an error until the docs builds have been completed.

✅ You can merge normally! (1 Unrelated Failure)

As of commit 253fb1d with merge base c5f06b9 (image):

FLAKY - The following job failed but was likely due to flakiness present on trunk:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@github-actions github-actions bot added the module: cpu CPU specific problem (e.g., perf, algorithm) label Oct 10, 2023
@wz337 wz337 added ciflow/trunk Trigger trunk jobs on your pull request release notes: cuda release notes category topic: new features topic category module: cuda Related to torch.cuda, and CUDA support in general labels Oct 10, 2023
@wz337 wz337 requested a review from albanD October 10, 2023 21:48
@wz337 wz337 marked this pull request as ready for review October 10, 2023 22:31
@wz337 wz337 force-pushed the device_agnostic_current_device branch from fee16e4 to 253fb1d Compare October 10, 2023 22:36
@wz337
Copy link
Contributor Author

wz337 commented Oct 11, 2023

@pytorchmergebot merge -i

@pytorchmergebot
Copy link
Collaborator

Merge started

Your change will be merged while ignoring the following 1 checks: pull / linux-jammy-py3.9-clang12-asan / test (default, 1, 6, linux.4xlarge)

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

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

Labels

ciflow/trunk Trigger trunk jobs on your pull request Merged module: cpu CPU specific problem (e.g., perf, algorithm) module: cuda Related to torch.cuda, and CUDA support in general release notes: cuda release notes category topic: new features topic category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants