diff --git a/eb_hooks.py b/eb_hooks.py index 7edd67b1fc..1f0adc8139 100644 --- a/eb_hooks.py +++ b/eb_hooks.py @@ -720,7 +720,7 @@ def post_sanitycheck_cudnn(self, *args, **kwargs): allowlist = ['LICENSE'] - # read cuDNN LICENSE, construct allowlist based on section 2.6 that specifies list of files that can be shipped + # read cuDNN LICENSE, construct allowlist based on section "2. Distribution" that specifies list of files that can be shipped license_path = os.path.join(self.installdir, 'LICENSE') search_string = "2. Distribution. The following portions of the SDK are distributable under the Agreement:" with open(license_path) as infile: @@ -743,6 +743,39 @@ def post_sanitycheck_cudnn(self, *args, **kwargs): raise EasyBuildError("cuDNN-specific hook triggered for non-cuDNN easyconfig?!") +def post_sanitycheck_cutensor(self, *args, **kwargs): + """ + Remove files from cuTENSOR installation that we are not allowed to ship, + and replace them with a symlink to a corresponding installation under host_injections. + """ + if self.name == 'cuTENSOR': + print_msg("Replacing files in cuTENSOR installation that we can not ship with symlinks to host_injections...") + + allowlist = ['LICENSE'] + + # read cuTENSOR LICENSE, construct allowlist based on section "2. Distribution" that specifies list of files that can be shipped + license_path = os.path.join(self.installdir, 'LICENSE') + search_string = "2. Distribution. The following portions of the SDK are distributable under the Agreement:" + with open(license_path) as infile: + for line in infile: + if line.strip().startswith(search_string): + # remove search string, split into words, remove trailing + # dots '.' and only retain words starting with a dot '.' + distributable = line[len(search_string):] + for word in distributable.split(): + if word[0] == '.': + allowlist.append(word.rstrip('.')) + + allowlist = sorted(set(allowlist)) + self.log.info("Allowlist for files in cuTENSOR installation that can be redistributed: " + ', '.join(allowlist)) + + # replace files that are not distributable with symlinks into + # host_injections + replace_non_distributable_files_with_symlinks(self.name, allowlist) + else: + raise EasyBuildError("cuTENSOR-specific hook triggered for non-cuTENSOR easyconfig?!") + + def inject_gpu_property(ec): """ Add 'gpu' property EESSIVERSION envvars and drop dependencies to @@ -844,4 +877,5 @@ def inject_gpu_property(ec): POST_SANITYCHECK_HOOKS = { 'CUDA': post_sanitycheck_cuda, 'cuDNN': post_sanitycheck_cudnn, + 'cuTENSOR': post_sanitycheck_cutensor, } diff --git a/scripts/gpu_support/nvidia/eessi-2023.06-cuda-and-libraries.yml b/scripts/gpu_support/nvidia/eessi-2023.06-cuda-and-libraries.yml index e0e47bf2d8..74615872d4 100644 --- a/scripts/gpu_support/nvidia/eessi-2023.06-cuda-and-libraries.yml +++ b/scripts/gpu_support/nvidia/eessi-2023.06-cuda-and-libraries.yml @@ -1,3 +1,4 @@ easyconfigs: - - CUDA-12.1.1.eb - - cuDNN-8.9.2.26-CUDA-12.1.1.eb + - CUDA-12.1.1.eb + - cuDNN-8.9.2.26-CUDA-12.1.1.eb + - cuTENSOR-2.0.1.2-CUDA-12.1.1.eb