Fix OpenCL mxm sort-mode fallback, pinned staging and batched status readback

未关闭
#291 3 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
48/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
cpp

调研方向

Read spla/AGENTS.md and Algorithm Semantics.md first, then inspect spla/src/opencl/cl_mxm_compute_spgemm_part.hpp around line 143 and cl_mxm_pipeline.hpp around lines 153–196, 557, 587, 750, and 780. Compare the staging and status transfer approach with GALATIC’s Multiply.cuh lines 569–571, following the linked source references in Algorithm Semantics.md. Done means large-column cases such as cols = 227320 select 64-bit mode, pinned staging is reused, and the four status values are read together.

由索引模型根据 Issue 内容生成。

描述

task

You are porting step by step the multiplication algorithm from GALATIC and integrating it into the spla library, following spla architecture. Its semantics are given to you. The "HOW" of implementing it is in the GALATIC sources (links to the specific ones are in Algorithm Semantics.md). Read spla/AGENTS.md, then Algorithm Semantics.md. Simplifying the implementation without a reason is not allowed. If you have doubts, uncertainty, or ambiguity, ask immediately. If you see are cub primitives,which don't have a direct OpenCL or spla direct analog, you need to observe how they work(in cub/), so that you don’t end up writing a naive or inefficient implementation. Right now you need to fix this critical bugs:
Fix the sort-mode selection in spla/src/opencl/cl_mxm_compute_spgemm_part.hpp:143 so that 32-bit mode is chosen only when row_bits + col_bits <= 32, with large-column cases such as cols = 227320 falling back to 64-bit mode.
- Persistent pinned staging: create one host-visible/pinned buffer (CL_MEM_ALLOC_HOST_PTR) once and reuse it, instead of cl_mxm_read/write allocating staging and doing a blocking copy every time (cl_mxm_pipeline.hpp:153-196).
- Batched readback: write flags, shared_rows, counters, and output_count into one status buffer, then read/map it once instead of 5 separate blocking reads (:557,587,750,780).
Goal: remove repeated queue drains, so the CPU does not wait after every small scalar. GALATIC does something similar with one cudaMemcpy for flags+counters: Multiply.cuh:569-571.

主要语言
C++
星标
37
派生
21
平均合并
11 小时 3 分钟
30 天内合并 PR
13

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

SparseLinearAlgebra/spla 的其他 Issue

查看 SparseLinearAlgebra/spla 的全部 Issue

相似的 Issue

更多 C++ Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。