Skip to content
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
7 changes: 6 additions & 1 deletion easybuild/easyblocks/p/pytorch.py
Original file line number Diff line number Diff line change
Expand Up @@ -539,11 +539,16 @@ def add_enable_option(name, enabled):
self.cfg.update('preinstallopts', ' '.join(unique_options) + ' ')

def _set_cache_dir(self):
"""Set $XDG_CACHE_HOME to avoid PyTorch defaulting to $HOME"""
"""Set $XDG_CACHE_HOME and $TRITON_HOME to avoid PyTorch defaulting to $HOME"""
cache_dir = os.path.join(self.tmpdir, '.cache')
# The path must exist!
mkdir(cache_dir, parents=True)
env.setvar('XDG_CACHE_HOME', cache_dir)
# Triton also uses a path defaulting to $HOME
# Isolate against user-set variables
env.unset_env_vars(('TRITON_DUMP_DIR', 'TRITON_OVERRIDE_DIR', 'TRITON_CACHE_DIR'))
triton_home = os.path.join(self.tmpdir, '.triton_home')
env.setvar('TRITON_HOME', triton_home)

def _compare_test_results(self, old_result, xml_result, old_failed_test_names, xml_failed_test_names):
"""Compare test results parsed from stdout and XML files"""
Expand Down