From 1e84430d2b8856ac11387c35ede54fad11edd687 Mon Sep 17 00:00:00 2001 From: Xu Zhao Date: Fri, 26 Jan 2024 07:59:52 -0800 Subject: [PATCH] Fix bisection with start/end versions. (#2132) Summary: At the compile time, pytorch compilation will link with the system libstdcxx. At runtime, it will use the version provided by conda. After the upgrade, Ubuntu 22.04 ships with libstdcxx 12.3.0, but the default conda version of libstdcxx-ng is 11.2.0. Install libstdcxx-ng 12.3.0 to provide the ABI symbol GLIBCXX_3.4.30 at runtime. Ubuntu 22.04 ships with glib 2.78.3, so it does not need the glib 2.69 trick anymore. Pull Request resolved: https://github.com/pytorch/benchmark/pull/2132 Test Plan: https://github.com/pytorch/benchmark/actions/runs/7663583650 Reviewed By: suez1224 Differential Revision: D53095193 Pulled By: xuzhao9 fbshipit-source-id: ad5bf51d423c933dd063ce006a4099f8ef9ba65c --- bisection.py | 17 ++++++++++++++--- utils/cuda_utils.py | 10 ++++++---- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/bisection.py b/bisection.py index 0758347eb5..98c2c1a3e8 100644 --- a/bisection.py +++ b/bisection.py @@ -185,8 +185,12 @@ class BisectionTargetRepo: commits: List[Commit] # Map from commit SHA to its index in commits commit_dict: Dict[str, int] - def __init__(self, repo: TorchRepo, start: str, end: str, - start_version: str, end_version: str, + def __init__(self, + repo: TorchRepo, + start: str, + end: str, + start_version: str, + end_version: str, non_target_repos: List[TorchRepo]): self.repo = repo self.start = start @@ -414,6 +418,8 @@ def __init__( target_repo: TorchRepo, start: str, end: str, + start_version: str, + end_version: str, bisect_config: TorchBenchABTestResult, output_json: str, debug: bool = False, @@ -428,7 +434,12 @@ def __init__( ) torchbench_repo_key = "torchbench" if not IS_FBCODE else "fbcode" self.target_repo = BisectionTargetRepo( - repo=target_repo, start=start, end=end, non_target_repos=non_target_repos + repo=target_repo, + start=start, + end=end, + start_version=start_version, + end_version=end_version, + non_target_repos=non_target_repos, ) self.torchbench = TorchBenchRepo( repo=torch_repos[torchbench_repo_key], diff --git a/utils/cuda_utils.py b/utils/cuda_utils.py index 043725c9f4..6f35b07eaf 100644 --- a/utils/cuda_utils.py +++ b/utils/cuda_utils.py @@ -113,12 +113,14 @@ def install_torch_build_deps(cuda_version: str): pip_deps = [ f"numpy=={PIN_NUMPY_VERSION}" ] cmd = ["pip", "install"] + pip_deps subprocess.check_call(cmd) + # conda forge deps + # ubuntu 22.04 comes with libstdcxx6 12.3.0 + # we need to install the same library version in conda + conda_deps = ["libstdcxx-ng=12.3.0"] + cmd = ["conda", "install", "-y", "-c", "conda-forge"] + conda_deps + subprocess.check_call(cmd) def install_torchbench_deps(): - # weasyprint requires ffi7, which requires glib > 2.69 on ubuntu 20.04 - conda_deps = ["glib"] - cmd = ["conda", "install", "-y"] + conda_deps - subprocess.check_call(cmd) cmd = ["pip", "install", "unittest-xml-reporting", "boto3"] subprocess.check_call(cmd)