Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

disable use_pip by default for PyTorch, except for recent versions (>= 2.0) #3079

Merged
merged 2 commits into from
Jan 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions easybuild/easyblocks/p/pytorch.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,14 @@ def extra_options():
'excluded_tests': [{}, "Mapping of architecture strings to list of tests to be excluded", CUSTOM],
'max_failed_tests': [0, "Maximum number of failing tests", CUSTOM],
})

# disable use of pip to install PyTorch by default, overwriting the default set in PythonPackage;
# see also https://github.com/easybuilders/easybuild-easyblocks/pull/3022
extra_vars['use_pip'][0] = None

extra_vars['download_dep_fail'][0] = True
extra_vars['sanity_pip_check'][0] = True

# Make pip show output of build process as that may often contain errors or important warnings
extra_vars['pip_verbose'][0] = True

Expand All @@ -69,6 +75,13 @@ def __init__(self, *args, **kwargs):
self.testinstall = True
self.tmpdir = tempfile.mkdtemp(suffix='-pytorch-build')

# opt-in to using pip to install PyTorch for sufficiently recent version (>= 2.0),
# unless it's otherwise specified
pytorch_version = LooseVersion(self.version)
if self.cfg['use_pip'] is None and pytorch_version >= '2.0':
self.log.info("Auto-enabling use of pip to install PyTorch >= 2.0, since 'use_pip' is not set")
self.cfg['use_pip'] = True

def fetch_step(self, skip_checksums=False):
"""Fetch sources for installing PyTorch, including those for tests."""
super(EB_PyTorch, self).fetch_step(skip_checksums)
Expand Down
Loading