Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ NNlib.jl/

## Julia Version

- Minimum Julia version: 1.9
- CI tests on: LTS, latest stable (1.x), and pre-release versions
- Minimum Julia version: 1.10
- CI tests on: minimum julia version, latest stable (1.x), and pre-release versions

## Coding Standards

Expand Down
21 changes: 7 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,55 +28,48 @@ jobs:
fail-fast: false
matrix:
version:
# - '1.9' # uncomment when julia 1.10 is out
- 'lts'
- '1.10' # uncomment when julia 1.10 is out
- '1' # automatically expands to the latest stable 1.x release of Julia
- 'pre'
- 'nightly'
os:
- ubuntu-latest
# - macOS-latest
# - windows-latest
arch:
- x64
julia-threads:
- '1'

include:
- os: windows-latest
version: '1'
arch: x64
julia-threads: '1'
- os: macOS-latest
version: '1'
arch: x64
julia-threads: '1'
- os: ubuntu-latest
version: '1'
arch: x64
julia-threads: '2'

steps:
- uses: actions/checkout@v5
- uses: julia-actions/setup-julia@v2
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
- uses: julia-actions/cache@v2
- uses: julia-actions/julia-buildpkg@v1

- name: "Run test without coverage"
uses: julia-actions/julia-runtest@v1
if: ${{ !contains(fromJson('["1", "1.9"]'), matrix.version) || matrix.os != 'ubuntu-latest' }}
if: ${{ !contains(fromJson('["1"]'), matrix.version) || matrix.os != 'ubuntu-latest' }}
with:
coverage: false

- name: "Run test with coverage"
uses: julia-actions/julia-runtest@v1
if: contains(fromJson('["1", "1.9"]'), matrix.version) && matrix.os == 'ubuntu-latest'
if: contains(fromJson('["1"]'), matrix.version) && matrix.os == 'ubuntu-latest'
- uses: julia-actions/julia-processcoverage@v1
if: contains(fromJson('["1", "1.9"]'), matrix.version) && matrix.os == 'ubuntu-latest'
if: contains(fromJson('["1"]'), matrix.version) && matrix.os == 'ubuntu-latest'
- uses: codecov/codecov-action@v5
if: contains(fromJson('["1", "1.9"]'), matrix.version) && matrix.os == 'ubuntu-latest'
if: contains(fromJson('["1"]'), matrix.version) && matrix.os == 'ubuntu-latest'
with:
file: lcov.info

Expand All @@ -87,7 +80,7 @@ jobs:
- uses: actions/checkout@v5
- uses: julia-actions/setup-julia@v2
with:
version: '1.9'
version: '1.10'
- uses: julia-actions/cache@v2
- run: |
julia --project=docs -e '
Expand Down
14 changes: 7 additions & 7 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "NNlib"
uuid = "872c559c-99b0-510c-b3b7-b6c96a88d5cd"
version = "0.9.31"
version = "0.9.32"

[deps]
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
Expand Down Expand Up @@ -37,15 +37,15 @@ Adapt = "3.2, 4"
Atomix = "0.1, 1"
CUDA = "4, 5"
ChainRulesCore = "1.25"
EnzymeCore = "0.5, 0.6, 0.7, 0.8"
EnzymeCore = "0.7, 0.8"
FFTW = "1.8.0"
ForwardDiff = "0.10.36, 1"
GPUArraysCore = "0.1, 0.2"
ForwardDiff = "1"
GPUArraysCore = "0.2"
KernelAbstractions = "0.9.2"
LinearAlgebra = "<0.0.1, 1"
Random = "<0.0.1, 1"
LinearAlgebra = "1"
Random = "1"
ScopedValues = "1.3.0"
SpecialFunctions = "2"
Statistics = "1"
cuDNN = "1"
julia = "1.9"
julia = "1.10"
2 changes: 1 addition & 1 deletion src/dim_helpers/ConvDims.jl
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ function im2col_dims(c::ConvDims)
# Size of single dotproduct within convolution
prod(kernel_size(c))*channels_in(c),
# One workspace per thread
VERSION > v"1.9.0-0" ? Threads.nthreads(:default) : Threads.nthreads(),
Threads.nthreads(:default),
)
end

Expand Down
2 changes: 1 addition & 1 deletion src/gemm.jl
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ for (gemm, elt) in gemm_datatype_mappings
strC = Base.stride(C, 3)

n_threads = min(
VERSION > v"1.9.0-0" ? Threads.nthreads(:default) : Threads.nthreads(),
Threads.nthreads(:default),
1 + max(length(A), length(B)) ÷ 8000)
# In some tests, size (20,20,20) is worth splitting between two threads,
# as is size (32,32,8).
Expand Down
17 changes: 0 additions & 17 deletions src/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -144,21 +144,4 @@ function rrule(cfg::RuleConfig{>:HasReverseMode}, ::typeof(_fast_broadcast!), f:
rrule_via_ad(cfg, broadcast, f, x, ys...)
end

# Could get this from Compat.jl instead
# https://github.com/JuliaLang/julia/pull/39794
if VERSION < v"1.7.0-DEV.793"
struct Returns{V} <: Function
value::V
Returns{V}(value) where {V} = new{V}(value)
Returns(value) = new{Core.Typeof(value)}(value)
end

(obj::Returns)(args...; kw...) = obj.value
function Base.show(io::IO, obj::Returns)
show(io, typeof(obj))
print(io, "(")
show(io, obj.value)
print(io, ")")
end
end

6 changes: 2 additions & 4 deletions test/dropout.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,8 @@ using Zygote, StableRNGs, ChainRulesCore, Enzyme
@test size(@inferred dropout(rng, x1, 0.1; dims=2)) == (3, 4)

x2 = Diagonal(randn(Float32, 10)) # Just to check it runs on weird matrices.
if VERSION > v"1.8-" # on 1.6 this makes a sparse array.
@test dropout(x2, 0.3) isa Matrix{Float32} # does not infer, but that's OK?
end

@test dropout(x2, 0.3) isa Matrix{Float32} # does not infer, but that's OK?

# Values
@test dropout(x1, 0) == x1
@test dropout(x1.+0im, 0) == x1
Expand Down
2 changes: 1 addition & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import ReverseDiff as RD # used in `pooling.jl`
import Pkg
using SpecialFunctions

const Test_Enzyme = VERSION <= v"1.10-"
const Test_Enzyme = VERSION <= v"1.12-"

DocMeta.setdocmeta!(NNlib, :DocTestSetup, :(using NNlib, UnicodePlots); recursive=true)

Expand Down
Loading