Unused output of node type leads to index error in Zygote
Maintainers usually reply within 2 days
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- julia
- Domain
- machine-learning
Research direction
Start with the failing MWE in the issue and trace the GATConv call through src/layers/conv.jl and src/layers/heteroconv.jl, then inspect the reported gat_conv location in GNNlib. Reproduce the Zygote gradient error with the unused node type C and check the related tests. Done means the gradient completes without a bounds error; an open linked pull request already addresses this issue.
Written by the indexing model from the issue text.
Description
MWE:
using GraphNeuralNetworks, Flux
g = GNNHeteroGraph(
Dict(
(:A, :a, :B) => ([1, 2], [3, 4]),
(:B, :a, :A) => ([1], [2]),
(:A, :a, :C) => ([1], [1]),
);
num_nodes = Dict(:A => 3, :B => 5, :C => 2),
)
layer = HeteroGraphConv([et => GATConv(2 => 2) for et in keys(g.edata)])
x = (A = rand(Float32, 2, 3), B = rand(Float32, 2, 5), C = rand(Float32, 2, 2))
Flux.gradient(x) do x
y = layer(g, x)
sum(y[:A]) + sum(y[:B])
end
Error
ERROR: LoadError: BoundsError: attempt to access Tuple{Nothing, ChainRulesCore.ZeroTangent, ChainRulesCore.ZeroTangent} at index [4]
Stacktrace:
[1] getindex
@ ./tuple.jl:33 [inlined]
[2] gradindex(x::Tuple{Nothing, ChainRulesCore.ZeroTangent, ChainRulesCore.ZeroTangent}, i::Int64)
@ Zygote ~/.julia/packages/Zygote/5O3tb/src/compiler/reverse.jl:24
[3] gat_conv
@ ~/.julia/packages/GNNlib/sAfhh/src/layers/conv.jl:154 [inlined]
[4] (::Zygote.Pullback{Tuple{typeof(gat_conv), GATConv{Dense{typeof(identity), Matrix{Float32}, Bool}, Nothing, Float64, Float32, Matrix{Float32}, typeof(identity), Vector{Float32}}, GNNHeteroGraph{Tuple{Vector{Int64}, Vector{Int64}, Nothing}}, Tuple{Matrix{Float32}, Matrix{Float32}}, Nothing}, Any})(Δ::ChainRulesCore.ZeroTangent)
@ Zygote ~/.julia/packages/Zygote/5O3tb/src/compiler/interface2.jl:0
[5] GATConv (repeats 2 times)
@ ~/.julia/packages/GraphNeuralNetworks/C8IDs/src/layers/conv.jl:346 [inlined]
[6] forw
@ ~/.julia/packages/GraphNeuralNetworks/C8IDs/src/layers/heteroconv.jl:63 [inlined]
- Dominant language
- Julia
- Stars
- 310
- Forks
- 75
- Avg merge
- 2d 15h
- Merged PRs (30d)
- 10
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from JuliaGraphs/GraphNeuralNetworks.jl
-
lux
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
JuliaGraphs/GraphNeuralNetworks.jl#732 ·
Maintainers usually reply within 2 days
-
gnngraphs
Difficulty 4/5 3-5 days Newbie friendliness 45/100
JuliaGraphs/GraphNeuralNetworks.jl#733 ·
Maintainers usually reply within 2 days
-
maintainance
Difficulty 3/5 1-2 days Newbie friendliness 45/100
JuliaGraphs/GraphNeuralNetworks.jl#725 ·
Maintainers usually reply within 2 days
-
GCNConv fails to compile with Reactant - MethodErrorPossibly taken @DHAKED440 claimed this 3 days ago. Opengnnlib lux
Difficulty 3/5 1-2 days Newbie friendliness 68/100
JuliaGraphs/GraphNeuralNetworks.jl#710 ·
Maintainers usually reply within 2 days
-
flux gnngraphs gnnlib
Difficulty 4/5 3-5 days Newbie friendliness 45/100
JuliaGraphs/GraphNeuralNetworks.jl#702 · 1 comment ·
Maintainers usually reply within 2 days
All issues in JuliaGraphs/GraphNeuralNetworks.jl
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
erfinv(::Float16) and erfcinv(::Float16) are wrong for abs(x) <= 0.75 (erfinv(Float16(0)) == 0.2201)Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
JuliaMath/SpecialFunctions.jl#571 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100