Repository navigation
Backlog
Description
#708 adds Enzyme to the gradient tests of GraphNeuralNetworks and GNNlib (CPU, Julia ≥ 1.12). The test sites below still skip Enzyme. The reasons come from the skip comments in #708 and were last checked on Julia 1.13.3 with Enzyme 0.13.216–0.13.218, before #756.
Type instabilities in our code
Fixing these should re-enable the corresponding tests.
-
to_dense(A::ADJMAT_T)(convert.jl) reassignsAto an adjoint, a converted copy or a binarized copy, so its return type is aUnion. On dense graphspropagate(copy_xj, g, +)multiplies byadjacency_matrix(g, T; weighted = false), and Enzyme throwsIllegalTypeAnalysisException. Skipped on:densegraphs: GraphConv, GatedGraphConv, SAGEConv, GNNChain, and GNNlib'spropagate(copy_xj, +). -
degree(g, T; edge_weight::Bool):_get_edge_weightreturnsnothingor a vector depending on the runtimeBool. ThatUnionflows through the k-hop loops ofsg_convandtag_conv(IllegalTypeAnalysisException). Skipped: SGConv on all graph types, TAGConv on COO and dense (Enzyme copes on sparse). - Keyword
GNNGraphconstructor (gnngraph.jl): its locals take different types across thegraph_typebranches.d_convbuilds the transposed graph with it insideignore_derivatives, which Enzyme does not treat as inactive (IllegalTypeAnalysisException). Skipped: DCGRUCell, DCGRU. DConv is also Zygote-only, without a comment; its forward pass is the samed_conv, so the cause is likely the same.
Enzyme bugs (no upstream issue linked yet)
- TGCNCell, TGCN: compiling the gradient hangs (25+ min with no output).
- GConvLSTMCell, GConvLSTM, GConvGRUCell, GConvGRU:
LLVM error: Referring to an instruction in another function!while linking the derivative, since Julia 1.13.3.
Expected behavior
- EvolveGCNOCell with an initial state:
state.weightandstate.lstm[1]are the same array. Enzyme sums both slots' gradients into one shadow (Gradient semantics for Duplicated arguments containing the same array in two slots EnzymeAD/Enzyme.jl#3408), while Zygote and finite differences report each slot separately. Not a bug on our side.
Not covered
- GPU tests (
test_gpu = true) don't run Enzyme. - GNNLux skips Enzyme in all its gradient tests (
skip_backends).
See also #389.
🧔♂️🤖 Assisted by Claude Sonnet 5.5
Metadata
Metadata
Assignees
Labels
No labels
Activity