From 946a010c3862ad7153138f6c54ffc0e3cd96595e Mon Sep 17 00:00:00 2001 From: mantaionut Date: Tue, 4 Jun 2024 15:05:47 +0300 Subject: [PATCH] removed not needed changes --- python/setup.py | 50 ------------------------------- python/triton/runtime/CLFinder.py | 1 - 2 files changed, 51 deletions(-) diff --git a/python/setup.py b/python/setup.py index a6b81a9b17a1..2a036119a42d 100644 --- a/python/setup.py +++ b/python/setup.py @@ -86,50 +86,6 @@ def copy_externals(): for backend_name, backend_src_dir in zip(backend_names, backend_dirs) ] - -def find_vswhere(): - program_files = os.environ.get("ProgramFiles(x86)", "C:\\Program Files (x86)") - vswhere_path = Path(program_files) / "Microsoft Visual Studio" / "Installer" / "vswhere.exe" - if vswhere_path.exists(): - return vswhere_path - return None - -def find_visual_studio(version_ranges): - vswhere = find_vswhere() - if not vswhere: - raise FileNotFoundError("vswhere.exe not found.") - - for version_range in version_ranges: - command = [ - str(vswhere), - "-version", version_range, - "-requires", "Microsoft.VisualStudio.Component.VC.Tools.x86.x64", - "-property", "installationPath", - "-prerelease" - ] - - try: - output = subprocess.check_output(command, text=True).strip() - if output: - return output - except subprocess.CalledProcessError: - continue - - return None - -def set_env_vars(vs_path, arch="x64"): - vcvarsall_path = Path(vs_path) / "VC" / "Auxiliary" / "Build" / "vcvarsall.bat" - if not vcvarsall_path.exists(): - raise FileNotFoundError(f"vcvarsall.bat not found in expected path: {vcvarsall_path}") - - command = f'call "{vcvarsall_path}" {arch} && set' - output = subprocess.check_output(command, shell=True, text=True) - - for line in output.splitlines(): - if '=' in line: - var, value = line.split('=', 1) - os.environ[var] = value - # Taken from https://github.com/pytorch/pytorch/blob/master/tools/setup_helpers/env.py def check_env_flag(name: str, default: str = "") -> bool: return os.getenv(name, default).upper() in ["ON", "1", "YES", "TRUE", "Y"] @@ -396,12 +352,6 @@ def get_proton_cmake_args(self): def build_extension(self, ext): lit_dir = shutil.which('lit') ninja_dir = shutil.which('ninja') - if platform.system() == "Windows": - vs_path = find_visual_studio(["[17.0,18.0)", "[16.0,17.0)"]) - env = set_env_vars(vs_path) - print(vs_path) - if not vs_path: - raise EnvironmentError("Visual Studio 2019 or 2022 not found.") # lit is used by the test suite thirdparty_cmake_args = get_thirdparty_packages([get_pybind11_package_info(), get_llvm_package_info()]) extdir = os.path.abspath(os.path.dirname(self.get_ext_fullpath(ext.path))) diff --git a/python/triton/runtime/CLFinder.py b/python/triton/runtime/CLFinder.py index d2e77e0b4cce..5e5eb63dd548 100644 --- a/python/triton/runtime/CLFinder.py +++ b/python/triton/runtime/CLFinder.py @@ -48,7 +48,6 @@ def initialize_visual_studio_env(version_ranges, arch="x64"): # Check if the environment variable that vcvarsall.bat sets is present if os.environ.get('VSCMD_ARG_TGT_ARCH') != arch: vs_path = find_visual_studio(version_ranges) - print(vs_path) if not vs_path: raise EnvironmentError("Visual Studio not found in specified version ranges.") set_env_vars(vs_path, arch)