Skip to content

Commit

Permalink
Merge pull request #3079 from boegel/pytorch_use_pip
Browse files Browse the repository at this point in the history
disable `use_pip` by default for PyTorch, except for recent versions (>= 2.0)
  • Loading branch information
branfosj committed Jan 22, 2024
2 parents 2009453 + 90e3262 commit 149213d
Showing 1 changed file with 13 additions and 0 deletions.
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

0 comments on commit 149213d

Please sign in to comment.