First matrix product takes 2–3× longer to compile with GPUArrays 12.3.0: `mul!` compiles every branch's kernel launches
维护者通常 2 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 48/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- julia
- 领域
- performance
调研方向
Start with the mul! paths in GPUArrays 12.3.0 described in the report, especially generic_matmatmul!, tiled_matmatmul!, and the storage-level methods from #852; compare them with the matvec kernels from #855. Reproduce the first-call timings with the supplied JLArrays example and --trace-compile-timing. Done means identifying and addressing the unnecessary host compilation while preserving the reported matrix product behavior and validating the fresh-process timings.
由索引模型根据 Issue 内容生成。
描述
I saw this on the TTFX graph, this might be intended but thought I would open an issue in case it is not.
🤖
The first A * b on a JLArray went from about 0.7 s to 2.0 s between GPUArrays 12.2.0 and 12.3.0.
using JLArrays
A = jl(rand(3, 3)); b = jl(rand(3))
@time A * b
First call in a fresh process with the JIT object cache cleared, in ms:
A*b |
A*B |
A'*b |
Symmetric(A)*b |
A*A' |
|
|---|---|---|---|---|---|
| 12.2.0 | 708 | 677 | 708 | 722 | 694 |
| 12.3.0 | 1997 | 1226 | 1969 | 2141 | 1246 |
The kernel itself compiles in about 0.2 s as before. The rest is host code: --trace-compile-timing attributes about 1.4 s to *(::JLArray{Float64, 2}, ::JLArray{Float64, 1}), up from about 60 ms.
Compiling that one method now specializes the kernel compile-and-launch code for kernels the call never runs:
LinearAlgebra.@stable_muladdmulingeneric_matmatmul!andtiled_matmatmul!expands to a branch perMulAddMultype, so everything below it is compiled four times.- The storage-level
mul!methods from #852 reach, statically,_rmul_or_fill!(fill and scale kernels), the reshape fallback into the matrixmul!, andblas_syrk!/blas_herk!withcopytri!(four kernels). - The matvec kernels from #855 loop over a
StepRange, whose construction can throw. That sends the kernel through GPUCompiler's exception-site code, which is not precompiled (about 100 ms).
- 主要语言
- Julia
- 星标
- 462
- 派生
- 109
- 平均合并
- 4 天 11 小时
- 30 天内合并 PR
- 26
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
JuliaGPU/GPUArrays.jl 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 74/100
JuliaGPU/GPUArrays.jl#881 ·
维护者通常 2 天内回复
-
arrays
难度 2/5 1-3 小时 新手友好度 68/100
JuliaGPU/GPUArrays.jl#697 · 1 个 reaction ·
维护者通常 2 天内回复
-
难度 3/5 1-2 天 新手友好度 58/100
JuliaGPU/GPUArrays.jl#880 ·
维护者通常 2 天内回复
-
难度 3/5 1-2 天 新手友好度 57/100
JuliaGPU/GPUArrays.jl#879 ·
维护者通常 2 天内回复
-
JLArrays 0.5: `erfcx`, `logerfc`, `logerfcx` fail (worked in 0.4)可能已有人在做 @timholy 于 2 天前认领。 未关闭
难度 4/5 3-5 天 新手友好度 48/100
JuliaGPU/GPUArrays.jl#877 ·
维护者通常 2 天内回复
查看 JuliaGPU/GPUArrays.jl 的全部 Issue
相似的 Issue
-
Release CorleoneInverse as 0.1.1可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 1/5 1 小时以内 新手友好度 78/100
SciML/Corleone.jl#200 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
JuliaAI/MLJTransforms.jl#120 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 88/100
exercism/julia#1205 · 3 条评论 · 1 个 reaction ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 90/100
SciML/OrdinaryDiffEq.jl#5175 ·
维护者通常 1 天内回复