Skip to content

Commit 2c3662b

Browse files
author
Avik Pal
committed
Migrate docs build to GPU
1 parent c33c2fa commit 2c3662b

File tree

6 files changed

+70
-38
lines changed

6 files changed

+70
-38
lines changed

.buildkite/pipeline.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
steps:
2+
- label: ":julia: Julia {{matrix.julia}} + CUDA GPU"
3+
plugins:
4+
- JuliaCI/julia#v1:
5+
version: "{{matrix.julia}}"
6+
- JuliaCI/julia-test#v1:
7+
test_args: "--quickfail"
8+
- JuliaCI/julia-coverage#v1:
9+
codecov: true
10+
dirs:
11+
- src
12+
- ext
13+
agents:
14+
queue: "juliagpu"
15+
cuda: "*"
16+
env:
17+
GROUP: "CUDA"
18+
if: build.message !~ /\[skip tests\]/
19+
timeout_in_minutes: 240
20+
matrix:
21+
setup:
22+
julia:
23+
- "1"
24+
25+
- label: ":open_book: Documentation"
26+
plugins:
27+
- JuliaCI/julia#v1:
28+
version: "1"
29+
- JuliaCI/julia-coverage#v1:
30+
codecov: true
31+
dirs:
32+
- src
33+
- ext
34+
command: |
35+
julia --project --code-coverage=user --color=yes --threads=3 -e '
36+
println("--- :julia: Instantiating project")
37+
using Pkg
38+
Pkg.instantiate()
39+
Pkg.activate("docs")
40+
Pkg.develop(PackageSpec(path=pwd()))
41+
Pkg.instantiate()
42+
println("+++ :julia: Building documentation")
43+
44+
Pkg.activate("docs")
45+
include("docs/make.jl")'
46+
agents:
47+
queue: "juliagpu"
48+
cuda: "*"
49+
env:
50+
DATADEPS_ALWAYS_ACCEPT: true
51+
JULIA_DEBUG: "Documenter"
52+
GKSwstype: "100" # https://discourse.julialang.org/t/generation-of-documentation-fails-qt-qpa-xcb-could-not-connect-to-display/60988
53+
if: build.message !~ /\[skip docs\]/
54+
timeout_in_minutes: 240
55+
56+
env:
57+
SECRET_CODECOV_TOKEN: "fbSN+ZbScLIWr1FOpAu1Z8PYWFobqbLGFayOgZE1ebhE8LIH/PIL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JZH0vyxvzT6X3IKL1roAPG9jZHk6AZ0rY5o3PfWkhMO2NuQE0AeCXUsIK6sNB8T1C+77EZjhu6hJSWqfaVdjKrmxL9xdCgIjQhcel1fh/svwTO5miB7RPhZxHBbSloSGt5siRSI31W/wOKhZKOIfA8EuRY1yNSf5nchbCS7gSCSXSfZ6eixsZr+gAgs7h+Pg5yARwMLV34sgvDwtKem6UZgOVzUc4WVp3IF5vP/aF4sI/bP5Yq1cTam42mjc3OJDSlQSebHygo+Aw24ovWsYccXQ+Q3Jt1j4rC+DuKRjTuU9NJYSZLRWh86QW0TAmdg4Ev5r6sOGD3vNqLZe9hxAOX6zIGaur8dIcruJHIDLDKdI9wVgFnM/hlFtuPnSvy961SvxAtIDxZUdS8Hhb083dwLK/j9UI/K47y6grkGq9451cmeRnCEfa3I+NQKkWOy6V0HAYymgA0MIS1Eca/1Q=="

.github/workflows/Documentation.yml

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

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
[![codecov](https://codecov.io/gh/SciML/DeepEquilibriumNetworks.jl/branch/main/graph/badge.svg)](https://codecov.io/gh/SciML/DeepEquilibriumNetworks.jl)
77
[![Build Status](https://github.com/SciML/DeepEquilibriumNetworks.jl/workflows/CI/badge.svg)](https://github.com/SciML/DeepEquilibriumNetworks.jl/actions?query=workflow%3ACI)
8+
[![Build status](https://badge.buildkite.com/d7ce1858c4f89456c2d90e80c9b04b710bd81d7641db0a087c.svg?branch=main)](https://buildkite.com/julialang/deepequilibriumnetworks)
89

910
[![ColPrac: Contributor's Guide on Collaborative Practices for Community Packages](https://img.shields.io/badge/ColPrac-Contributor%27s%20Guide-blueviolet)](https://github.com/SciML/ColPrac)
1011
[![SciML Code Style](https://img.shields.io/static/v1?label=code%20style&message=SciML&color=9558b2&labelColor=389826)](https://github.com/SciML/SciMLStyle)
@@ -24,8 +25,8 @@ Pkg.add("DeepEquilibriumNetworks")
2425
## Quickstart
2526

2627
```julia
27-
using DeepEquilibriumNetworks, Lux, Random, NonlinearSolve, Zygote
28-
# using LuxCUDA, LuxAMDGPU ## Install and Load for GPU Support
28+
using DeepEquilibriumNetworks, Lux, Random, NonlinearSolve, Zygote, SciMLSensitivity
29+
# using LuxCUDA, LuxAMDGPU ## Install and Load for GPU Support. See https://lux.csail.mit.edu/dev/manual/gpu_management
2930

3031
seed = 0
3132
rng = Random.default_rng()

docs/Project.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ DeepEquilibriumNetworks = "6748aba7-0e9b-415e-a410-ae3cc0ecb334"
33
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
44
DocumenterCitations = "daee34ce-89f3-4625-b898-19384cb65244"
55
Lux = "b2108857-7c20-44ae-9111-449ecde12c47"
6+
LuxCUDA = "d0bbae9a-e099-4d5b-a835-1c6931763bda"
67
NonlinearSolve = "8913a72c-1f9b-4ce2-8d82-65094dcecaec"
78
OrdinaryDiffEq = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed"
89
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"

docs/src/index.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ Pkg.add("DeepEquilibriumNetworks")
1616

1717
## Quick-start
1818

19-
```@example
19+
```@example quickstart
2020
using DeepEquilibriumNetworks, Lux, Random, NonlinearSolve, Zygote, SciMLSensitivity
21-
# using LuxCUDA, LuxAMDGPU ## Install and Load for GPU Support
21+
using LuxCUDA # For NVIDIA GPU support
2222
2323
seed = 0
2424
rng = Random.default_rng()
@@ -35,8 +35,11 @@ ps, st = Lux.setup(rng, model) |> gdev
3535
x = rand(rng, Float32, 2, 3) |> gdev
3636
y = rand(rng, Float32, 2, 3) |> gdev
3737
38-
model(x, ps, st)
38+
y, st_ = model(x, ps, st)
39+
st_.layer_2.solution
40+
```
3941

42+
```@example quickstart
4043
gs = only(Zygote.gradient(p -> sum(abs2, first(first(model(x, p, st))) .- y), ps))
4144
```
4245

test/layers.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ end
138138

139139
x = randn(rng, Float32, x_size...)
140140
z, st = model(x, ps, st)
141-
z_ = mapreduce(DEQs.__flatten, vcat, z)
141+
z_ = DEQs.__flatten_vcat(z)
142142

143143
opt_broken = solver isa NewtonRaphson ||
144144
solver isa SimpleLimitedMemoryBroyden ||
@@ -162,7 +162,7 @@ end
162162
@test st.solution == DeepEquilibriumSolution()
163163

164164
z, st = model(x, ps, st)
165-
z_ = mapreduce(DEQs.__flatten, vcat, z)
165+
z_ = DEQs.__flatten_vcat(z)
166166
opt_broken = jacobian_regularization isa AutoZygote
167167
@jet model(x, ps, st) opt_broken=opt_broken
168168

0 commit comments

Comments
 (0)