From f623b123f00358936932e103131bb6e3fc8ea685 Mon Sep 17 00:00:00 2001 From: Nikita Shulga Date: Fri, 2 Dec 2022 04:13:56 +0000 Subject: [PATCH] [Inductor] Do not install g++12 by default (#90038) Unless `TORCH_INDUCTOR_INSTALL_GXX` environment variable is define (which is the case for CI) Fixes #ISSUE_NUMBER Pull Request resolved: https://github.com/pytorch/pytorch/pull/90038 Approved by: https://github.com/albanD --- .jenkins/pytorch/test.sh | 1 + torch/_inductor/codecache.py | 3 +++ 2 files changed, 4 insertions(+) diff --git a/.jenkins/pytorch/test.sh b/.jenkins/pytorch/test.sh index 29f9657beaf..414c85abff2 100755 --- a/.jenkins/pytorch/test.sh +++ b/.jenkins/pytorch/test.sh @@ -16,6 +16,7 @@ BUILD_RENAMED_DIR="build_renamed" BUILD_BIN_DIR="$BUILD_DIR"/bin export VALGRIND=ON +export TORCH_INDUCTOR_INSTALL_GXX=ON if [[ "$BUILD_ENVIRONMENT" == *clang9* ]]; then # clang9 appears to miscompile code involving c10::optional, # such that valgrind complains along these lines: diff --git a/torch/_inductor/codecache.py b/torch/_inductor/codecache.py index dca8af6cf1b..f4297732b38 100644 --- a/torch/_inductor/codecache.py +++ b/torch/_inductor/codecache.py @@ -110,6 +110,9 @@ def cpp_compiler_search(search): # according to https://anaconda.org/conda-forge/gxx/ if sys.platform != "linux": continue + # Do not install GXX by default + if not os.getenv("TORCH_INDUCTOR_INSTALL_GXX"): + continue from filelock import FileLock lock_dir = get_lock_dir()