Skip to content

Commit

Permalink
add parse_hook for SentencePiece on aarch64/generic
Browse files Browse the repository at this point in the history
  • Loading branch information
truib committed Jun 7, 2024
1 parent a92de97 commit 11d6992
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions eb_hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,27 @@ def parse_hook_qt5_check_qtwebengine_disable(ec, eprefix):
raise EasyBuildError("Qt5-specific hook triggered for non-Qt5 easyconfig?!")


def parse_hook_sentencepiece_disable_tcmalloc_aarch64(ec, eprefix):
"""
Disable using TCMalloc
"""
cpu_target = get_eessi_envvar('EESSI_SOFTWARE_SUBDIR')
if ec.name == 'SentencePiece' and ec.version in ['0.2.0'] and cpu_target == CPU_TARGET_AARCH64_GENERIC:
print_msg("parse_hook for SentencePiece: OLD '%s'", ec['components'])
new_components = []
for item in ec['components']:
if item[2]['easyblock'] == 'CMakeMake':
new_item = item[2]
new_item['configopts'] = '-DSPM_ENABLE_TCMALLOC=OFF'
new_components.append((item[0], item[1], new_item))
else:
new_components.append(item)
ec['components'] = new_components
print_msg("parse_hook for SentencePiece: NEW '%s'", ec['components'])
else:
raise EasyBuildError("SentencePiece-specific hook triggered for non-SentencePiece easyconfig?!")


def parse_hook_ucx_eprefix(ec, eprefix):
"""Make UCX aware of compatibility layer via additional configuration options."""
if ec.name == 'UCX':
Expand Down Expand Up @@ -918,6 +939,7 @@ def pre_module_hook_librosa_augment_modluafooter(self, *args, **kwargs):
'Pillow-SIMD' : parse_hook_Pillow_SIMD_harcoded_paths,
'pybind11': parse_hook_pybind11_replace_catch2,
'Qt5': parse_hook_qt5_check_qtwebengine_disable,
'SentencePiece': parse_hook_sentencepiece_disable_tcmalloc_aarch64,
'UCX': parse_hook_ucx_eprefix,
}

Expand Down

0 comments on commit 11d6992

Please sign in to comment.