perf(forest): thread the reference BlockForest path — leaf sweeps and exchange descriptor loops

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

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
48/100
Issue 类型
重构
描述清晰度
基本清楚
活跃度
活跃
技术栈
julia

调研方向

Start with _forest_sweep_leaves! and _forest_adjoint_sweep_leaves! in src/operators/forest.jl, then inspect the three descriptor loops in _exchange_storage! in src/transfer.jl. Check whether descriptors in each exchange phase can alias destinations and compare the executor decision with #51. Run examples/niederer_benchmark.jl and verify diffusion scales with -t while the adjoint sweep preserves the stated inner-product equality bit-for-bit against the serial path.

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

描述

performance

Carved out of #49 (candidate 1) so it can be tracked as one unit of work.

_forest_sweep_leaves! (src/operators/forest.jl), _forest_adjoint_sweep_leaves!, and the three descriptor loops in _exchange_storage! (src/transfer.jl) are plain serial for loops; on CPU the packed kernels fall back to the same broadcasts. Leaves are disjoint and the exchange phases are ordered to be independent within a phase, so this looks close to embarrassingly parallel. In the Niederer benchmark the reaction term is threaded in example code while diffusion is not, which is a large part of why the two phases scale so differently (#49: diffusion 0.44× on 5.3× fewer cells).

Check first

Whether descriptors within one exchange phase can alias the same destination block. If they can, the threaded sweep needs a partition by destination or atomics; if they cannot, a Threads.@threads over descriptors is enough.

Constraints

  • Same executor decision as #51 (KA CPU backend vs a threaded executor at the apply! seam); pick once for both single-grid and forest paths.
  • Must not disturb the _exchange_storage! / _bc_storage! rule seams: no allocation inside them, no Field-typed rule arguments.
  • Acceptance: the examples/niederer_benchmark.jl phase table shows the diffusion phase scaling with -t, and the adjoint sweep keeps ⟨Lx,y⟩ = ⟨x,Lᵀy⟩ bit-for-bit against the serial path.

🤖 Beep boop — Claude split this off #49; Kyle is not forking himself.

主要语言
Julia
星标
3
派生
1
平均合并
4 天 19 小时
30 天内合并 PR
5

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

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

RallypointOne/MatrixFreeOperators.jl 的其他 Issue

查看 RallypointOne/MatrixFreeOperators.jl 的全部 Issue

相似的 Issue

更多 Julia Issue

把新 issue 发到你的邮箱

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