mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-05-14 20:48:00 +00:00
Replace inline pip install with pip install from requirements*.txt (#21106)
### Description Replace inline pip install with pip install from requirements*.txt ### Motivation and Context so that CG can recognize ### Dependency - [x] https://github.com/microsoft/onnxruntime/pull/21085
This commit is contained in:
parent
17e9ea6235
commit
4e75605eec
4 changed files with 21 additions and 16 deletions
|
|
@ -261,9 +261,6 @@ def parse_arguments():
|
|||
"--wheel_name_suffix",
|
||||
help="Suffix to append to created wheel names. This value is currently only used for nightly builds.",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--numpy_version", help="Installs a specific version of numpy before building the python binding."
|
||||
)
|
||||
parser.add_argument("--skip-keras-test", action="store_true", help="Skip tests with Keras if keras is installed")
|
||||
|
||||
# C-Sharp bindings
|
||||
|
|
@ -868,16 +865,6 @@ def update_submodules(source_dir):
|
|||
run_subprocess(["git", "submodule", "update", "--init", "--recursive"], cwd=source_dir)
|
||||
|
||||
|
||||
def install_python_deps(numpy_version=""):
|
||||
dep_packages = ["setuptools", "wheel", "pytest"]
|
||||
dep_packages.append(f"numpy=={numpy_version}" if numpy_version else "numpy>=1.16.6")
|
||||
dep_packages.append("sympy>=1.10")
|
||||
dep_packages.append("packaging")
|
||||
dep_packages.append("cerberus")
|
||||
dep_packages.append("psutil")
|
||||
run_subprocess([sys.executable, "-m", "pip", "install", *dep_packages])
|
||||
|
||||
|
||||
def setup_test_data(source_onnx_model_dir, dest_model_dir_name, build_dir, configs):
|
||||
# create the symlink/shortcut of onnx models dir under build_dir
|
||||
# currently, there're 2 sources of onnx models, one is build in OS image, another is
|
||||
|
|
@ -2146,7 +2133,14 @@ def run_onnxruntime_tests(args, source_dir, ctest_path, build_dir, configs):
|
|||
numpy_init_version = numpy.__version__
|
||||
pb_init_version = google.protobuf.__version__
|
||||
run_subprocess(
|
||||
[sys.executable, "-m", "pip", "install", "-r", "requirements-transformers-test.txt"],
|
||||
[
|
||||
sys.executable,
|
||||
"-m",
|
||||
"pip",
|
||||
"install",
|
||||
"-r",
|
||||
"requirements/transformers-test/requirements.txt",
|
||||
],
|
||||
cwd=SCRIPT_DIR,
|
||||
)
|
||||
run_subprocess([sys.executable, "-m", "pytest", "transformers"], cwd=cwd)
|
||||
|
|
@ -2818,7 +2812,10 @@ def main():
|
|||
run_subprocess([emsdk_file, "activate", emsdk_version], cwd=emsdk_dir)
|
||||
|
||||
if args.enable_pybind and is_windows():
|
||||
install_python_deps(args.numpy_version)
|
||||
run_subprocess(
|
||||
[sys.executable, "-m", "pip", "install", "-r", "requirements/pybind/requirements.txt"],
|
||||
cwd=SCRIPT_DIR,
|
||||
)
|
||||
|
||||
if args.use_rocm and args.rocm_version is None:
|
||||
args.rocm_version = ""
|
||||
|
|
|
|||
|
|
@ -276,7 +276,7 @@ jobs:
|
|||
onnxruntimetrainingrocm-cibuild-rocm$(RocmVersion)-test \
|
||||
/bin/bash -c "
|
||||
set -ex; \
|
||||
pip install -r /onnxruntime_src/tools/ci_build/requirements-transformers-test.txt; \
|
||||
pip install -r /onnxruntime_src/tools/ci_build/requirements/transformers-test/requirements.txt; \
|
||||
pytest /onnxruntime_src/onnxruntime/test/python/transformers/test_flash_attn_rocm.py -v -n 4 --reruns 1"
|
||||
workingDirectory: $(Build.SourcesDirectory)
|
||||
displayName: 'Run tranformers tests'
|
||||
|
|
|
|||
8
tools/ci_build/requirements/pybind/requirements.txt
Normal file
8
tools/ci_build/requirements/pybind/requirements.txt
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
setuptools
|
||||
wheel
|
||||
pytest
|
||||
numpy>=1.19.0
|
||||
sympy>=1.10
|
||||
packaging
|
||||
cerberus
|
||||
psutil
|
||||
Loading…
Reference in a new issue