Some reshapes of subarrays are strided, but `StrideIndex` fails.
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 45/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- julia
- 领域
- performance
调研方向
复现两个 Julia 示例,然后检查 src/array_index.jl 第 197-203 行附近的代码,其中 StrideIndex 会失败。跟踪 dense_dims(view(A,ix,:,:)) 以及折叠维度的处理;当两个 StrideIndex 调用都能正常工作,并且 dense_dims 如描述的那样报告 (static(false), static(false)) 时,即视为完成。
由索引模型根据 Issue 内容生成。
描述
julia> ix = 2;
julia> A = rand(7, 5, 6);
julia> src = view(view(A,ix, :, :),:);
julia> ArrayInterface.StrideIndex(src)
ERROR: TypeError: in typeassert, expected Tuple{Int64}, got a value of type Nothing
Stacktrace:
[1] (ArrayInterface.StrideIndex{1, nothing, nothing})(s::Tuple{StaticInt{1}}, o::Tuple{StaticInt{1}})
@ ArrayInterface ~/.julia/dev/ArrayInterface/src/array_index.jl:197
[2] (ArrayInterface.StrideIndex{1, nothing, nothing})(a::SubArray{Float64, 1, Base.ReshapedArray{Float64, 1, SubArray{Float64, 2, Array{Float64, 3}, Tuple{Int64, Base.Slice{Base.OneTo{Int64}}, Base.Slice{Base.OneTo{Int64}}}, true}, Tuple{}}, Tuple{Base.Slice{Base.OneTo{Int64}}}, true})
@ ArrayInterface ~/.julia/dev/ArrayInterface/src/array_index.jl:200
[3] ArrayInterface.StrideIndex(a::SubArray{Float64, 1, Base.ReshapedArray{Float64, 1, SubArray{Float64, 2, Array{Float64, 3}, Tuple{Int64, Base.Slice{Base.OneTo{Int64}}, Base.Slice{Base.OneTo{Int64}}}, true}, Tuple{}}, Tuple{Base.Slice{Base.OneTo{Int64}}}, true})
@ ArrayInterface ~/.julia/dev/ArrayInterface/src/array_index.jl:203
[4] top-level scope
@ REPL[25]:1
julia> ArrayInterface.StrideIndex(vec(view(A,ix,:,:)))
ERROR: TypeError: in typeassert, expected Tuple{Int64}, got a value of type Nothing
Stacktrace:
[1] (ArrayInterface.StrideIndex{1, nothing, nothing})(s::Tuple{StaticInt{1}}, o::Tuple{StaticInt{1}})
@ ArrayInterface ~/.julia/dev/ArrayInterface/src/array_index.jl:197
[2] (ArrayInterface.StrideIndex{1, nothing, nothing})(a::Base.ReshapedArray{Float64, 1, SubArray{Float64, 2, Array{Float64, 3}, Tuple{Int64, Base.Slice{Base.OneTo{Int64}}, Base.Slice{Base.OneTo{Int64}}}, true}, Tuple{}})
@ ArrayInterface ~/.julia/dev/ArrayInterface/src/array_index.jl:200
[3] ArrayInterface.StrideIndex(a::Base.ReshapedArray{Float64, 1, SubArray{Float64, 2, Array{Float64, 3}, Tuple{Int64, Base.Slice{Base.OneTo{Int64}}, Base.Slice{Base.OneTo{Int64}}}, true}, Tuple{}})
@ ArrayInterface ~/.julia/dev/ArrayInterface/src/array_index.jl:203
[4] top-level scope
@ REPL[26]:1
Basically, if collapsed dims are dense with respect to one another, collapsing them presevers strided-ness.
We should also redefine dense dims as necessary to be a statement only about that dim.
julia> ArrayInterface.dense_dims(view(A,ix,:,:))
(static(false), static(false))
So that the first dim is not dense, but the second one still is w/ respect to the first.
- 主要语言
- Julia
- 星标
- 14
- 派生
- 8
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
我们还没有检查这个项目的环境配置文件。先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
JuliaArrays/StaticArrayInterface.jl 的其他 Issue
-
tagbot-manual
难度 1/5 1 小时以内 新手友好度 68/100
-
难度 3/5 1-2 天 新手友好度 35/100
-
Storage Order未关闭
难度 5/5 一周以上 新手友好度 25/100
JuliaArrays/StaticArrayInterface.jl#4 · 1 条评论 ·
-
难度 4/5 3-5 天 新手友好度 32/100
JuliaArrays/StaticArrayInterface.jl#3 · 10 条评论 ·
-
难度 5/5 一周以上 新手友好度 20/100
查看 JuliaArrays/StaticArrayInterface.jl 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 84/100
SciML/NonlinearSolve.jl#1336 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 68/100
JuliaRegistries/General#169551 ·
维护者通常 1 天内回复
-
tagbot-manual
难度 2/5 1-3 小时 新手友好度 72/100
JuliaGraphics/Colors.jl#589 · 2 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 78/100
TulipaEnergy/TulipaEnergyModel.jl#1713 ·
维护者通常 1 天内回复
-
CPU `∇maxpool` sends the gradient to a non-maximal element when another is within `≈` of the max未关闭
难度 2/5 1-3 小时 新手友好度 85/100