Negative-stride views crash kernels
维护者通常 3 天内回复
还没有人认领这个 Issue。
评估
调研方向
Start with TileArray(arr) conversion and src/compiler/analysis/assume.jl, especially the op_predicates chain applying nonneg_range() to strides. Trace how a reversed view reaches codegen and compare the stated rejection and ArraySpec approaches. Done means negative-stride views no longer cause an illegal GPU memory access and instead are safely rejected or handled without an invalid non-negative-stride assumption.
由索引模型根据 Issue 内容生成。
描述
A view with a negative stride converts to a TileArray without complaint, but kernels using it read out of bounds:
using CUDA, cuTile; import cuTile as ct
function copy_tiles(dst, src)
i = ct.bid(1)
ct.store(dst, i, ct.load(src, i, (256,)))
return
end
n = 4096
x = CuArray(Float32.(1:n)); y = CUDA.zeros(Float32, n)
@cuda backend=cuTile blocks=n÷256 copy_tiles(y, view(x, n:-1:1))
# CUDA error: an illegal memory access was encountered (code 700, ERROR_ILLEGAL_ADDRESS)
TileArray(arr) takes strides(arr) as is, so the reversed view becomes a TileArray with stride -1. Codegen asserts every size and stride is non-negative (op_predicates in src/compiler/analysis/assume.jl chains nonneg_range() for :stride), so tileiras may rely on an assumption that doesn't hold. cuTile Python makes the same assumption (stride_lower_bound_incl=0 for every JIT array argument), but PyTorch doesn't produce negative strides; view(x, n:-1:1) or reverse views do.
Options: reject negative strides when converting (an ArgumentError rather than a GPU fault), or record in the ArraySpec that strides may be negative and drop the assumption for such arrays, as Python's ArrayConstraint.stride_lower_bound_incl allows.
Reproduced on main (5c8e90b5), RTX 5080, Julia 1.13.
- 主要语言
- Julia
- 星标
- 90
- 派生
- 13
- 平均合并
- 4 天 8 小时
- 30 天内合并 PR
- 19
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
JuliaGPU/cuTile.jl 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 68/100
JuliaGPU/cuTile.jl#295 · 3 条评论 ·
维护者通常 3 天内回复
-
`atomic_store_add` of a slice extracted from a tile adds nothing when the slice is under 256 bytes未关闭
难度 4/5 3-5 天 新手友好度 48/100
维护者通常 3 天内回复
-
难度 5/5 一周以上 新手友好度 35/100
JuliaGPU/cuTile.jl#333 · 1 条评论 ·
维护者通常 3 天内回复
-
难度 4/5 3-5 天 新手友好度 30/100
维护者通常 3 天内回复
-
难度 4/5 3-5 天 新手友好度 52/100
维护者通常 3 天内回复
查看 JuliaGPU/cuTile.jl 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 70/100
MagneticResonanceImaging/MRIReco.jl#366 ·
维护者通常 3 天内回复
-
难度 2/5 1-3 小时 新手友好度 79/100
FluxML/Optimisers.jl#253 ·
-
难度 2/5 1-3 小时 新手友好度 76/100
JuliaGraphs/GraphNeuralNetworks.jl#736 ·
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 65/100
维护者通常 1 天内回复
-
`poissonians` is not public, unlike `brownians` and `jumps`可能已有人在做 @isaacsas 今天认领。 未关闭
难度 1/5 1 小时以内 新手友好度 86/100
SciML/ModelingToolkit.jl#5389 ·
维护者通常 2 天内回复