Fix intra-workgroup counts/scan_sum race in spla_mxm_merge_simple_kernel
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 70/100
Research direction
Read src/opencl/kernels/mxm_merge_simple.cl and inspect spla_mxm_merge_simple_kernel around the counts read and wd_initialize call. Add the local memory barrier at the specified point, regenerate src/opencl/generated/auto_mxm_merge_simple.hpp, and add a regression test that exercises multiple subgroups and checks for deterministic mxm results.
Written by the indexing model from the issue text.
Description
Non-deterministic mxm checksum starting at c2e3187c (313-S2) because spla_mxm_merge_simple_kernel in src/opencl/kernels/mxm_merge_simple.cl reads scratch.load.counts[...] and immediately calls wd_initialize(scratch.work.work_sum, scratch.work.scan_sum, ...) without a barrier(CLK_LOCAL_MEM_FENCE).
After c2e3187c unpadded work_sum (MS_THREADS * 2u + 1u < LM_SIZE(MS_THREADS * 2u)), scratch.work.scan_sum overlaps the tail of scratch.load.counts inside union MxMMergeSimpleScratch, so with WD_BLOCKIN == 1u faster subgroups overwrite counts before other subgroups read it.
Fix: add barrier(CLK_LOCAL_MEM_FENCE); after reading scratch.load.counts[...] and before wd_initialize(...) in src/opencl/kernels/mxm_merge_simple.cl, regenerate src/opencl/generated/auto_mxm_merge_simple.hpp, and add a multi-subgroup regression test.
- Dominant language
- C++
- Stars
- 37
- Forks
- 21
- Avg merge
- 11h 3m
- Merged PRs (30d)
- 13
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from SparseLinearAlgebra/spla
-
task
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
SparseLinearAlgebra/spla#316 · 1 comment ·
Maintainers usually reply within 1 day
-
task
Difficulty 1/5 Under an hour Newbie friendliness 88/100
SparseLinearAlgebra/spla#249 · 1 comment ·
Maintainers usually reply within 1 day
-
task
Difficulty 4/5 3-5 days Newbie friendliness 52/100
SparseLinearAlgebra/spla#315 · 1 comment ·
Maintainers usually reply within 1 day
-
Optimize compute_spgemm_part chunk flushes, atomics, radix sort, SLM, restrict, and subgroup shuffleOpentask
Difficulty 5/5 Over a week Newbie friendliness 35/100
SparseLinearAlgebra/spla#313 · 1 comment ·
Maintainers usually reply within 1 day
-
task
Difficulty 4/5 3-5 days Newbie friendliness 35/100
SparseLinearAlgebra/spla#312 · 1 comment ·
Maintainers usually reply within 1 day
All issues in SparseLinearAlgebra/spla
Similar issues
-
[Bug]: pip install -U cudaq-qec fails with a conflict that names cudaq-qec itselfPossibly taken @fedonman claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Maintainers usually reply within 3 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
gofractally/psibase#2379 ·
Maintainers usually reply within 3 days