Skip to content
Merged
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
2 changes: 1 addition & 1 deletion torchx/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ CUDA versions. The current supported targets are:
- `cu118` CUDA 11.8 and CPU version (no macOS support, libtorch `< 2.8.0` only)
- `cu126` CUDA 12.6 and CPU version (no macOS support)
- `cu128` CUDA 12.8 and CPU version (no macOS support)
- `cu129` CUDA 12.9 and CPU version (no macOS support, libtorch `>= 2.8.0` only)
- `cu130` CUDA 13.0 and CPU version (no macOS support, libtorch `>= 2.9.0` only)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- `cu128` CUDA 12.8 and CPU version (no macOS support)
- `cu129` CUDA 12.9 and CPU version (no macOS support, libtorch `>= 2.8.0` only)
- `cu130` CUDA 13.0 and CPU version (no macOS support, libtorch `>= 2.9.0` only)
- `cu128` CUDA 12.8 and CPU version (no macOS support)
- `cu129` CUDA 12.9 and CPU version (no macOS support, libtorch `>= 2.8.0 && < 2.9.0` only)
- `cu130` CUDA 13.0 and CPU version (no macOS support, libtorch `>= 2.9.0` only)

Copy link
Contributor Author

@stewartj3 stewartj3 Oct 18, 2025

Choose a reason for hiding this comment

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

With the constant updates in supported CUDA versions it may be easier to display this a a table with torch version and support CUDA versions as the columns.

torch supported CUDA versions
2.7.0 cu118, cu126, cu128
2.8.0 cu126, cu128, cu129
2.9.0 cu126, cu128, cu130

Copy link
Contributor

Choose a reason for hiding this comment

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

I like that idea

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated the readme with the new table.


Once downloaded, we will compile `Torchx` bindings. You will need `make`/`nmake`,
`cmake` (3.12+) and a `C++` compiler. If building on Windows, you will need:
Expand Down
10 changes: 5 additions & 5 deletions torchx/mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,12 @@ defmodule Torchx.MixProject do

defp libtorch_config() do
target = System.get_env("LIBTORCH_TARGET", "cpu")
version = System.get_env("LIBTORCH_VERSION", "2.8.0")
version = System.get_env("LIBTORCH_VERSION", "2.9.0")
env_dir = System.get_env("LIBTORCH_DIR")

# 2.8.0 is the first version that supports cu129 and drops cu118
# cu118 might still be needed for older hardware, so we're keeping it
# for now.
# cu118 support was dropped in 2.8, which might still be needed for older hardware,
# so we're keeping it for now.
# cu129 was supported in 2.8, but replaced with cu130 in 2.9.
valid_targets = ["cpu", "cu118", "cu126", "cu128"]

valid_targets =
Expand All @@ -89,7 +89,7 @@ defmodule Torchx.MixProject do
if Version.match?(parsed, "<= 2.7.0") do
valid_targets
else
(valid_targets -- ["cu118"]) ++ ["cu129"]
(valid_targets -- ["cu118"]) ++ ["cu130"]
end
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
if Version.match?(parsed, "<= 2.7.0") do
valid_targets
else
(valid_targets -- ["cu118"]) ++ ["cu129"]
(valid_targets -- ["cu118"]) ++ ["cu130"]
end
cond do
Version.match?(parsed, "< 2.8.0") ->
valid_targets
Version.match?(parsed, "< 2.9.0") ->
(valid_targets -- ["cu118"]) ++ ["cu129"]
true ->
(valid_targets -- ["cu118"]) ++ ["cu130"]
end

Copy link
Contributor

Choose a reason for hiding this comment

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

maybe even just have explicit lists in each clause

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Having a supported CUDA list for each version (or when libtorch changes the supported CUDA versions) would be easy to maintain. These only change every few months and are easy to update when adding a new version.


_ ->
Expand Down