Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid capturing external variables into closures #225

Merged
merged 2 commits into from
Nov 16, 2022
Merged

Conversation

CarloLucibello
Copy link
Member

This PR works around a notorious performance problem with closures in julia
JuliaLang/julia#15276
that recently triggered a bug in Zygote
FluxML/Zygote.jl#1290
that made NNConv gradient tests fail (#208)

We now avoid message function capturing external variables by adding additional propagate and apply_edges method.
These new methods take as input a GNNLayer as well and pass it to the message function.

We also make all internal types concrete for conv structs, which could improve performances on small graphs.

Fix #208

@codecov
Copy link

codecov bot commented Nov 16, 2022

Codecov Report

Merging #225 (55e6ed8) into master (45a14db) will decrease coverage by 0.73%.
The diff coverage is 82.71%.

@@            Coverage Diff             @@
##           master     #225      +/-   ##
==========================================
- Coverage   87.31%   86.58%   -0.74%     
==========================================
  Files          15       15              
  Lines        1411     1431      +20     
==========================================
+ Hits         1232     1239       +7     
- Misses        179      192      +13     
Impacted Files Coverage Δ
src/msgpass.jl 71.42% <66.66%> (-3.58%) ⬇️
src/layers/conv.jl 76.78% <85.50%> (-1.39%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@CarloLucibello CarloLucibello merged commit f9fc48a into master Nov 16, 2022
@CarloLucibello CarloLucibello deleted the cl/closures branch July 18, 2024 07:22
@CarloLucibello CarloLucibello mentioned this pull request Jul 28, 2024
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

NNConv tests are failing
1 participant