Skip to content

Commit 14ed65e

Browse files
port GNNGraphs tests to TestItems.jl (#573)
1 parent f2a7600 commit 14ed65e

39 files changed

+1754
-1482
lines changed

.buildkite/pipeline.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,3 +100,54 @@ steps:
100100
GNN_TEST_AMDGPU: "true"
101101
GNN_TEST_CPU: "false"
102102
timeout_in_minutes: 60
103+
104+
- label: "GNNGraphs CUDA"
105+
plugins:
106+
- JuliaCI/julia#v1:
107+
version: "1"
108+
- JuliaCI/julia-coverage#v1:
109+
dirs:
110+
- GNNGraphs/src
111+
command: |
112+
julia --color=yes --depwarn=yes --project=GNNGraphs/test -e '
113+
import Pkg
114+
dev_pkgs = Pkg.PackageSpec[]
115+
for pkg in ("GNNGraphs",)
116+
push!(dev_pkgs, Pkg.PackageSpec(path=pkg));
117+
end
118+
Pkg.develop(dev_pkgs)
119+
Pkg.add(["CUDA", "cuDNN"])
120+
Pkg.test("GNNGraphs")'
121+
agents:
122+
queue: "juliagpu"
123+
cuda: "*"
124+
env:
125+
GNN_TEST_CUDA: "true"
126+
GNN_TEST_CPU: "false"
127+
timeout_in_minutes: 60
128+
129+
- label: "GNNGraphs AMDGPU"
130+
plugins:
131+
- JuliaCI/julia#v1:
132+
version: "1"
133+
- JuliaCI/julia-coverage#v1:
134+
dirs:
135+
- GNNGraphs/src
136+
command: |
137+
julia --color=yes --depwarn=yes --project=GNNGraphs/test -e '
138+
import Pkg
139+
dev_pkgs = Pkg.PackageSpec[]
140+
for pkg in ("GNNGraphs",)
141+
push!(dev_pkgs, Pkg.PackageSpec(path=pkg));
142+
end
143+
Pkg.develop(dev_pkgs)
144+
Pkg.add(["AMDGPU"])
145+
Pkg.test("GNNGraphs")'
146+
agents:
147+
queue: "juliagpu"
148+
rocm: "*"
149+
rocmgpu: "*"
150+
env:
151+
GNN_TEST_AMDGPU: "true"
152+
GNN_TEST_CPU: "false"
153+
timeout_in_minutes: 60

.github/workflows/test_GNNGraphs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
- master
99
jobs:
1010
test:
11-
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }}
11+
name: Julia ${{ matrix.version }} - ${{ matrix.os }}
1212
runs-on: ${{ matrix.os }}
1313
strategy:
1414
fail-fast: false

.github/workflows/test_GNNLux.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
- master
99
jobs:
1010
test:
11-
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }}
11+
name: Julia ${{ matrix.version }} - ${{ matrix.os }}
1212
runs-on: ${{ matrix.os }}
1313
strategy:
1414
fail-fast: false

.github/workflows/test_GNNlib.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
- master
99
jobs:
1010
test:
11-
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }}
11+
name: Julia ${{ matrix.version }} - ${{ matrix.os }}
1212
runs-on: ${{ matrix.os }}
1313
strategy:
1414
fail-fast: false

.github/workflows/test_GraphNeuralNetworks.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
- master
99
jobs:
1010
test:
11-
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }}
11+
name: Julia ${{ matrix.version }} - ${{ matrix.os }}
1212
runs-on: ${{ matrix.os }}
1313
strategy:
1414
fail-fast: false

GNNGraphs/Project.toml

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ authors = ["Carlo Lucibello and contributors"]
44
version = "1.4.1"
55

66
[deps]
7-
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
87
ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"
98
Functors = "d9f16b24-f501-4c13-a1f2-28368ffc5196"
109
Graphs = "86223c79-3864-5bf0-83f7-82e725a168b6"
1110
KrylovKit = "0b1a1467-8014-51b9-945f-bf0ae24f4b77"
1211
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
1312
MLDataDevices = "7e8f7934-dd98-4c1a-8fe8-92b47a384d40"
13+
MLDatasets = "eb30cadb-4394-5ae3-aed4-317e484a6458"
1414
MLUtils = "f1d291b0-491e-4a28-83b9-f70985020b54"
1515
NNlib = "872c559c-99b0-510c-b3b7-b6c96a88d5cd"
1616
NearestNeighbors = "b8a86587-4115-5ab1-83bc-aa920d37bbce"
@@ -28,15 +28,14 @@ GNNGraphsCUDAExt = "CUDA"
2828
GNNGraphsSimpleWeightedGraphsExt = "SimpleWeightedGraphs"
2929

3030
[compat]
31-
Adapt = "4"
3231
CUDA = "5"
3332
ChainRulesCore = "1"
3433
Functors = "0.5"
3534
Graphs = "1.4"
3635
KrylovKit = "0.8"
3736
LinearAlgebra = "1"
3837
MLDataDevices = "1.0"
39-
MLDatasets = "0.7"
38+
MLDatasets = "0.7.18"
4039
MLUtils = "0.4"
4140
NNlib = "0.9"
4241
NearestNeighbors = "0.4"
@@ -45,21 +44,4 @@ SimpleWeightedGraphs = "1.4.0"
4544
SparseArrays = "1"
4645
Statistics = "1"
4746
StatsBase = "0.34"
48-
cuDNN = "1"
4947
julia = "1.10"
50-
51-
[extras]
52-
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
53-
CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba"
54-
ChainRulesTestUtils = "cdddcdb0-9152-4a09-a978-84456f9df70a"
55-
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
56-
FiniteDifferences = "26cc04aa-876d-5657-8c51-4c34ba976000"
57-
InlineStrings = "842dd82b-1e85-43dc-bf29-5d0ee9dffc48"
58-
MLDatasets = "eb30cadb-4394-5ae3-aed4-317e484a6458"
59-
SimpleWeightedGraphs = "47aef6b3-ad0c-573a-a1e2-d07658019622"
60-
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
61-
Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f"
62-
cuDNN = "02a925ec-e4fe-4b08-9a7e-0d78e3d38ccd"
63-
64-
[targets]
65-
test = ["Test", "Adapt", "DataFrames", "InlineStrings", "SimpleWeightedGraphs", "Zygote", "FiniteDifferences", "ChainRulesTestUtils", "MLDatasets", "CUDA", "cuDNN"]

GNNGraphs/docs/make.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ makedocs(;
4545
"GNNGraph" => "api/gnngraph.md",
4646
"GNNHeteroGraph" => "api/heterograph.md",
4747
"TemporalSnapshotsGNNGraph" => "api/temporalgraph.md",
48-
"Samplers" => "api/samplers.md",
4948
"Datasets" => "api/datasets.md",
5049
],
5150
]

GNNGraphs/docs/src/api/gnngraph.md

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,8 @@ Base.intersect
7777

7878
## Sampling
7979

80-
```@autodocs; canonical = true
81-
Modules = [GNNGraphs]
82-
Pages = ["src/sampling.jl"]
83-
Private = false
84-
```
85-
86-
```@docs; canonical = true
80+
```@docs
81+
NeighborLoader
82+
sample_neighbors
8783
Graphs.induced_subgraph(::GNNGraph, ::Vector{Int})
88-
```
84+
```

GNNGraphs/docs/src/api/samplers.md

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

GNNGraphs/src/GNNGraphs.jl

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ using LinearAlgebra, Random, Statistics
1313
import MLUtils
1414
using MLUtils: getobs, numobs, ones_like, zeros_like, chunk, batch, rand_like
1515
using MLDataDevices: get_device, cpu_device, CPUDevice
16+
using Functors: @functor
1617

1718
include("chainrules.jl") # hacks for differentiability
1819

@@ -54,7 +55,7 @@ export adjacency_list,
5455
normalized_laplacian,
5556
scaled_laplacian,
5657
laplacian_lambda_max,
57-
# from Graphs
58+
# from Graphs.jl
5859
adjacency_matrix,
5960
degree,
6061
has_edge,
@@ -82,7 +83,7 @@ export add_nodes,
8283
perturb_edges,
8384
remove_nodes,
8485
ppr_diffusion,
85-
# from MLUtils
86+
# from MLUtils.jl
8687
batch,
8788
unbatch,
8889
# from SparseArrays
@@ -98,9 +99,6 @@ export rand_graph,
9899
rand_temporal_radius_graph,
99100
rand_temporal_hyperbolic_graph
100101

101-
include("sampling.jl")
102-
export sample_neighbors
103-
104102
include("operators.jl")
105103
# Base.intersect
106104

@@ -117,7 +115,8 @@ export mldataset2gnngraph
117115

118116
include("deprecations.jl")
119117

120-
include("samplers.jl")
121-
export NeighborLoader
118+
include("sampling.jl")
119+
export NeighborLoader, sample_neighbors,
120+
induced_subgraph # from Graphs.jl
122121

123122
end #module

0 commit comments

Comments
 (0)