diff --git a/easystacks/software.eessi.io/2023.06/eessi-2023.06-eb-4.9.2-2023a.yml b/easystacks/software.eessi.io/2023.06/eessi-2023.06-eb-4.9.2-2023a.yml index e9011a0664..a7dd0c14f9 100644 --- a/easystacks/software.eessi.io/2023.06/eessi-2023.06-eb-4.9.2-2023a.yml +++ b/easystacks/software.eessi.io/2023.06/eessi-2023.06-eb-4.9.2-2023a.yml @@ -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 diff --git a/eb_hooks.py b/eb_hooks.py index 3e095129f9..0dc4abe793 100644 --- a/eb_hooks.py +++ b/eb_hooks.py @@ -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 @@ -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, }