Skip to content

Commit 036fde0

Browse files
authored
[Build] Lock torch, onnxscript and onnx-ir versions to latest (microsoft#26315)
To fix build pipeline error `ModuleNotFoundError: No module named 'onnxscript._framework_apis.torch_2_9'` after recent torch 2.9 release. This locks torch version to 2.8, and also updates onnxscript and onnx-ir to latest versions. I locked torchvision version since it is usually installed with torch together. If torch and torchvision are not compatible, there might be errors in transformers script.
1 parent f0015b9 commit 036fde0

File tree

5 files changed

+11
-10
lines changed

5 files changed

+11
-10
lines changed

tools/ci_build/build.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1751,7 +1751,7 @@ def run_onnxruntime_tests(args, source_dir, ctest_path, build_dir, configs):
17511751
# Install cpu only version of torch when cuda is not enabled in Linux.
17521752
extra = [] if args.use_cuda and is_linux() else ["--index-url", "https://download.pytorch.org/whl/cpu"]
17531753
run_subprocess(
1754-
[sys.executable, "-m", "pip", "install", "torch", *extra],
1754+
[sys.executable, "-m", "pip", "install", "torch==2.8.0", "torchvision==0.23.0", *extra],
17551755
cwd=cwd,
17561756
dll_path=dll_path,
17571757
python_path=python_path,

tools/ci_build/github/linux/docker/scripts/requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ sympy==1.14
1010
flatbuffers
1111
protobuf==4.25.1
1212
packaging
13-
onnxscript==0.3.2
14-
onnx-ir
13+
onnxscript==0.5.3
14+
onnx-ir==0.1.10

tools/ci_build/github/linux/python/requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ protobuf==4.25.1
88
sympy==1.14
99
flatbuffers
1010
psutil
11-
onnxscript==0.3.2
12-
onnx-ir
11+
onnxscript==0.5.3
12+
onnx-ir==0.1.10
1313
jinja2
1414
markupsafe

tools/ci_build/github/windows/python/requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ protobuf==4.25.1
88
sympy==1.14
99
flatbuffers
1010
psutil
11-
onnxscript==0.3.2
12-
onnx-ir
11+
onnxscript==0.5.3
12+
onnx-ir==0.1.10
1313
jinja2
1414
markupsafe
1515
semver

tools/ci_build/requirements/transformers-test/requirements.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@ packaging
33
# protobuf and numpy is same as tools/ci_build/github/linux/docker/scripts/manylinux/requirements.txt
44
protobuf==4.25.1
55
numpy==2.2.6
6-
torch>=2.6.0
6+
torch==2.8.0
7+
torchvision==0.23.0
78
coloredlogs==15.0
89
transformers==4.52.1
910
parameterized>=0.8.1
1011
sentencepiece
1112
psutil
1213
einops
13-
onnxscript==0.3.2
14-
onnx-ir
14+
onnxscript==0.5.3
15+
onnx-ir==0.1.10

0 commit comments

Comments
 (0)