Skip to content

Commit

Permalink
make GraphNeuralNetworks.jl depend on GNNGraphs.jl (#453)
Browse files Browse the repository at this point in the history
* make GraphNeuralNetworks.jl depend on GNNGraphs.jl

workflows

drop_nodes(g, p) -> remove_nodes(g, p)

compats

* workflow
  • Loading branch information
CarloLucibello authored Jul 24, 2024
1 parent 7e7e202 commit a32fb04
Show file tree
Hide file tree
Showing 41 changed files with 49 additions and 6,432 deletions.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -21,27 +21,28 @@ jobs:
- ubuntu-latest
arch:
- x64
env: # Don't use system Python (needed by PyCall)
PYTHON: ""

steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v2
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
- uses: actions/cache@v4
env:
cache-name: cache-artifacts
with:
path: ~/.julia/artifacts
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
restore-keys: |
${{ runner.os }}-test-${{ env.cache-name }}-
${{ runner.os }}-test-
${{ runner.os }}-
- uses: julia-actions/cache@v2
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-runtest@v1
- name: Install Julia dependencies and run tests
shell: julia --project=monorepo {0}
run: |
using Pkg
# dev mono repo versions
pkg"registry up"
Pkg.update()
pkg"dev ./GNNGraphs ."
Pkg.test("GraphNeuralNetworks"; coverage=true)
- uses: julia-actions/julia-processcoverage@v1
with:
# directories: ./src, ./ext
directories: ./src
- uses: codecov/codecov-action@v4
with:
file: lcov.info
files: lcov.info
2 changes: 1 addition & 1 deletion GNNlib/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ SparseArrays = "1"
Statistics = "1"
StatsBase = "0.34"
cuDNN = "1"
julia = "1.9"
julia = "1.10"

[extras]
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
Expand Down
10 changes: 4 additions & 6 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"
DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
Flux = "587475ba-b771-5e3f-ad9e-33799f191a9c"
Functors = "d9f16b24-f501-4c13-a1f2-28368ffc5196"
GNNGraphs = "aed8fd31-079b-4b5a-b342-a13352159b8c"
Graphs = "86223c79-3864-5bf0-83f7-82e725a168b6"
KrylovKit = "0b1a1467-8014-51b9-945f-bf0ae24f4b77"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Expand All @@ -24,11 +25,9 @@ StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"

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

[extensions]
GraphNeuralNetworksCUDAExt = "CUDA"
GraphNeuralNetworksSimpleWeightedGraphsExt = "SimpleWeightedGraphs"

[compat]
Adapt = "3, 4"
Expand All @@ -38,6 +37,7 @@ DataStructures = "0.18"
Flux = "0.14"
Functors = "0.4.1"
Graphs = "1.4"
GNNGraphs = "1.0"
KrylovKit = "0.6, 0.7, 0.8"
LinearAlgebra = "1"
MLDatasets = "0.7"
Expand All @@ -47,12 +47,11 @@ NNlib = "0.9"
NearestNeighbors = "0.4"
Random = "1"
Reexport = "1"
SimpleWeightedGraphs = "1.4.0"
SparseArrays = "1"
Statistics = "1"
StatsBase = "0.34"
cuDNN = "1"
julia = "1.9"
julia = "1.10"

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

[targets]
test = ["Test", "Adapt", "DataFrames", "InlineStrings", "SimpleWeightedGraphs", "Zygote", "FiniteDifferences", "ChainRulesTestUtils", "MLDatasets", "CUDA", "cuDNN"]
test = ["Test", "Adapt", "DataFrames", "InlineStrings", "Zygote", "FiniteDifferences", "ChainRulesTestUtils", "MLDatasets", "CUDA", "cuDNN"]
10 changes: 10 additions & 0 deletions docs/src/dev.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Developer Notes

## Develop Monorepo

GraphNeuralNetworks.jl is package hosted in a monorepo that contains multiple packages.
The GraphNeuralNetworks.jl package depends on GNNGraphs.jl, also hosted in the same monorepo.

```julia
pkg> activate .

pkg> dev ./GNNGraphs
```
## Benchmarking

You can benchmark the effect on performance of your commits using the script `perf/perf.jl`.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,27 +1,37 @@
module GraphNeuralNetworksCUDAExt

using CUDA
using Random, Statistics, LinearAlgebra
using GraphNeuralNetworks
using GNNGraphs
using GNNGraphs: COO_T, ADJMAT_T, SPARSE_T
import GraphNeuralNetworks: propagate

const CUMAT_T = Union{CUDA.AnyCuMatrix, CUDA.CUSPARSE.CuSparseMatrix}

###### PROPAGATE SPECIALIZATIONS ####################

## COPY_XJ

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

## E_MUL_XJ

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

## W_MUL_XJ

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

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

# Flux.Zygote.@nograd compute_degree

end #module
2 changes: 0 additions & 2 deletions ext/GraphNeuralNetworksCUDAExt/GNNGraphs/query.jl

This file was deleted.

2 changes: 0 additions & 2 deletions ext/GraphNeuralNetworksCUDAExt/GNNGraphs/transform.jl

This file was deleted.

8 changes: 0 additions & 8 deletions ext/GraphNeuralNetworksCUDAExt/GNNGraphs/utils.jl

This file was deleted.

17 changes: 0 additions & 17 deletions ext/GraphNeuralNetworksCUDAExt/GraphNeuralNetworksCUDAExt.jl

This file was deleted.

This file was deleted.

113 changes: 0 additions & 113 deletions src/GNNGraphs/GNNGraphs.jl

This file was deleted.

11 changes: 0 additions & 11 deletions src/GNNGraphs/abstracttypes.jl

This file was deleted.

15 changes: 0 additions & 15 deletions src/GNNGraphs/chainrules.jl

This file was deleted.

Loading

0 comments on commit a32fb04

Please sign in to comment.