OpenCL mxm: fix chunk pool estimation and multi-segment row-list pointers

Open
#315 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
52/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
cpp

Research direction

Start with src/opencl/cl_mxm_chunk_estimate.hpp and trace how estimate_chunk_pool accounts for chunk storage, including the 48-byte header. Then follow row-list pointers in src/opencl/kernels/chunk.cl and the mxm_merge_* paths in cl_mxm_pipeline.hpp and the mxm_merge_*.cl files. Check how CHUNK_MULTI_SEGMENT is passed as 0 or 1; done means pool estimates include headers and row-list pointers work across pool segments.

Written by the indexing model from the issue text.

Description

task

Problem: OpenCL mxm breaks on larger matrices whenever CL_MXM_POOL_FAIL allocates a second pool segment: mxm_merge_* and spla_chunk_add_potentially_shared_row (output_row_list_heads / next_*) only address the latest single chunks buffer without segment index, while estimate_chunk_pool underestimates pool bytes by ignoring chunk headers.

Fix:

  1. Account for chunk header/prefix overhead (48 bytes per chunk) in estimate_chunk_pool (src/opencl/cl_mxm_chunk_estimate.hpp) to avoid unnecessary CL_MXM_POOL_FAIL restarts.
  2. Add multi-segment support to row-list pointers (src/opencl/kernels/chunk.cl) and mxm_merge_* (cl_mxm_pipeline.hpp, mxm_merge_*.cl), gated by -D CHUNK_MULTI_SEGMENT=0/1.
Dominant language
C++
Stars
37
Forks
21
Avg merge
11h 3m
Merged PRs (30d)
13

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from SparseLinearAlgebra/spla

All issues in SparseLinearAlgebra/spla

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.