Skip to content

Commit

Permalink
Fix bisection with start/end versions. (#2132)
Browse files Browse the repository at this point in the history
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: #2132

Test Plan: https://github.com/pytorch/benchmark/actions/runs/7663583650

Reviewed By: suez1224

Differential Revision: D53095193

Pulled By: xuzhao9

fbshipit-source-id: ad5bf51d423c933dd063ce006a4099f8ef9ba65c
  • Loading branch information
xuzhao9 authored and facebook-github-bot committed Jan 26, 2024
1 parent 52a4b44 commit 1e84430
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 7 deletions.
17 changes: 14 additions & 3 deletions bisection.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand All @@ -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],
Expand Down
10 changes: 6 additions & 4 deletions utils/cuda_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 1e84430

Please sign in to comment.