Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ transforms = [
"torchvision", # Needed for megatron.energon.transforms
]

# Special cpu-only pytorch dependency (see below in tool.uv.sources)
cpu-only = [
"torch",
]


# Storage services for MSC
s3 = [
"multi-storage-client[boto3]",
Expand Down Expand Up @@ -111,3 +117,12 @@ exclude = [
"docs",
]

[tool.uv.sources]
torch = [
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you check that it doesn't also override torch to CPU when not using the "cpu-only" extra?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, found out that this is actually broken. It would now always use the cpu version :-/ Reverted that change now, added instructions for uv tool.

{ index = "pytorch-cpu", extra = "cpu-only" },
]

[[tool.uv.index]]
name = "pytorch-cpu"
url = "https://download.pytorch.org/whl/cpu"
explicit = true
Loading
Loading