Skip to content

Commit af5cb70

Browse files
committed
test: add a different torch version for python 3.12
1 parent 46757f8 commit af5cb70

File tree

5 files changed

+70
-8
lines changed

5 files changed

+70
-8
lines changed

examples/BUILD.bazel

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,11 @@ lock(
6161
args = [
6262
"--emit-index-url",
6363
"--universal",
64-
"--python-version=3.14",
64+
# This means that the lowest supported version in the requirements file will
65+
# be 3.12
66+
"--python-version=3.12",
6567
],
66-
python_version = "3.14",
68+
# Means that we will pass the available 3.12 interpreter to the locking rule irrespective
69+
# of what we have in rules_python as the default toolchain.
70+
python_version = "3.12",
6771
)

examples/mytorch/BUILD.bazel

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
load("@rules_python//python:py_test.bzl", "py_test")
22

3+
py_test(
4+
name = "torch_test_old_python",
5+
srcs = ["torch_test.py"],
6+
main = "torch_test.py",
7+
python_version = "3.12",
8+
deps = ["@pip//torch"],
9+
)
10+
311
py_test(
412
name = "torch_test",
513
srcs = ["torch_test.py"],

examples/mytorch/MODULE.bazel

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,22 @@ python.defaults(
1717
python_version = "3.14",
1818
python_version_env = "BAZEL_PYTHON_VERSION",
1919
)
20+
python.toolchain(
21+
configure_coverage_tool = True,
22+
python_version = "3.12",
23+
)
2024
python.toolchain(
2125
configure_coverage_tool = True,
2226
python_version = "3.14",
2327
)
2428

2529
# Add the pip deps
2630
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
31+
pip.parse(
32+
hub_name = "pip",
33+
python_version = "3.12",
34+
requirements_lock = "requirements_lock.txt",
35+
)
2736
pip.parse(
2837
hub_name = "pip",
2938
python_version = "3.14",

examples/mytorch/requirements.in

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
torch
1+
torch==2.8.0; python_version < "3.13"
2+
torch==2.9.1; python_version >= "3.13"

examples/mytorch/requirements_lock.txt

Lines changed: 45 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,11 @@ nvidia-cusparselt-cu12==0.7.1 ; platform_machine == 'x86_64' and sys_platform ==
172172
--hash=sha256:f1bb701d6b930d5a7cea44c19ceb973311500847f81b634d802b7b539dc55623 \
173173
--hash=sha256:f67fbb5831940ec829c9117b7f33807db9f9678dc2a617fbe781cac17b4e1075
174174
# via torch
175-
nvidia-nccl-cu12==2.27.5 ; platform_machine == 'x86_64' and sys_platform == 'linux' \
175+
nvidia-nccl-cu12==2.27.3 ; python_full_version < '3.13' and platform_machine == 'x86_64' and sys_platform == 'linux' \
176+
--hash=sha256:9ddf1a245abc36c550870f26d537a9b6087fb2e2e3d6e0ef03374c6fd19d984f \
177+
--hash=sha256:adf27ccf4238253e0b826bce3ff5fa532d65fc42322c8bfdfaf28024c0fbe039
178+
# via torch
179+
nvidia-nccl-cu12==2.27.5 ; python_full_version >= '3.13' and platform_machine == 'x86_64' and sys_platform == 'linux' \
176180
--hash=sha256:31432ad4d1fb1004eb0c56203dc9bc2178a1ba69d1d9e02d64a6938ab5e40e7a \
177181
--hash=sha256:ad730cf15cb5d25fe849c6e6ca9eb5b76db16a80f13f425ac68d8e2e55624457
178182
# via torch
@@ -185,7 +189,7 @@ nvidia-nvjitlink-cu12==12.8.93 ; platform_machine == 'x86_64' and sys_platform =
185189
# nvidia-cusolver-cu12
186190
# nvidia-cusparse-cu12
187191
# torch
188-
nvidia-nvshmem-cu12==3.3.20 ; platform_machine == 'x86_64' and sys_platform == 'linux' \
192+
nvidia-nvshmem-cu12==3.3.20 ; python_full_version >= '3.13' and platform_machine == 'x86_64' and sys_platform == 'linux' \
189193
--hash=sha256:0b0b960da3842212758e4fa4696b94f129090b30e5122fea3c5345916545cff0 \
190194
--hash=sha256:d00f26d3f9b2e3c3065be895e3059d6479ea5c638a3f38c9fec49b1b9dd7c1e5
191195
# via torch
@@ -197,12 +201,40 @@ nvidia-nvtx-cu12==12.8.90 ; platform_machine == 'x86_64' and sys_platform == 'li
197201
setuptools==80.9.0 \
198202
--hash=sha256:062d34222ad13e0cc312a4c02d73f059e86a4acbfbdea8f8f76b28c99f306922 \
199203
--hash=sha256:f36b47402ecde768dbfafc46e8e4207b4360c654f1f3bb84475f0a28628fb19c
200-
# via torch
204+
# via
205+
# torch
206+
# triton
201207
sympy==1.14.0 \
202208
--hash=sha256:d3d3fe8df1e5a0b42f0e7bdf50541697dbe7d23746e894990c030e2b05e72517 \
203209
--hash=sha256:e091cc3e99d2141a0ba2847328f5479b05d94a6635cb96148ccb3f34671bd8f5
204210
# via torch
205-
torch==2.9.1 \
211+
torch==2.8.0 ; python_full_version < '3.13' \
212+
--hash=sha256:06fcee8000e5c62a9f3e52a688b9c5abb7c6228d0e56e3452983416025c41381 \
213+
--hash=sha256:0be92c08b44009d4131d1ff7a8060d10bafdb7ddcb7359ef8d8c5169007ea905 \
214+
--hash=sha256:1a62a1ec4b0498930e2543535cf70b1bef8c777713de7ceb84cd79115f553767 \
215+
--hash=sha256:220a06fd7af8b653c35d359dfe1aaf32f65aa85befa342629f716acb134b9710 \
216+
--hash=sha256:2b2f96814e0345f5a5aed9bf9734efa913678ed19caf6dc2cddb7930672d6128 \
217+
--hash=sha256:2f4ac52f0130275d7517b03a33d2493bab3693c83dcfadf4f81688ea82147d2e \
218+
--hash=sha256:5128fe752a355d9308e56af1ad28b15266fe2da5948660fad44de9e3a9e36e8c \
219+
--hash=sha256:5ae0524688fb6707c57a530c2325e13bb0090b745ba7b4a2cd6a3ce262572916 \
220+
--hash=sha256:619c2869db3ada2c0105487ba21b5008defcc472d23f8b80ed91ac4a380283b0 \
221+
--hash=sha256:65616ca8ec6f43245e1f5f296603e33923f4c30f93d65e103d9e50c25b35150b \
222+
--hash=sha256:659df54119ae03e83a800addc125856effda88b016dfc54d9f65215c3975be16 \
223+
--hash=sha256:7b677e17f5a3e69fdef7eb3b9da72622f8d322692930297e4ccb52fefc6c8211 \
224+
--hash=sha256:83c13411a26fac3d101fe8035a6b0476ae606deb8688e904e796a3534c197def \
225+
--hash=sha256:89aa9ee820bb39d4d72b794345cccef106b574508dd17dbec457949678c76011 \
226+
--hash=sha256:8c7ef765e27551b2fbfc0f41bcf270e1292d9bf79f8e0724848b1682be6e80aa \
227+
--hash=sha256:8f0a9d617a66509ded240add3754e462430a6c1fc5589f86c17b433dd808f97a \
228+
--hash=sha256:a3f16a58a9a800f589b26d47ee15aca3acf065546137fc2af039876135f4c760 \
229+
--hash=sha256:a7242b86f42be98ac674b88a4988643b9bc6145437ec8f048fea23f72feb5eca \
230+
--hash=sha256:b2aca0939fb7e4d842561febbd4ffda67a8e958ff725c1c27e244e85e982173c \
231+
--hash=sha256:c12fa219f51a933d5f80eeb3a7a5d0cbe9168c0a14bbb4055f1979431660879b \
232+
--hash=sha256:da6afa31c13b669d4ba49d8a2169f0db2c3ec6bec4af898aa714f401d4c38904 \
233+
--hash=sha256:e2fab4153768d433f8ed9279c8133a114a034a61e77a3a104dcdf54388838705 \
234+
--hash=sha256:e8e5bf982e87e2b59d932769938b698858c64cc53753894be25629bdf5cf2f46 \
235+
--hash=sha256:e9f071f5b52a9f6970dc8a919694b27a91ae9dc08898b2b988abbef5eddfd1ae
236+
# via -r examples/mytorch/requirements.in
237+
torch==2.9.1 ; python_full_version >= '3.13' \
206238
--hash=sha256:07c8a9660bc9414c39cac530ac83b1fb1b679d7155824144a40a54f4a47bfa73 \
207239
--hash=sha256:0a2bd769944991c74acf0c4ef23603b9c777fdf7637f115605a4b2d8023110c7 \
208240
--hash=sha256:0d06b30a9207b7c3516a9e0102114024755a07045f0c1d2f2a56b1819ac06bcb \
@@ -232,7 +264,15 @@ torch==2.9.1 \
232264
--hash=sha256:d187566a2cdc726fc80138c3cdb260970fab1c27e99f85452721f7759bbd554d \
233265
--hash=sha256:da5f6f4d7f4940a173e5572791af238cb0b9e21b1aab592bd8b26da4c99f1cd6
234266
# via -r examples/mytorch/requirements.in
235-
triton==3.5.1 ; platform_machine == 'x86_64' and sys_platform == 'linux' \
267+
triton==3.4.0 ; python_full_version < '3.13' and platform_machine == 'x86_64' and sys_platform == 'linux' \
268+
--hash=sha256:00be2964616f4c619193cb0d1b29a99bd4b001d7dc333816073f92cf2a8ccdeb \
269+
--hash=sha256:31c1d84a5c0ec2c0f8e8a072d7fd150cab84a9c239eaddc6706c081bfae4eb04 \
270+
--hash=sha256:7936b18a3499ed62059414d7df563e6c163c5e16c3773678a3ee3d417865035d \
271+
--hash=sha256:7b70f5e6a41e52e48cfc087436c8a28c17ff98db369447bcaff3b887a3ab4467 \
272+
--hash=sha256:7ff2785de9bc02f500e085420273bb5cc9c9bb767584a4aa28d6e360cec70128 \
273+
--hash=sha256:98e5c1442eaeabae2e2452ae765801bd53cd4ce873cab0d1bdd59a32ab2d9397
274+
# via torch
275+
triton==3.5.1 ; python_full_version >= '3.13' and platform_machine == 'x86_64' and sys_platform == 'linux' \
236276
--hash=sha256:02c770856f5e407d24d28ddc66e33cf026e6f4d360dcb8b2fabe6ea1fc758621 \
237277
--hash=sha256:0b4d2c70127fca6a23e247f9348b8adde979d2e7a20391bfbabaac6aebc7e6a8 \
238278
--hash=sha256:275a045b6ed670dd1bd005c3e6c2d61846c74c66f4512d6f33cc027b11de8fd4 \

0 commit comments

Comments
 (0)