-
Notifications
You must be signed in to change notification settings - Fork 99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix SpGEMM crashing on empty rows #1220
Fix SpGEMM crashing on empty rows #1220
Conversation
Status Flag 'Pre-Test Inspection' - - This Pull Request Requires Inspection... The code must be inspected by a member of the Team before Testing/Merging |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good I just want to make sure we are not missing a corner case, also @brian-kelley please look at this too.
@@ -139,6 +139,8 @@ void spgemm_numeric(KernelHandle *handle, | |||
"If you need this case please let kokkos-kernels developers know.\n"); | |||
} | |||
|
|||
if (m < 1 || n < 1 || k < 1) return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not recall the exact interface we provide so I just want to make sure that the short cut above does not create issues for something like: C=beta*C+alpha*A*B
which would fail to compute C=beta*C
if k==0
.
I believe that we only implement C=alpha*A*B
though?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct, we don't support adding to an existing C, so this check is OK.
Status Flag 'Pre-Test Inspection' - SUCCESS: The last commit to this Pull Request has been INSPECTED by label AT: PRE-TEST INSPECTED! Autotester is Removing Label; This inspection will remain valid until a new commit to source branch is performed. |
Status Flag 'Pull Request AutoTester' - Testing Jenkins Projects: Pull Request Auto Testing STARTING (click to expand)Build InformationTest Name: KokkosKernels_PullRequest_Tpls_CUDA9_GCC720_Light_Tpls_GCC720_GCC740
Jenkins Parameters
Build InformationTest Name: KokkosKernels_PullRequest_Tpls_CUDA10_Tpls_CUDA10_LayoutRight
Jenkins Parameters
Build InformationTest Name: KokkosKernels_PullRequest_GCC720
Jenkins Parameters
Build InformationTest Name: KokkosKernels_PullRequest_GCC720_Light_LayoutRight
Jenkins Parameters
Build InformationTest Name: KokkosKernels_PullRequest_Tpls_GCC720
Jenkins Parameters
Build InformationTest Name: KokkosKernels_PullRequest_Tpls_INTEL18
Jenkins Parameters
Build InformationTest Name: KokkosKernels_PullRequest_CLANG1001
Jenkins Parameters
Using Repos:
Pull Request Author: MikolajZuzek |
Status Flag 'Pull Request AutoTester' - Jenkins Testing: all Jobs PASSED Pull Request Auto Testing has PASSED (click to expand)Build InformationTest Name: KokkosKernels_PullRequest_Tpls_CUDA9_GCC720_Light_Tpls_GCC720_GCC740
Jenkins Parameters
Build InformationTest Name: KokkosKernels_PullRequest_Tpls_CUDA10_Tpls_CUDA10_LayoutRight
Jenkins Parameters
Build InformationTest Name: KokkosKernels_PullRequest_GCC720
Jenkins Parameters
Build InformationTest Name: KokkosKernels_PullRequest_GCC720_Light_LayoutRight
Jenkins Parameters
Build InformationTest Name: KokkosKernels_PullRequest_Tpls_GCC720
Jenkins Parameters
Build InformationTest Name: KokkosKernels_PullRequest_Tpls_INTEL18
Jenkins Parameters
Build InformationTest Name: KokkosKernels_PullRequest_CLANG1001
Jenkins Parameters
|
Status Flag 'Pre-Merge Inspection' - - This Pull Request Requires Inspection... The code must be inspected by a member of the Team before Testing/Merging |
All Jobs Finished; status = PASSED, However Inspection must be performed before merge can occur... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @MikolajZuzek !
@@ -139,6 +139,8 @@ void spgemm_numeric(KernelHandle *handle, | |||
"If you need this case please let kokkos-kernels developers know.\n"); | |||
} | |||
|
|||
if (m < 1 || n < 1 || k < 1) return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct, we don't support adding to an existing C, so this check is OK.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the fix!
Status Flag 'Pre-Merge Inspection' - SUCCESS: The last commit to this Pull Request has been INSPECTED AND APPROVED by [ brian-kelley lucbv ]! |
Status Flag 'Pull Request AutoTester' - Pull Request MUST BE MERGED MANUALLY BY Project Team - This Repo does not support Automerge |
Contents
SPGEMM_KK_LP
to coverMultiCoreTag4
functor in hash method on CPU;SPGEMM_KK_SPEED
to cover speed method -KokkosSPGEMM_numeric_speed()
;GPUTag4
(SPGEMM_KK_MEMORY_SPREADTEAM
) andGPUTag6
(SPGEMM_KK_MEMORY_BIGSPREADTEAM
)Details
Shared memory alignment
teamMember.team_shmem().get_shmem(shared_memory_size)
aligns the size to 8 bytes rounding up and if this number is higher than allocation size inteam_shmem_size()
, the allocation will fail returningnullptr
(and crash follow-up computation). Thus we need to always align ourshared_memory_size
.Empty row guard
Without proposed guards that skip empty rows,
GPUTag4
andGPUTag6
can crash trying to fetchentriesA
/valuesA
asa_col_begin_offset
in case of empty row indexes the first element of the next row and - when A has trailing empty rows - falls outside the view bounds: