From 13eb8b602586d07a261d7fa098831030acd0b00f Mon Sep 17 00:00:00 2001 From: Caspar van Leeuwen Date: Mon, 22 Jul 2024 16:34:12 +0200 Subject: [PATCH 1/8] Add cuda_cc_space_sep variant that does not have periods, e.g. '80 90' if cuda compute capabilities is 8.0,9.0 --- easybuild/framework/easyconfig/templates.py | 3 +++ test/framework/easyconfig.py | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/easybuild/framework/easyconfig/templates.py b/easybuild/framework/easyconfig/templates.py index 9da6e9a2b9..eae4284687 100644 --- a/easybuild/framework/easyconfig/templates.py +++ b/easybuild/framework/easyconfig/templates.py @@ -97,6 +97,8 @@ "--cuda-compute-capabilities configuration option or via cuda_compute_capabilities easyconfig parameter"), ('cuda_cc_cmake', "List of CUDA compute capabilities suitable for use with $CUDAARCHS in CMake 3.18+"), ('cuda_cc_space_sep', "Space-separated list of CUDA compute capabilities"), + ('cuda_cc_space_sep_no_period', + "Space-separated list of CUDA compute capabilities, without periods (e.g. '80 90')."), ('cuda_cc_semicolon_sep', "Semicolon-separated list of CUDA compute capabilities"), ('cuda_sm_comma_sep', "Comma-separated list of sm_* values that correspond with CUDA compute capabilities"), ('cuda_sm_space_sep', "Space-separated list of sm_* values that correspond with CUDA compute capabilities"), @@ -367,6 +369,7 @@ def template_constant_dict(config, ignore=None, skip_lower=None, toolchain=None) if cuda_compute_capabilities: template_values['cuda_compute_capabilities'] = ','.join(cuda_compute_capabilities) template_values['cuda_cc_space_sep'] = ' '.join(cuda_compute_capabilities) + template_values['cuda_cc_space_sep_no_period'] = ' '.join(cc.replace('.', '') for cc in cuda_compute_capabilities) template_values['cuda_cc_semicolon_sep'] = ';'.join(cuda_compute_capabilities) template_values['cuda_cc_cmake'] = ';'.join(cc.replace('.', '') for cc in cuda_compute_capabilities) sm_values = ['sm_' + cc.replace('.', '') for cc in cuda_compute_capabilities] diff --git a/test/framework/easyconfig.py b/test/framework/easyconfig.py index 4b63dc605b..c873b9aa16 100644 --- a/test/framework/easyconfig.py +++ b/test/framework/easyconfig.py @@ -4606,7 +4606,7 @@ def test_cuda_compute_capabilities(self): toolchain = SYSTEM cuda_compute_capabilities = ['5.1', '7.0', '7.1'] installopts = '%(cuda_compute_capabilities)s' - preinstallopts = '%(cuda_cc_space_sep)s' + preinstallopts = 'period="%(cuda_cc_space_sep)s" noperiod="%(cuda_cc_space_sep_no_period)s"' prebuildopts = '%(cuda_cc_semicolon_sep)s' configopts = 'comma="%(cuda_sm_comma_sep)s" space="%(cuda_sm_space_sep)s"' preconfigopts = 'CUDAARCHS="%(cuda_cc_cmake)s"' @@ -4615,7 +4615,7 @@ def test_cuda_compute_capabilities(self): ec = EasyConfig(self.eb_file) self.assertEqual(ec['installopts'], '5.1,7.0,7.1') - self.assertEqual(ec['preinstallopts'], '5.1 7.0 7.1') + self.assertEqual(ec['preinstallopts'], 'period="5.1 7.0 7.1" noperiod="51 70 71"') self.assertEqual(ec['prebuildopts'], '5.1;7.0;7.1') self.assertEqual(ec['configopts'], 'comma="sm_51,sm_70,sm_71" ' 'space="sm_51 sm_70 sm_71"') From 49455ae88801d9760ba43965a12a6e2ba310c25a Mon Sep 17 00:00:00 2001 From: Caspar van Leeuwen Date: Mon, 22 Jul 2024 16:38:24 +0200 Subject: [PATCH 2/8] Shorten local variable name --- easybuild/framework/easyconfig/templates.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/easybuild/framework/easyconfig/templates.py b/easybuild/framework/easyconfig/templates.py index eae4284687..c6cfe747aa 100644 --- a/easybuild/framework/easyconfig/templates.py +++ b/easybuild/framework/easyconfig/templates.py @@ -93,8 +93,8 @@ ('sysroot', "Location root directory of system, prefix for standard paths like /usr/lib and /usr/include" "as specify by the --sysroot configuration option"), ('mpi_cmd_prefix', "Prefix command for running MPI programs (with default number of ranks)"), - ('cuda_compute_capabilities', "Comma-separated list of CUDA compute capabilities, as specified via " - "--cuda-compute-capabilities configuration option or via cuda_compute_capabilities easyconfig parameter"), + ('cuda_cc', "Comma-separated list of CUDA compute capabilities, as specified via " + "--cuda-compute-capabilities configuration option or via cuda_cc easyconfig parameter"), ('cuda_cc_cmake', "List of CUDA compute capabilities suitable for use with $CUDAARCHS in CMake 3.18+"), ('cuda_cc_space_sep', "Space-separated list of CUDA compute capabilities"), ('cuda_cc_space_sep_no_period', @@ -365,14 +365,14 @@ def template_constant_dict(config, ignore=None, skip_lower=None, toolchain=None) # step 6. CUDA compute capabilities # Use the commandline / easybuild config option if given, else use the value from the EC (as a default) - cuda_compute_capabilities = build_option('cuda_compute_capabilities') or config.get('cuda_compute_capabilities') - if cuda_compute_capabilities: - template_values['cuda_compute_capabilities'] = ','.join(cuda_compute_capabilities) - template_values['cuda_cc_space_sep'] = ' '.join(cuda_compute_capabilities) - template_values['cuda_cc_space_sep_no_period'] = ' '.join(cc.replace('.', '') for cc in cuda_compute_capabilities) - template_values['cuda_cc_semicolon_sep'] = ';'.join(cuda_compute_capabilities) - template_values['cuda_cc_cmake'] = ';'.join(cc.replace('.', '') for cc in cuda_compute_capabilities) - sm_values = ['sm_' + cc.replace('.', '') for cc in cuda_compute_capabilities] + cuda_cc = build_option('cuda_cc') or config.get('cuda_cc') + if cuda_cc: + template_values['cuda_compute_capabilities'] = ','.join(cuda_cc) + template_values['cuda_cc_space_sep'] = ' '.join(cuda_cc) + template_values['cuda_cc_space_sep_no_period'] = ' '.join(cc.replace('.', '') for cc in cuda_cc) + template_values['cuda_cc_semicolon_sep'] = ';'.join(cuda_cc) + template_values['cuda_cc_cmake'] = ';'.join(cc.replace('.', '') for cc in cuda_cc) + sm_values = ['sm_' + cc.replace('.', '') for cc in cuda_cc] template_values['cuda_sm_comma_sep'] = ','.join(sm_values) template_values['cuda_sm_space_sep'] = ' '.join(sm_values) From f17edd1f763074ad641f183e2f973093d534f0ef Mon Sep 17 00:00:00 2001 From: Caspar van Leeuwen Date: Mon, 22 Jul 2024 16:40:35 +0200 Subject: [PATCH 3/8] Revert shortening when it concerns the real build option cuda_compute_capabilities, and not the local variable --- easybuild/framework/easyconfig/templates.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/easybuild/framework/easyconfig/templates.py b/easybuild/framework/easyconfig/templates.py index c6cfe747aa..df46e5eaeb 100644 --- a/easybuild/framework/easyconfig/templates.py +++ b/easybuild/framework/easyconfig/templates.py @@ -365,7 +365,7 @@ def template_constant_dict(config, ignore=None, skip_lower=None, toolchain=None) # step 6. CUDA compute capabilities # Use the commandline / easybuild config option if given, else use the value from the EC (as a default) - cuda_cc = build_option('cuda_cc') or config.get('cuda_cc') + cuda_cc = build_option('cuda_cc') or config.get('cuda_compute_capabilities') if cuda_cc: template_values['cuda_compute_capabilities'] = ','.join(cuda_cc) template_values['cuda_cc_space_sep'] = ' '.join(cuda_cc) From 37a473deebb7ff9a91c103ca417793041769fd40 Mon Sep 17 00:00:00 2001 From: Caspar van Leeuwen Date: Mon, 22 Jul 2024 17:14:59 +0200 Subject: [PATCH 4/8] Revert shortening when it's really about the cuda compute capabilities build option, instead of the local var --- easybuild/framework/easyconfig/templates.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/easybuild/framework/easyconfig/templates.py b/easybuild/framework/easyconfig/templates.py index df46e5eaeb..88174c8393 100644 --- a/easybuild/framework/easyconfig/templates.py +++ b/easybuild/framework/easyconfig/templates.py @@ -365,7 +365,7 @@ def template_constant_dict(config, ignore=None, skip_lower=None, toolchain=None) # step 6. CUDA compute capabilities # Use the commandline / easybuild config option if given, else use the value from the EC (as a default) - cuda_cc = build_option('cuda_cc') or config.get('cuda_compute_capabilities') + cuda_cc = build_option('cuda_compute_capabilities') or config.get('cuda_compute_capabilities') if cuda_cc: template_values['cuda_compute_capabilities'] = ','.join(cuda_cc) template_values['cuda_cc_space_sep'] = ' '.join(cuda_cc) From c6a572399e22bcafd7f050c081af9bc2af60d3d1 Mon Sep 17 00:00:00 2001 From: Caspar van Leeuwen Date: Mon, 22 Jul 2024 17:36:12 +0200 Subject: [PATCH 5/8] Fix name of cuda_compute_capabilities template, it was accidentally replaced --- easybuild/framework/easyconfig/templates.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/easybuild/framework/easyconfig/templates.py b/easybuild/framework/easyconfig/templates.py index 88174c8393..e1ac187eee 100644 --- a/easybuild/framework/easyconfig/templates.py +++ b/easybuild/framework/easyconfig/templates.py @@ -93,7 +93,7 @@ ('sysroot', "Location root directory of system, prefix for standard paths like /usr/lib and /usr/include" "as specify by the --sysroot configuration option"), ('mpi_cmd_prefix', "Prefix command for running MPI programs (with default number of ranks)"), - ('cuda_cc', "Comma-separated list of CUDA compute capabilities, as specified via " + ('cuda_compute_capabilities', "Comma-separated list of CUDA compute capabilities, as specified via " "--cuda-compute-capabilities configuration option or via cuda_cc easyconfig parameter"), ('cuda_cc_cmake', "List of CUDA compute capabilities suitable for use with $CUDAARCHS in CMake 3.18+"), ('cuda_cc_space_sep', "Space-separated list of CUDA compute capabilities"), From 1674f1eb5acd34f645266b82be0860bf547cd445 Mon Sep 17 00:00:00 2001 From: Caspar van Leeuwen Date: Mon, 22 Jul 2024 23:38:42 +0200 Subject: [PATCH 6/8] Forgot to change second expected pattern in unit test. Did so now --- test/framework/easyconfig.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/framework/easyconfig.py b/test/framework/easyconfig.py index c873b9aa16..eb21430f47 100644 --- a/test/framework/easyconfig.py +++ b/test/framework/easyconfig.py @@ -4625,7 +4625,7 @@ def test_cuda_compute_capabilities(self): init_config(build_options={'cuda_compute_capabilities': ['4.2', '6.3']}) ec = EasyConfig(self.eb_file) self.assertEqual(ec['installopts'], '4.2,6.3') - self.assertEqual(ec['preinstallopts'], '4.2 6.3') + self.assertEqual(ec['preinstallopts'], 'period="4.2 6.3" noperiod="42 63"') self.assertEqual(ec['prebuildopts'], '4.2;6.3') self.assertEqual(ec['configopts'], 'comma="sm_42,sm_63" ' 'space="sm_42 sm_63"') From fba1825ebd23a9a0520d02ecf3e8ec060df046af Mon Sep 17 00:00:00 2001 From: Caspar van Leeuwen Date: Wed, 24 Jul 2024 16:52:47 +0200 Subject: [PATCH 7/8] Make unrelated warning disappear --- .github/workflows/unit_tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index c9f42891ec..5fa01efb5f 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -191,7 +191,7 @@ jobs: # run test suite python -O -m test.framework.suite 2>&1 | tee test_framework_suite.log # try and make sure output of running tests is clean (no printed messages/warnings) - IGNORE_PATTERNS="no GitHub token available|skipping SvnRepository test|requires Lmod as modules tool|stty: 'standard input': Inappropriate ioctl for device|CryptographyDeprecationWarning: Python 3.[56]|from cryptography.* import |CryptographyDeprecationWarning: Python 2|Blowfish|GC3Pie not available, skipping test" + IGNORE_PATTERNS="no GitHub token available|skipping SvnRepository test|requires Lmod as modules tool|stty: 'standard input': Inappropriate ioctl for device|CryptographyDeprecationWarning: Python 3.[56]|from cryptography.* import |CryptographyDeprecationWarning: Python 2|Blowfish|GC3Pie not available, skipping test|CryptographyDeprecationWarning: TripleDES has been moved" # '|| true' is needed to avoid that GitHub Actions stops the job on non-zero exit of grep (i.e. when there are no matches) PRINTED_MSG=$(egrep -v "${IGNORE_PATTERNS}" test_framework_suite.log | grep '\.\n*[A-Za-z]' || true) test "x$PRINTED_MSG" = "x" || (echo "ERROR: Found printed messages in output of test suite" && echo "${PRINTED_MSG}" && exit 1) From 262ff858c4c5388f025bcfc9d919493144d3777d Mon Sep 17 00:00:00 2001 From: Caspar van Leeuwen Date: Wed, 24 Jul 2024 17:16:07 +0200 Subject: [PATCH 8/8] Make unrelated warning from CI disappear --- .github/workflows/unit_tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index 5fa01efb5f..b6b79ac4d5 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -191,7 +191,7 @@ jobs: # run test suite python -O -m test.framework.suite 2>&1 | tee test_framework_suite.log # try and make sure output of running tests is clean (no printed messages/warnings) - IGNORE_PATTERNS="no GitHub token available|skipping SvnRepository test|requires Lmod as modules tool|stty: 'standard input': Inappropriate ioctl for device|CryptographyDeprecationWarning: Python 3.[56]|from cryptography.* import |CryptographyDeprecationWarning: Python 2|Blowfish|GC3Pie not available, skipping test|CryptographyDeprecationWarning: TripleDES has been moved" + IGNORE_PATTERNS="no GitHub token available|skipping SvnRepository test|requires Lmod as modules tool|stty: 'standard input': Inappropriate ioctl for device|CryptographyDeprecationWarning: Python 3.[56]|from cryptography.* import |CryptographyDeprecationWarning: Python 2|Blowfish|GC3Pie not available, skipping test|CryptographyDeprecationWarning: TripleDES has been moved|algorithms.TripleDES" # '|| true' is needed to avoid that GitHub Actions stops the job on non-zero exit of grep (i.e. when there are no matches) PRINTED_MSG=$(egrep -v "${IGNORE_PATTERNS}" test_framework_suite.log | grep '\.\n*[A-Za-z]' || true) test "x$PRINTED_MSG" = "x" || (echo "ERROR: Found printed messages in output of test suite" && echo "${PRINTED_MSG}" && exit 1)