Skip to content

Commit 22858ec

Browse files
committed
also rename to --cuda-sanity-check-error-on-failed-checks in comments, trace/log messages, and tests
1 parent 190156b commit 22858ec

File tree

2 files changed

+27
-27
lines changed

2 files changed

+27
-27
lines changed

easybuild/framework/easyblock.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3446,13 +3446,13 @@ def format_file_list(files_list):
34463446
missing_devcodes = list(set(cfg_ccs) - set(found_dev_code_ccs))
34473447

34483448
# There are two reasons for ignoring failures:
3449-
# - We are running with --disable-cuda-sanity-check-error-on-fail
3449+
# - We are running with --disable-cuda-sanity-check-error-on-failed-checks
34503450
# - The specific {path} is on the cuda_sanity_ignore_files in the easyconfig
34513451
# In case we run with both, we'll just report that we're running with
3452-
# --disable-cuda-sanity-check-error-on-fail
3452+
# --disable-cuda-sanity-check-error-on-failed-checks
34533453
if ignore_failures:
34543454
ignore_msg = f"Failure for {path} will be ignored since we are not running with "
3455-
ignore_msg += "--cuda-sanity-check-error-on-fail"
3455+
ignore_msg += "--cuda-sanity-check-error-on-failed-checks"
34563456
else:
34573457
ignore_msg = f"This failure will be ignored as '{path}' is listed in "
34583458
ignore_msg += "'cuda_sanity_ignore_files'."
@@ -3473,8 +3473,8 @@ def format_file_list(files_list):
34733473
if strict_cc_check:
34743474
# cuda-sanity-check-strict, so no additional compute capabilities allowed
34753475
if path in ignore_file_list or ignore_failures:
3476-
# No error, because either path is on the cuda_sanity_ignore_files list in the
3477-
# easyconfig, or we are running with --disable-cuda-sanity-check-error-on-fail
3476+
# No error, either path is in cuda_sanity_ignore_files list in easyconfig,
3477+
# or we are running with --disable-cuda-sanity-check-error-on-failed-checks
34783478
files_additional_devcode_ignored.append(os.path.relpath(path, self.installdir))
34793479
fail_msg += ignore_msg
34803480
else:
@@ -3513,7 +3513,7 @@ def format_file_list(files_list):
35133513
if path in ignore_file_list or ignore_failures:
35143514
# No error, because either path is on the cuda_sanity_ignore_files list in
35153515
# the easyconfig, or we are running with
3516-
# --disable-cuda-sanity-check-error-on-fail
3516+
# --disable-cuda-sanity-check-error-on-failed-checks
35173517
files_missing_devcode_ignored.append(os.path.relpath(path, self.installdir))
35183518
fail_msg += ignore_msg
35193519
else:
@@ -3524,8 +3524,8 @@ def format_file_list(files_list):
35243524
# This is considered a failure
35253525
files_missing_devcode.append(os.path.relpath(path, self.installdir))
35263526
if path in ignore_file_list or ignore_failures:
3527-
# No error, because either path is on the cuda_sanity_ignore_files list in the
3528-
# easyconfig, or we are running with --disable-cuda-sanity-check-error-on-fail
3527+
# No error, either path is in cuda_sanity_ignore_files list in easyconfig,
3528+
# or we are running with --disable-cuda-sanity-check-error-on-failed-checks
35293529
files_missing_devcode_ignored.append(os.path.relpath(path, self.installdir))
35303530
fail_msg += ignore_msg
35313531
else:
@@ -3547,7 +3547,7 @@ def format_file_list(files_list):
35473547
fail_msg += "(PTX architectures supported in that file: %s). "
35483548
if path in ignore_file_list or ignore_failures:
35493549
# No error, because either path is on the cuda_sanity_ignore_files list in the
3550-
# easyconfig, or we are running with --disable-cuda-sanity-check-error-on-fail
3550+
# easyconfig, or we are running with --disable-cuda-sanity-check-error-on-failed-checks
35513551
files_missing_ptx_ignored.append(os.path.relpath(path, self.installdir))
35523552
fail_msg += ignore_msg
35533553
self.log.warning(fail_msg, highest_cc[0], path, found_ptx_ccs)
@@ -3578,7 +3578,7 @@ def trace_and_log(msg):
35783578
elif ignore_failures:
35793579
msg = f"Number of files missing one or more CUDA Compute Capabilities: {len(files_missing_devcode)}"
35803580
trace_and_log(msg)
3581-
trace_and_log("(not running with --cuda-sanity-check-error-on-fail, so not considered failures)")
3581+
trace_and_log("(not running with --cuda-sanity-check-error-on-failed-checks, so not considered failures)")
35823582
else:
35833583
msg = f"Number of files missing one or more CUDA Compute Capabilities: {len(files_missing_devcode)}"
35843584
msg += f" (ignored: {len(files_missing_devcode_ignored)}, "
@@ -3595,7 +3595,7 @@ def trace_and_log(msg):
35953595
msg = "Number of files with device code for more CUDA Compute Capabilities than requested: "
35963596
msg += f"{len(files_additional_devcode)}"
35973597
trace_and_log(msg)
3598-
trace_and_log("(not running with --cuda-sanity-check-error-on-fail, so not considered failures)")
3598+
trace_and_log("(not running with --cuda-sanity-check-error-on-failed-checks, so not considered failures)")
35993599
elif strict_cc_check:
36003600
msg = "Number of files with device code for more CUDA Compute Capabilities than requested: "
36013601
msg += f"{len(files_additional_devcode)} (ignored: {len(files_additional_devcode_ignored)}, "
@@ -3612,7 +3612,7 @@ def trace_and_log(msg):
36123612
msg = "Number of files missing PTX code for the highest configured CUDA Compute Capability: "
36133613
msg += f"{len(files_missing_ptx)}"
36143614
trace_and_log(msg)
3615-
trace_and_log("(not running with --cuda-sanity-check-error-on-fail, so not considered failures)")
3615+
trace_and_log("(not running with --cuda-sanity-check-error-on-failed-checks, so not considered failures)")
36163616
elif accept_missing_ptx:
36173617
msg = "Number of files missing PTX code for the highest configured CUDA Compute Capability: "
36183618
msg += f"{len(files_missing_ptx)}"

test/framework/toy_build.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3270,7 +3270,7 @@ def assert_cuda_report(missing_cc, additional_cc, missing_ptx, log, stdout=None,
32703270

32713271
# Test case 1a: test with default options, --cuda-compute-capabilities=8.0 and a binary that contains
32723272
# 8.0 device code
3273-
# This should succeed (since the default for --cuda-sanity-check-error-on-fail is False)
3273+
# This should succeed (since the default for --cuda-sanity-check-error-on-failed-checks is False)
32743274
# as to not break backwards compatibility
32753275
write_file(cuobjdump_file, cuobjdump_txt_shebang),
32763276
write_file(cuobjdump_file, cuobjdump_txt_sm80, append=True)
@@ -3287,7 +3287,7 @@ def assert_cuda_report(missing_cc, additional_cc, missing_ptx, log, stdout=None,
32873287
# Note that the difference with 1a is the presense of additional device code, PTX code foor the right
32883288
# architecture, but missing device code for the requested architecture
32893289
# It should not matter for the result, but triggers slightly different code paths in easyblock.py
3290-
# This should succeed (since the default for --cuda-sanity-check-error-on-fail is False)
3290+
# This should succeed (since the default for --cuda-sanity-check-error-on-failed-checks is False)
32913291
# as to not break backwards compatibility
32923292
write_file(cuobjdump_file, cuobjdump_txt_shebang),
32933293
write_file(cuobjdump_file, cuobjdump_txt_sm90, append=True)
@@ -3305,9 +3305,9 @@ def assert_cuda_report(missing_cc, additional_cc, missing_ptx, log, stdout=None,
33053305
self.assertTrue(device_missing_80_code_regex.search(outtxt), msg)
33063306
assert_cuda_report(missing_cc=1, additional_cc=1, missing_ptx=0, log=outtxt, stdout=stdout)
33073307

3308-
# Test case 2: same as Test case 1, but add --cuda-sanity-check-error-on-fail
3308+
# Test case 2: same as Test case 1, but add --cuda-sanity-check-error-on-failed-checks
33093309
# This is expected to fail since there is missing device code for CC80
3310-
args = ['--cuda-compute-capabilities=8.0', '--cuda-sanity-check-error-on-fail']
3310+
args = ['--cuda-compute-capabilities=8.0', '--cuda-sanity-check-error-on-failed-checks']
33113311
# We expect this to fail, so first check error, then run again to check output
33123312
error_pattern = r"Files missing CUDA device code: 1."
33133313
with self.mocked_stdout_stderr():
@@ -3325,7 +3325,7 @@ def assert_cuda_report(missing_cc, additional_cc, missing_ptx, log, stdout=None,
33253325
# This is expected to succeed, since now the PTX code for CC80 will be accepted as
33263326
# device code. Note that also PTX code for the highest requested compute architecture (also CC80)
33273327
# is present, so also this part of the sanity check passes
3328-
args = ['--cuda-compute-capabilities=8.0', '--cuda-sanity-check-error-on-fail',
3328+
args = ['--cuda-compute-capabilities=8.0', '--cuda-sanity-check-error-on-failed-checks',
33293329
'--cuda-sanity-check-accept-ptx-as-devcode']
33303330
# We expect this to pass, so no need to check errors
33313331
with self.mocked_stdout_stderr():
@@ -3340,7 +3340,7 @@ def assert_cuda_report(missing_cc, additional_cc, missing_ptx, log, stdout=None,
33403340

33413341
# Test case 4: same as Test case 2, but run with --cuda-compute-capabilities=9.0
33423342
# This is expected to fail: device code is present, but PTX code for the highest CC (9.0) is missing
3343-
args = ['--cuda-compute-capabilities=9.0', '--cuda-sanity-check-error-on-fail']
3343+
args = ['--cuda-compute-capabilities=9.0', '--cuda-sanity-check-error-on-failed-checks']
33443344
# We expect this to fail, so first check error, then run again to check output
33453345
error_pattern = r"Files missing CUDA PTX code: 1"
33463346
with self.mocked_stdout_stderr():
@@ -3354,7 +3354,7 @@ def assert_cuda_report(missing_cc, additional_cc, missing_ptx, log, stdout=None,
33543354

33553355
# Test case 5: same as Test case 4, but add --cuda-sanity-check-accept-missing-ptx
33563356
# This is expected to succeed: device code is present, PTX code is missing, but that's accepted
3357-
args = ['--cuda-compute-capabilities=9.0', '--cuda-sanity-check-error-on-fail',
3357+
args = ['--cuda-compute-capabilities=9.0', '--cuda-sanity-check-error-on-failed-checks',
33583358
'--cuda-sanity-check-accept-missing-ptx']
33593359
# We expect this to pass, so no need to check errors
33603360
warning_pattern = r"Configured highest compute capability was '9\.0', "
@@ -3373,7 +3373,7 @@ def assert_cuda_report(missing_cc, additional_cc, missing_ptx, log, stdout=None,
33733373
# Test case 6: same as Test case 5, but add --cuda-sanity-check-strict
33743374
# This is expected to fail: device code is present, PTX code is missing (but accepted due to option)
33753375
# but additional device code is present, which is not allowed by --cuda-sanity-check-strict
3376-
args = ['--cuda-compute-capabilities=9.0', '--cuda-sanity-check-error-on-fail',
3376+
args = ['--cuda-compute-capabilities=9.0', '--cuda-sanity-check-error-on-failed-checks',
33773377
'--cuda-sanity-check-accept-missing-ptx', '--cuda-sanity-check-strict']
33783378
# We expect this to fail, so first check error, then run again to check output
33793379
error_pattern = r"Files with additional CUDA device code: 1"
@@ -3392,7 +3392,7 @@ def assert_cuda_report(missing_cc, additional_cc, missing_ptx, log, stdout=None,
33923392
toy_whitelist_ec = os.path.join(self.test_prefix, 'toy-0.0-cuda-whitelist.eb')
33933393
write_file(toy_whitelist_ec, read_file(toy_ec) + '\ncuda_sanity_ignore_files = ["bin/toy"]')
33943394

3395-
args = ['--cuda-compute-capabilities=9.0', '--cuda-sanity-check-error-on-fail',
3395+
args = ['--cuda-compute-capabilities=9.0', '--cuda-sanity-check-error-on-failed-checks',
33963396
'--cuda-sanity-check-accept-missing-ptx', '--cuda-sanity-check-strict']
33973397
# We expect this to succeed, so check output for expected patterns
33983398
with self.mocked_stdout_stderr():
@@ -3402,7 +3402,7 @@ def assert_cuda_report(missing_cc, additional_cc, missing_ptx, log, stdout=None,
34023402
self.assertTrue(device_additional_70_code_regex.search(outtxt), msg)
34033403
assert_cuda_report(missing_cc=0, additional_cc=1, missing_ptx=1, log=outtxt, stdout=stdout)
34043404

3405-
# Test case 8: try with --cuda-sanity-check-error-on-fail --cuda-compute-capabilities=9.0,9.0a
3405+
# Test case 8: try with --cuda-sanity-check-error-on-failed-checks --cuda-compute-capabilities=9.0,9.0a
34063406
# and --cuda-sanity-check-strict
34073407
# on a binary that contains 9.0 and 9.0a device code, and 9.0a ptx code. This tests the correct
34083408
# ordering (i.e. 9.0a > 9.0). It should pass, since device code is present for both CCs and PTX
@@ -3413,7 +3413,7 @@ def assert_cuda_report(missing_cc, additional_cc, missing_ptx, log, stdout=None,
34133413
write_file(cuobjdump_file, cuobjdump_txt_sm90a, append=True)
34143414
write_file(cuobjdump_file, cuobjdump_txt_sm90a_ptx, append=True)
34153415
adjust_permissions(cuobjdump_file, stat.S_IXUSR, add=True) # Make sure our mock cuobjdump is executable
3416-
args = ['--cuda-compute-capabilities=9.0,9.0a', '--cuda-sanity-check-error-on-fail',
3416+
args = ['--cuda-compute-capabilities=9.0,9.0a', '--cuda-sanity-check-error-on-failed-checks',
34173417
'--cuda-sanity-check-strict']
34183418
# We expect this to pass, so no need to check errors
34193419
with self.mocked_stdout_stderr():
@@ -3431,7 +3431,7 @@ def assert_cuda_report(missing_cc, additional_cc, missing_ptx, log, stdout=None,
34313431

34323432
# Test case 9: same as 8, but no --cuda-compute-capabilities are defined
34333433
# We expect this to lead to a skip of the CUDA sanity check, and a success for the overall sanity check
3434-
args = ['--cuda-sanity-check-error-on-fail', '--cuda-sanity-check-strict']
3434+
args = ['--cuda-sanity-check-error-on-failed-checks', '--cuda-sanity-check-strict']
34353435
# We expect this to pass, so no need to check errors
34363436
with self.mocked_stdout_stderr():
34373437
outtxt = self._test_toy_build(ec_file=toy_ec, extra_args=args, raise_error=True)
@@ -3446,7 +3446,7 @@ def assert_cuda_report(missing_cc, additional_cc, missing_ptx, log, stdout=None,
34463446
self.assertTrue(expected_result.search(outtxt), msg)
34473447

34483448
# Test case 10: running with default options and a binary that does not contain ANY CUDA device code
3449-
# This is expected to succeed, since the default is --disable-cuda-sanity-check-error-on-fail
3449+
# This is expected to succeed, since the default is --disable-cuda-sanity-check-error-on-failed-checks
34503450
write_file(cuobjdump_file, cuobjdump_txt_shebang)
34513451
write_file(cuobjdump_file, cuobjdump_txt_no_cuda, append=True)
34523452
adjust_permissions(cuobjdump_file, stat.S_IXUSR, add=True) # Make sure our mock cuobjdump is executable
@@ -3466,9 +3466,9 @@ def assert_cuda_report(missing_cc, additional_cc, missing_ptx, log, stdout=None,
34663466
self.assertTrue(expected_result.search(outtxt), msg)
34673467
assert_cuda_report(missing_cc=0, additional_cc=0, missing_ptx=0, log=outtxt, stdout=stdout, num_checked=0)
34683468

3469-
# Test case 11: same as Test case 10, but add --cuda-sanity-check-error-on-fail
3469+
# Test case 11: same as Test case 10, but add --cuda-sanity-check-error-on-failed-checks
34703470
# This should pass: if it's not a CUDA binary, it shouldn't fail the CUDA sanity check
3471-
args = ['--cuda-compute-capabilities=9.0', '--cuda-sanity-check-error-on-fail']
3471+
args = ['--cuda-compute-capabilities=9.0', '--cuda-sanity-check-error-on-failed-checks']
34723472
# We expect this to pass, so no need to check errors
34733473
with self.mocked_stdout_stderr():
34743474
outtxt = self._test_toy_build(ec_file=toy_ec, extra_args=args, raise_error=True)

0 commit comments

Comments
 (0)