Skip to content

Commit a32fb04

Browse files
make GraphNeuralNetworks.jl depend on GNNGraphs.jl (#453)
* make GraphNeuralNetworks.jl depend on GNNGraphs.jl workflows drop_nodes(g, p) -> remove_nodes(g, p) compats * workflow
1 parent 7e7e202 commit a32fb04

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+49
-6432
lines changed

.github/workflows/tests_GraphNeuralNetworks.yml renamed to .github/workflows/test_GraphNeuralNetworks.yml

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,27 +21,28 @@ jobs:
2121
- ubuntu-latest
2222
arch:
2323
- x64
24-
env: # Don't use system Python (needed by PyCall)
25-
PYTHON: ""
24+
2625
steps:
2726
- uses: actions/checkout@v4
2827
- uses: julia-actions/setup-julia@v2
2928
with:
3029
version: ${{ matrix.version }}
3130
arch: ${{ matrix.arch }}
32-
- uses: actions/cache@v4
33-
env:
34-
cache-name: cache-artifacts
35-
with:
36-
path: ~/.julia/artifacts
37-
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
38-
restore-keys: |
39-
${{ runner.os }}-test-${{ env.cache-name }}-
40-
${{ runner.os }}-test-
41-
${{ runner.os }}-
31+
- uses: julia-actions/cache@v2
4232
- uses: julia-actions/julia-buildpkg@v1
43-
- uses: julia-actions/julia-runtest@v1
33+
- name: Install Julia dependencies and run tests
34+
shell: julia --project=monorepo {0}
35+
run: |
36+
using Pkg
37+
# dev mono repo versions
38+
pkg"registry up"
39+
Pkg.update()
40+
pkg"dev ./GNNGraphs ."
41+
Pkg.test("GraphNeuralNetworks"; coverage=true)
4442
- uses: julia-actions/julia-processcoverage@v1
43+
with:
44+
# directories: ./src, ./ext
45+
directories: ./src
4546
- uses: codecov/codecov-action@v4
4647
with:
47-
file: lcov.info
48+
files: lcov.info

GNNlib/Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ SparseArrays = "1"
4747
Statistics = "1"
4848
StatsBase = "0.34"
4949
cuDNN = "1"
50-
julia = "1.9"
50+
julia = "1.10"
5151

5252
[extras]
5353
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"

Project.toml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"
99
DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
1010
Flux = "587475ba-b771-5e3f-ad9e-33799f191a9c"
1111
Functors = "d9f16b24-f501-4c13-a1f2-28368ffc5196"
12+
GNNGraphs = "aed8fd31-079b-4b5a-b342-a13352159b8c"
1213
Graphs = "86223c79-3864-5bf0-83f7-82e725a168b6"
1314
KrylovKit = "0b1a1467-8014-51b9-945f-bf0ae24f4b77"
1415
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
@@ -24,11 +25,9 @@ StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"
2425

2526
[weakdeps]
2627
CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba"
27-
SimpleWeightedGraphs = "47aef6b3-ad0c-573a-a1e2-d07658019622"
2828

2929
[extensions]
3030
GraphNeuralNetworksCUDAExt = "CUDA"
31-
GraphNeuralNetworksSimpleWeightedGraphsExt = "SimpleWeightedGraphs"
3231

3332
[compat]
3433
Adapt = "3, 4"
@@ -38,6 +37,7 @@ DataStructures = "0.18"
3837
Flux = "0.14"
3938
Functors = "0.4.1"
4039
Graphs = "1.4"
40+
GNNGraphs = "1.0"
4141
KrylovKit = "0.6, 0.7, 0.8"
4242
LinearAlgebra = "1"
4343
MLDatasets = "0.7"
@@ -47,12 +47,11 @@ NNlib = "0.9"
4747
NearestNeighbors = "0.4"
4848
Random = "1"
4949
Reexport = "1"
50-
SimpleWeightedGraphs = "1.4.0"
5150
SparseArrays = "1"
5251
Statistics = "1"
5352
StatsBase = "0.34"
5453
cuDNN = "1"
55-
julia = "1.9"
54+
julia = "1.10"
5655

5756
[extras]
5857
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
@@ -62,10 +61,9 @@ DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
6261
FiniteDifferences = "26cc04aa-876d-5657-8c51-4c34ba976000"
6362
InlineStrings = "842dd82b-1e85-43dc-bf29-5d0ee9dffc48"
6463
MLDatasets = "eb30cadb-4394-5ae3-aed4-317e484a6458"
65-
SimpleWeightedGraphs = "47aef6b3-ad0c-573a-a1e2-d07658019622"
6664
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
6765
Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f"
6866
cuDNN = "02a925ec-e4fe-4b08-9a7e-0d78e3d38ccd"
6967

7068
[targets]
71-
test = ["Test", "Adapt", "DataFrames", "InlineStrings", "SimpleWeightedGraphs", "Zygote", "FiniteDifferences", "ChainRulesTestUtils", "MLDatasets", "CUDA", "cuDNN"]
69+
test = ["Test", "Adapt", "DataFrames", "InlineStrings", "Zygote", "FiniteDifferences", "ChainRulesTestUtils", "MLDatasets", "CUDA", "cuDNN"]

docs/src/dev.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# Developer Notes
22

3+
## Develop Monorepo
4+
5+
GraphNeuralNetworks.jl is package hosted in a monorepo that contains multiple packages.
6+
The GraphNeuralNetworks.jl package depends on GNNGraphs.jl, also hosted in the same monorepo.
7+
8+
```julia
9+
pkg> activate .
10+
11+
pkg> dev ./GNNGraphs
12+
```
313
## Benchmarking
414

515
You can benchmark the effect on performance of your commits using the script `perf/perf.jl`.

ext/GraphNeuralNetworksCUDAExt/msgpass.jl renamed to ext/GraphNeuralNetworksCUDAExt.jl

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,37 @@
1+
module GraphNeuralNetworksCUDAExt
2+
3+
using CUDA
4+
using Random, Statistics, LinearAlgebra
5+
using GraphNeuralNetworks
6+
using GNNGraphs
7+
using GNNGraphs: COO_T, ADJMAT_T, SPARSE_T
8+
import GraphNeuralNetworks: propagate
9+
10+
const CUMAT_T = Union{CUDA.AnyCuMatrix, CUDA.CUSPARSE.CuSparseMatrix}
111

212
###### PROPAGATE SPECIALIZATIONS ####################
313

414
## COPY_XJ
515

616
## avoid the fast path on gpu until we have better cuda support
717
function propagate(::typeof(copy_xj), g::GNNGraph{<:Union{COO_T, SPARSE_T}}, ::typeof(+),
8-
xi, xj::AnyCuMatrix, e)
18+
xi, xj::AnyCuMatrix, e)
919
propagate((xi, xj, e) -> copy_xj(xi, xj, e), g, +, xi, xj, e)
1020
end
1121

1222
## E_MUL_XJ
1323

1424
## avoid the fast path on gpu until we have better cuda support
1525
function propagate(::typeof(e_mul_xj), g::GNNGraph{<:Union{COO_T, SPARSE_T}}, ::typeof(+),
16-
xi, xj::AnyCuMatrix, e::AbstractVector)
26+
xi, xj::AnyCuMatrix, e::AbstractVector)
1727
propagate((xi, xj, e) -> e_mul_xj(xi, xj, e), g, +, xi, xj, e)
1828
end
1929

2030
## W_MUL_XJ
2131

2232
## avoid the fast path on gpu until we have better cuda support
2333
function propagate(::typeof(w_mul_xj), g::GNNGraph{<:Union{COO_T, SPARSE_T}}, ::typeof(+),
24-
xi, xj::AnyCuMatrix, e::Nothing)
34+
xi, xj::AnyCuMatrix, e::Nothing)
2535
propagate((xi, xj, e) -> w_mul_xj(xi, xj, e), g, +, xi, xj, e)
2636
end
2737

@@ -35,3 +45,5 @@ end
3545
# compute_degree(A) = Diagonal(1f0 ./ vec(sum(A; dims=2)))
3646

3747
# Flux.Zygote.@nograd compute_degree
48+
49+
end #module

ext/GraphNeuralNetworksCUDAExt/GNNGraphs/query.jl

Lines changed: 0 additions & 2 deletions
This file was deleted.

ext/GraphNeuralNetworksCUDAExt/GNNGraphs/transform.jl

Lines changed: 0 additions & 2 deletions
This file was deleted.

ext/GraphNeuralNetworksCUDAExt/GNNGraphs/utils.jl

Lines changed: 0 additions & 8 deletions
This file was deleted.

ext/GraphNeuralNetworksCUDAExt/GraphNeuralNetworksCUDAExt.jl

Lines changed: 0 additions & 17 deletions
This file was deleted.

0 commit comments

Comments
 (0)