install torch and subdependencies at runtime pending compute type - #51
Draft
chelseatroy wants to merge 2 commits into
Draft
install torch and subdependencies at runtime pending compute type#51chelseatroy wants to merge 2 commits into
chelseatroy wants to merge 2 commits into
Conversation
chelseatroy
marked this pull request as draft
October 22, 2025 18:45
Dexterp37
reviewed
Oct 23, 2025
| import torch | ||
| assert not torch.cuda.is_available(), "This step should be CPU-only." | ||
|
|
||
| import torchvision |
Collaborator
There was a problem hiding this comment.
@chelseatroy I believe the solution here is not to hack around the torchvision-cpu install, but rather move the whole transform dance to the GPU-enable steps or to use the NVIDIA decorator here too.
For non-trivial uses, we'd still want to do dataset processing on a GPU.
| @pypi( | ||
| python="3.11.9", | ||
| packages={"torch": "2.4.1", "torchvision": "0.19.1", "mozmlops": "0.1.4"}, | ||
| packages={"mozmlops": "0.1.4"} # intentionally omit torch/torchvision here |
Collaborator
There was a problem hiding this comment.
Why do we need to omit the dependencies here?
| RuntimeImportHelper.ensure_cpu_torch() | ||
|
|
||
| import torch | ||
| assert not torch.cuda.is_available(), "This step should be CPU-only." |
Collaborator
There was a problem hiding this comment.
@chelseatroy the 'nvct' decorator will be discontinued after November. If moving all the steps to nvct solves the problem, let's do that instead
…o, so the flow works out of the box
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.
Goal(s) of this Pull Request:
Example of how it works:
...
Acceptance criteria:
In order to approve, reviewer must be able to...