Skip to content

Commit

Permalink
Final tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
stellaraccident committed Jan 28, 2024
1 parent 588988b commit e8f5536
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
9 changes: 4 additions & 5 deletions build_tools/ci/build_posix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,9 @@ export CMAKE_CXX_COMPILER_LAUNCHER=ccache
# Clear ccache stats.
ccache -z

echo "Configuring torch-mlir"
echo "======================"

cd $repo_root

echo "::group::CMake configure"
cmake -S "$repo_root/externals/llvm-project/llvm" -B "$build_dir" \
-GNinja \
-DCMAKE_BUILD_TYPE=Release \
Expand All @@ -52,10 +50,11 @@ cmake -S "$repo_root/externals/llvm-project/llvm" -B "$build_dir" \
-DLLVM_TARGETS_TO_BUILD=host \
-DMLIR_ENABLE_BINDINGS_PYTHON=ON \
-DTORCH_MLIR_ENABLE_LTC=ON
echo "::endgroup::"

echo "Building all"
echo "------------"
echo "::group::Build"
cmake --build "$build_dir" --target tools/torch-mlir/all -- -k 0
echo "::endgroup::"

# Show ccache stats.
ccache --show-stats
Empty file modified build_tools/ci/check_generated_sources.sh
100644 → 100755
Empty file.
4 changes: 2 additions & 2 deletions projects/pt1/python/torch_mlir_e2e_test/framework.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,15 +325,15 @@ def compile_and_run_test(test: Test, config: TestConfig, verbose=False) -> Any:

def run_tests(tests: List[Test], config: TestConfig, sequential=False, verbose=False) -> List[TestResult]:
"""Invoke the given `Test`'s with the provided `TestConfig`."""
num_processes = min(int(mp.cpu_count() / 2) + 1, len(tests))
num_processes = min(int(mp.cpu_count() * 0.8) + 1, len(tests))
try:
env_concurrency = int(os.getenv("TORCH_MLIR_TEST_CONCURRENCY", "0"))
except ValueError as e:
raise ValueError("Bad value for TORCH_MLIR_TEST_CONCURRENCY env var: "
"Expected integer.") from e
if env_concurrency > 0:
num_processes = min(num_processes, env_concurrency)

# TODO: We've noticed that on certain 2 core machine parallelizing the tests
# makes the llvm backend legacy pass manager 20x slower than using a
# single process. Need to investigate the root cause eventually. This is a
Expand Down

0 comments on commit e8f5536

Please sign in to comment.