Skip to content

Commit d84d334

Browse files
create NNlibCUDA sub-package (#286)
* create NNlibCUDA sub-package
1 parent aee7306 commit d84d334

35 files changed

+1081
-44
lines changed

.buildkite/pipeline.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
steps:
2+
- label: "GPU julia v1.6"
3+
plugins:
4+
- JuliaCI/julia#v1:
5+
version: "1.6"
6+
- JuliaCI/julia-coverage#v1:
7+
codecov: true
8+
dirs:
9+
- src
10+
- lib
11+
commands:
12+
- julia .ci/develop_nnlibcuda.jl
13+
- julia .ci/test_nnlibcuda.jl
14+
agents:
15+
queue: "juliagpu"
16+
cuda: "*"
17+
timeout_in_minutes: 60
18+
19+
## Add these when julia 1.7 is out
20+
# - label: "GPU julia v1"
21+
# plugins:
22+
# - JuliaCI/julia#v1:
23+
# version: "1"
24+
# - JuliaCI/julia-coverage#v1:
25+
# codecov: true
26+
# dirs:
27+
# - src
28+
# - lib
29+
# commands:
30+
# - julia .ci/develop.jl
31+
# - julia .ci/test.jl
32+
# agents:
33+
# queue: "juliagpu"
34+
# cuda: "*"
35+
# timeout_in_minutes: 60
36+
37+
# - label: "GPU julia nightly"
38+
# plugins:
39+
# - JuliaCI/julia#v1:
40+
# version: "nightly"
41+
# - JuliaCI/julia-coverage#v1:
42+
# codecov: true
43+
# dirs:
44+
# - src
45+
# - lib
46+
# commands:
47+
# - julia .ci/develop.jl
48+
# - julia .ci/test.jl
49+
# agents:
50+
# queue: "juliagpu"
51+
# cuda: "*"
52+
# timeout_in_minutes: 60

.ci/develop.jl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import Pkg
2+
3+
root_directory = dirname(@__DIR__)
4+
5+
nnlib = Pkg.PackageSpec(path = root_directory)
6+
Pkg.develop(nnlib)
7+
Pkg.precompile()

.ci/develop_nnlibcuda.jl

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import Pkg
2+
3+
root_directory = dirname(@__DIR__)
4+
5+
nnlib = Pkg.PackageSpec(path = root_directory)
6+
nnlibcuda = Pkg.PackageSpec(path = joinpath(root_directory, "lib", "NNlibCUDA"))
7+
8+
Pkg.develop(nnlib)
9+
Pkg.develop(nnlibcuda)
10+
11+
## Do this for the time being since test doesn't pick up the manifest
12+
## for some reason. Can remove this and manifests when cuda 3.0 is released.
13+
Pkg.add(url="https://github.com/JuliaGPU/CUDA.jl.git", rev="master")
14+
15+
Pkg.precompile()

.ci/test.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import Pkg
2+
3+
pkgs = ["NNlib"]
4+
5+
Pkg.test(pkgs; coverage = true)

.ci/test_nnlibcuda.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import Pkg
2+
3+
pkgs = ["NNlibCUDA"]
4+
5+
Pkg.test(pkgs; coverage = true)

.github/workflows/ci.yml

Lines changed: 33 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
11
name: CI
22

3-
# env:
4-
# JULIA_NUM_THREADS: 2
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- staging
8+
- trying
9+
tags: '*'
10+
pull_request:
511

6-
on: [push, pull_request]
12+
defaults:
13+
run:
14+
shell: bash
715

816
jobs:
917
test:
@@ -44,13 +52,10 @@ jobs:
4452
steps:
4553
- uses: actions/checkout@v2
4654
- uses: julia-actions/setup-julia@v1
47-
## `allow-failure` not available yet https://github.com/actions/toolkit/issues/399
48-
#continue-on-error: ${{ matrix.julia-version == 'nightly' }}
4955
with:
5056
version: ${{ matrix.version }}
5157
arch: ${{ matrix.arch }}
5258
- uses: actions/cache@v1
53-
# continue-on-error: ${{ matrix.julia-version == 'nightly' }}
5459
env:
5560
cache-name: cache-artifacts
5661
with:
@@ -60,14 +65,10 @@ jobs:
6065
${{ runner.os }}-test-${{ env.cache-name }}-
6166
${{ runner.os }}-test-
6267
${{ runner.os }}-
63-
- uses: julia-actions/julia-buildpkg@v1
64-
# continue-on-error: ${{ matrix.julia-version == 'nightly' }}
65-
- uses: julia-actions/julia-runtest@v1
66-
# continue-on-error: ${{ matrix.julia-version == 'nightly' }}
68+
- run: julia .ci/develop.jl
69+
- run: julia .ci/test.jl
6770
- uses: julia-actions/julia-processcoverage@v1
68-
# continue-on-error: ${{ matrix.julia-version == 'nightly' }}
6971
- uses: codecov/codecov-action@v1
70-
# continue-on-error: ${{ matrix.version == 'nightly' }}
7172
with:
7273
file: lcov.info
7374

@@ -79,18 +80,27 @@ jobs:
7980
# - uses: julia-actions/setup-julia@v1
8081
# with:
8182
# version: '1'
82-
# - run: |
83-
# julia --project=docs -e '
84-
# using Pkg
85-
# Pkg.develop(PackageSpec(path=pwd()))
86-
# Pkg.instantiate()'
87-
# - run: |
88-
# julia --project=docs -e '
89-
# using Documenter: DocMeta, doctest
90-
# using NNlib
91-
# DocMeta.setdocmeta!(NNlib, :DocTestSetup, :(using NNlib); recursive=true)
92-
# doctest(NNlib)'
83+
# - run: julia --project=docs .ci/develop.jl
9384
# - run: julia --project=docs docs/make.jl
9485
# env:
9586
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
9687
# DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}
88+
89+
# doctests:
90+
# name: Doctests
91+
# runs-on: ubuntu-latest
92+
# steps:
93+
# - uses: actions/checkout@v2
94+
# - uses: julia-actions/setup-julia@v1
95+
# with:
96+
# version: '1'
97+
# - run: julia --project=docs .ci/develop.jl
98+
# - run: |
99+
# julia --project=docs -e '
100+
# using Documenter
101+
# using NNlib
102+
# # using NNlibCUDA
103+
# DocMeta.setdocmeta!(NNlib, :DocTestSetup, :(using NNlib); recursive=true)
104+
# # DocMeta.setdocmeta!(NNlibCUDA, :DocTestSetup, :(using NNlib, CUDA); recursive=true)
105+
# doctest(NNlib)
106+
# # doctest(NNlibCUDA)'

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@
1010
deps/usr
1111
deps.jl
1212
*.log
13-
Manifest.toml
13+
./Manifest.toml

Project.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ Requires = "0.5, 1.0"
1717
julia = "1.3"
1818

1919
[extras]
20-
CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba"
2120
ChainRulesTestUtils = "cdddcdb0-9152-4a09-a978-84456f9df70a"
2221
FiniteDifferences = "26cc04aa-876d-5657-8c51-4c34ba976000"
2322
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
@@ -26,4 +25,4 @@ Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
2625
Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f"
2726

2827
[targets]
29-
test = ["ChainRulesTestUtils", "CUDA", "FiniteDifferences", "Random", "StableRNGs", "Test", "Zygote"]
28+
test = ["ChainRulesTestUtils", "FiniteDifferences", "Random", "StableRNGs", "Test", "Zygote"]

docs/Project.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[deps]
2+
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
3+
4+
[compat]
5+
Documenter = "0.24"

lib/NNlibCUDA/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
#Manifest.toml

0 commit comments

Comments
 (0)