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

{2023.06}[2023a] PyTorch-Bundle v2.1.2 #585

Open
wants to merge 13 commits into
base: 2023.06-software.eessi.io
Choose a base branch
from
Open
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,4 @@ easyconfigs:
options:
# see https://github.com/easybuilders/easybuild-easyconfigs/pull/21227
from-commit: 4c5e3455dec31e68e8383c7fd86d1f80c434676d
- PyTorch-bundle-2.1.2-foss-2023a.eb
29 changes: 29 additions & 0 deletions eb_hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -725,6 +725,31 @@ def post_sanitycheck_cuda(self, *args, **kwargs):
raise EasyBuildError("CUDA-specific hook triggered for non-CUDA easyconfig?!")


def pre_sanitycheck_hook(self,*args, **kwargs):
"""Main pre-sanitycheck hook: trigger custom functions based on software name."""
if self.name in PRE_SANITYCHECK_HOOKS:
PRE_SANITYCHECK_HOOKS[self.name](self, *args, **kwargs)


def pre_sanitycheck_sentencepiece(self, *args, **kwargs):
"""
LD_PRELOAD `libtcmalloc_minimal.so.4` on AARCH64-based systems
Avoids "libtcmalloc_minimal.so.4: cannot allocate memory in static TLS block" error
See https://github.com/EESSI/software-layer/pull/585/#issuecomment-2286068465
"""
if self.name == "SentencePiece" and get_cpu_architecture() == AARCH64:
# We want to set LD_PRELOAD so that it loads the libtcmalloc_minimal.so library from gperftools
# However, if LD_PRELOAD is already set, we need to prepend to it.
# An existing LD_PRELOAD can be space or colon separated, both are allowed
# So first we make sure it is colon seperated
# Colon seperation is allowed for LD_PRELOAD, so the easiest way to prepend to whats there
# is to specify it through modextrapaths
self.cfg['modluafooter'] = """
libtcmalloc = pathJoin(os.getenv("EBROOTGPERFTOOLS"), "lib64", "libtcmalloc_minimal.so")
prepend_path("LD_PRELOAD", libtcmalloc)
"""


def inject_gpu_property(ec):
"""
Add 'gpu' property, via modluafooter easyconfig parameter
Expand Down Expand Up @@ -804,6 +829,10 @@ def inject_gpu_property(ec):
'numpy': post_single_extension_numpy,
}

PRE_SANITYCHECK_HOOKS = {
'SentencePiece': pre_sanitycheck_sentencepiece,
}

POST_SANITYCHECK_HOOKS = {
'CUDA': post_sanitycheck_cuda,
}
Loading