Skip to content
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
2 changes: 1 addition & 1 deletion .github/workflows/windows_build_x64_asan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@ jobs:
@echo off
echo %PATH%
python -m pip install -r "%GITHUB_WORKSPACE%\tools\ci_build/github/windows\python\requirements.txt"
python "%GITHUB_WORKSPACE%\tools\ci_build\build.py" --config Debug --build_dir "%RUNNER_TEMP%\build" --skip_submodule_sync --parallel --use_vcpkg --use_vcpkg_ms_internal_asset_cache --cmake_generator "Visual Studio 17 2022" --disable_memleak_checker --enable_address_sanitizer
python "%GITHUB_WORKSPACE%\tools\ci_build\build.py" --config Debug --build_dir "%RUNNER_TEMP%\build" --skip_submodule_sync --parallel --test_parallel 4 --use_vcpkg --use_vcpkg_ms_internal_asset_cache --cmake_generator "Visual Studio 17 2022" --disable_memleak_checker --enable_address_sanitizer
11 changes: 10 additions & 1 deletion tools/ci_build/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,12 @@ def number_of_parallel_jobs(args):
return os.cpu_count() if args.parallel == 0 else args.parallel


def number_of_test_parallel_jobs(args):
if args.test_parallel is None:
return number_of_parallel_jobs(args)
return os.cpu_count() if args.test_parallel == 0 else args.test_parallel


def number_of_nvcc_threads(args):
if args.nvcc_threads >= 0:
return args.nvcc_threads
Expand Down Expand Up @@ -1728,7 +1734,7 @@ def run_onnxruntime_tests(args, source_dir, ctest_path, build_dir, configs):
test_output = f"--gtest_output=xml:{cwd}/{exe}.{config}.results.xml"
run_subprocess([os.path.join(cwd, exe), test_output], cwd=cwd, dll_path=dll_path)
else:
num_parallel_jobs = number_of_parallel_jobs(args)
num_parallel_jobs = number_of_test_parallel_jobs(args)
ctest_cmd = [
ctest_path,
"--build-config",
Expand Down Expand Up @@ -2574,6 +2580,9 @@ def main():
build_targets(args, cmake_path, build_dir, configs, num_parallel_jobs, args.targets)

if args.test:
if args.test_parallel is not None and args.test_parallel < 0:
raise BuildError(f"Invalid test parallel job count: {args.test_parallel}")

if args.enable_onnx_tests:
source_onnx_model_dir = "C:\\local\\models" if is_windows() else "/data/models"
setup_test_data(source_onnx_model_dir, "models", build_dir, configs)
Expand Down
6 changes: 6 additions & 0 deletions tools/ci_build/build_args.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,12 @@ def add_testing_args(parser: argparse.ArgumentParser) -> None:
parser.add_argument("--skip_winml_tests", action="store_true", help="Explicitly disable WinML related tests.")
parser.add_argument("--skip_nodejs_tests", action="store_true", help="Explicitly disable Node.js binding tests.")
parser.add_argument("--ctest_timeout", default="10800", help="Timeout provided to CTest --timeout (seconds).")
parser.add_argument(
"--test_parallel",
default=None,
type=int,
help="Max CTest parallel jobs. Defaults to --parallel. Optional value 0 uses num CPUs.",
)
parser.add_argument("--enable_transformers_tool_test", action="store_true", help="Enable transformers tool test.")
parser.add_argument("--build_micro_benchmarks", action="store_true", help="Build ONNXRuntime micro-benchmarks.")
parser.add_argument("--code_coverage", action="store_true", help="Generate code coverage report (Android only).")
Expand Down
Loading