[schur-complement] validate the arguments and report allocation and launch failures - #316
Open
zjin-lcf wants to merge 4 commits into
Open
[schur-complement] validate the arguments and report allocation and launch failures#316zjin-lcf wants to merge 4 commits into
zjin-lcf wants to merge 4 commits into
Conversation
…SYCL and OpenMP kernel launches The CSR row pointers and column indices are 32-bit, so reject non-positive sizes and sizes whose nonzero count would overflow an int instead of silently generating a corrupt matrix. Also share the block size macros in the SYCL version and set the team size explicitly in the OpenMP version. Co-authored-by: Cursor <cursoragent@cursor.com>
The examples themselves are already on master, so keep only the argument validation and the kernel-launch alignment here, and take the updated Makefiles (LAUNCHER, ARCH and SM overridable from the environment) from master. Co-authored-by: Cursor <cursoragent@cursor.com>
…n and launch failures - Move the command-line checks into reference.h so the four versions cannot drift apart, and bound the number of rows as well: m + 1 row pointers and rounding m up to the block size have to stay within an int. - Report a failed host allocation instead of terminating on bad_alloc, and a failed device allocation in the SYCL version instead of dereferencing null in the kernel. - Check the CUDA and HIP kernel launches, so an invalid launch configuration is reported rather than showing up as a verification failure. - Fix the two SYCL kernel comments that still described the original HiOp one-work-item-per-row mapping. Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The examples themselves are now on master, so what is left here is the hardening of the four
schur-complement-*versions. Merged master to resolve the conflicts, keeping master's Makefiles (LAUNCHER,ARCH,SMandCUDA_ARCH/HIP_ARCHoverridable from the environment).Summary of the changes:
<rows>,<nnz per row>and<repeat>. The CSR row pointers and column indices are 32-bit, as in HiOp, so reject non-positive values, a nonzero count that would not fit an int, and row counts for whichm + 1or roundingmup to the block size would overflow. The check lives inreference.h(valid_problem_size) so the four versions cannot drift apart.bad_alloc, and a failed device allocation in the SYCL version instead of dereferencing a null pointer inside the kernel.BLOCK_X/BLOCK_Yas in the other versions.Verified with
./main 1024 32 20(all PASS): CUDA on a Tesla M40, HIP and OpenMP (AOMP) on an MI100, and SYCL on the M40 through the CUDA backend; the SYCL version also compiles withicpx. Invalid arguments (zero, negative, and out-of-range sizes) are rejected with exit status 1.