Conversation
Member
Author
|
RFC: Is there a plan to hard code PJRT_DEVICE in the python script to replace the PJRT_DEVICE environment variable? @miladm |
will-cromar
reviewed
Jul 31, 2024
Collaborator
will-cromar
left a comment
There was a problem hiding this comment.
Thanks for the clean up!
@JackCaoG do you see any problem selecting $PJRT_DEVICE when we import torch_xla?
Collaborator
seems fine to me as long as we don't init the runtime yet. |
will-cromar
approved these changes
Aug 1, 2024
byi8220
added a commit
to byi8220/pytorch-lightning
that referenced
this pull request
Nov 23, 2024
Fixes Lightning-AI#20419 `torch_xla.runtime.using_pjrt()` is removed in pytorch/xla#7787 This PR replaces references to that function with a check to [`device_type()`](https://github.com/pytorch/xla/blob/master/torch_xla/runtime.py#L83) to recreate the behavior of that function, minus the manual initialization
7 tasks
lantiga
pushed a commit
to Lightning-AI/pytorch-lightning
that referenced
this pull request
Nov 25, 2024
…py for `torch-xla>=2.5` (#20442) * Replace `using_pjrt()` xla runtime `device_type()` check with in xla.py Fixes #20419 `torch_xla.runtime.using_pjrt()` is removed in pytorch/xla#7787 This PR replaces references to that function with a check to [`device_type()`](https://github.com/pytorch/xla/blob/master/torch_xla/runtime.py#L83) to recreate the behavior of that function, minus the manual initialization * Added tests/refactored for version compat * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * precommit --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #7730.
Now device are automatically detected when we import torch_xla: