Optimize spla_mxm_compute_spgemm_part_kernel local memory, barriers, and atomics

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

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
25/100
Issue 类型
重构
描述清晰度
描述清楚
活跃度
活跃
技术栈
cpp
领域
performance

调研方向

Read src/opencl/kernels/mxm_compute_spgemm_part.cl and src/opencl/cl_mxm_compute_spgemm_part.hpp, then inspect generate.py and the generated auto_mxm_compute_spgemm_part.hpp. Trace the kernel’s chunk row/count boundaries, especially emit_start + num - 1, before changing its memory use, synchronization, and atomics. Done means the requested optimizations are implemented, the generated header is refreshed, and the exact boundary semantics are preserved.

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

描述

task

Refactor spla_mxm_compute_spgemm_part_kernel in src/opencl/kernels/mxm_compute_spgemm_part.cl, fix compute_spgemm_part_local_memory_bytes in src/opencl/cl_mxm_compute_spgemm_part.hpp, and regenerate auto_mxm_compute_spgemm_part.hpp via generate.py while preserving spla's exact chunk row/count boundary semantics (emit_start + num - 1): (1) remove CspTempMem::emit 5 staged_* arrays (break_positions, scan, staged_row_ids/col_ids/values/counts/row_ends) and write directly from register entries[i] to comb.current streaming chunks in CSP_TEMP_ITEMS_PER_BLOCK batches, and fix current_row_slots in cl_mxm_compute_spgemm_part.hpp to use threads * retain_elements_per_thread; (2) skip direct_scan/nondirect_scan + temp.setup.compact when direct_chunk_rows == 0; (3) use subgroup reductions instead of 4x per-thread local atomic_min/atomic_max and atomic_or for split_mode; (4) replace CSP_CONSUME_WORK local atomic_add + barrier with thread-0 update, replace csp_emit_chunk_range thread-0 linear scans for first_count/last_count, guard atomic_or(run_flags, status_mask) on status_mask != 0, and remove redundant init barriers (L516, L745-751).

主要语言
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 摘要。