Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update transformers test requirements #22911

Merged
merged 4 commits into from
Nov 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
12 changes: 12 additions & 0 deletions tools/ci_build/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -2074,6 +2074,17 @@ def run_onnxruntime_tests(args, source_dir, ctest_path, build_dir, configs):
if is_windows():
cwd = os.path.join(cwd, config)

if args.enable_transformers_tool_test and not args.disable_contrib_ops and not args.use_rocm:
# PyTorch is required for transformers tests, and optional for some python tests.
# Install cpu only version of torch when cuda is not enabled in Linux.
extra = [] if args.use_cuda and is_linux() else ["--index-url", "https://download.pytorch.org/whl/cpu"]
kunal-vaishnavi marked this conversation as resolved.
Show resolved Hide resolved
run_subprocess(
[sys.executable, "-m", "pip", "install", "torch", *extra],
cwd=cwd,
dll_path=dll_path,
python_path=python_path,
)

run_subprocess(
[sys.executable, "onnxruntime_test_python.py"], cwd=cwd, dll_path=dll_path, python_path=python_path
)
Expand Down Expand Up @@ -2128,6 +2139,7 @@ def run_onnxruntime_tests(args, source_dir, ctest_path, build_dir, configs):
dll_path=dll_path,
python_path=python_path,
)

if not args.disable_contrib_ops:
run_subprocess(
[sys.executable, "-m", "unittest", "discover", "-s", "quantization"], cwd=cwd, dll_path=dll_path
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# packages used by transformers python unittest (only enabled in Linux CPU CI Pipeline)
# packages used by transformers python unittest
packaging
protobuf==3.20.2
numpy==1.24.0 ; python_version < '3.12'
numpy==1.26.0 ; python_version >= '3.12'
# protobuf and numpy is same as tools/ci_build/github/linux/docker/scripts/manylinux/requirements.txt
protobuf==4.21.12
numpy==1.21.6 ; python_version < '3.9'
numpy==2.0.0 ; python_version >= '3.9'
torch
coloredlogs==15.0
transformers==4.46.3
Expand Down
Loading