Skip to content
Draft
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
7 changes: 1 addition & 6 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
steps:
- group: ":test_tube: Tests"
steps:
- label: ":julia: :linux: CUDA Julia v{{matrix.version}} -- {{matrix.group}} -- {{matrix.runtime}}"
- label: ":julia: :linux: CUDA Julia v{{matrix.version}} -- {{matrix.runtime}}"
matrix:
setup:
version:
- "1.10"
group:
- core
- neural_networks
- integration
runtime:
- "PJRT"
- "IFRT"
Expand Down Expand Up @@ -41,7 +37,6 @@ steps:
queue: "juliagpu"
cuda: "*"
env:
REACTANT_TEST_GROUP: "{{matrix.group}}"
JULIA_DEBUG: "Reactant,Reactant_jll"
CUDA_VISIBLE_DEVICES: 0
REACTANT_BACKEND_GROUP: "GPU"
Expand Down
85 changes: 57 additions & 28 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,6 @@ jobs:
- macOS-latest
- windows-latest
- linux-x86-ct6e-180-4tpu
test_group:
- core
- neural_networks
- integration
runtime:
- "pjrt"
- "ifrt"
Expand All @@ -65,35 +61,19 @@ jobs:
julia_version: ${{ matrix.version }}
os: ${{ matrix.os }}
runtime: ${{ matrix.runtime }}
test_group: ${{ matrix.test_group }}

# This has been broken for a while, originating from CUDA.jl
# test-assertions:
# strategy:
# fail-fast: false
# matrix:
# version:
# - "1.10"
# test_group:
# - core
# - neural_networks
# - integration
# uses: ./.github/workflows/CommonCI.yml
# with:
# julia_version: ${{ matrix.version }}
# os: "ubuntu-24.04"
# runtime: "both"
# assertions: true
# test_group: ${{ matrix.test_group }}
test-assertions:
uses: ./.github/workflows/CommonCI.yml
with:
julia_version: "1.10"
os: "ubuntu-24.04"
runtime: "both"
assertions: true

downgrade:
strategy:
fail-fast: false
matrix:
test_group:
- core
- neural_networks
- integration
runtime:
- "pjrt"
- "ifrt"
Expand All @@ -102,5 +82,54 @@ jobs:
julia_version: "1.10"
os: "ubuntu-24.04"
runtime: ${{ matrix.runtime }}
test_group: ${{ matrix.test_group }}
downgrade_testing: true

integration-cpu:
strategy:
fail-fast: false
matrix:
project:
- FancyArrayTypes
- FFT
- Python
version:
- "1.10"
- "1.11"
uses: ./.github/workflows/CommonCI.yml
with:
julia_version: ${{ matrix.version }}
os: "ubuntu-latest"
runtime: "both"
project: "test/integration/${{ matrix.project }}"

integration:
strategy:
fail-fast: false
matrix:
project:
- CUDA
- Flux
- Lux
- NNlib
version:
- "1.10"
- "1.11"
os:
- ubuntu-latest
- linux-x86-ct6e-180-4tpu
exclude:
- os: linux-x86-ct6e-180-4tpu
version: "1.10"
include:
- project: CUDA
os: linux-x86-a2-48-a100-4gpu
version: "1.10"
- project: CUDA
os: linux-x86-a2-48-a100-4gpu
version: "1.11"
uses: ./.github/workflows/CommonCI.yml
with:
julia_version: ${{ matrix.version }}
os: ${{ matrix.os }}
runtime: "both"
project: "test/integration/${{ matrix.project }}"
59 changes: 55 additions & 4 deletions .github/workflows/CommonCI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ on:
required: false
default: false
type: boolean
project:
description: "Project"
required: false
default: "."
type: string

jobs:
test:
Expand Down Expand Up @@ -70,7 +75,7 @@ jobs:
- uses: julia-actions/cache@v2
id: julia-cache
with:
cache-name: julia-cache;workflow=${{ inputs.julia_version }}-${{ inputs.os }}-${{ inputs.runtime }}-assertions=${{ inputs.assertions }}-${{ github.event_name }}-${{ inputs.test_group }}-${{ inputs.downgrade_testing }}-${{ inputs.localjll }}
cache-name: julia-cache;workflow=${{ inputs.julia_version }}-${{ inputs.os }}-${{ inputs.runtime }}-assertions=${{ inputs.assertions }}-${{ github.event_name }}-${{ inputs.test_group }}-${{ inputs.downgrade_testing }}-${{ inputs.localjll }}-${{ inputs.project }}

- uses: julia-actions/julia-downgrade-compat@v2
if: ${{ inputs.downgrade_testing }}
Expand Down Expand Up @@ -132,9 +137,25 @@ jobs:
end
Pkg.develop(dev_pks)
shell: julia --color=yes --code-coverage=user --depwarn=yes --project=. {0}
# Only in Julia v1.10 we need to install `ReactantCore` manually.
if: ${{ inputs.julia_version == '1.10' || inputs.julia_version == 'lts' }}

- name: Install Project
if: ${{ inputs.project != '.' }}
run: |
import Pkg
Pkg.activate(get(ENV, "JULIA_PROJECT", nothing))
if VERSION < v"1.11-"
Pkg.develop([
Pkg.PackageSpec(; path="."),
Pkg.PackageSpec(; path="lib/ReactantCore")
])
end
Pkg.instantiate()
shell: julia --color=yes --code-coverage=user --depwarn=yes {0}
env:
JULIA_PKG_SERVER_REGISTRY_PREFERENCE: eager
JULIA_PROJECT: ${{ inputs.project }}

# Run the tests (pjrt or ifrt or both)
- name: "Setup Runtime Preferences (PJRT)"
if: ${{ inputs.runtime == 'pjrt' || inputs.runtime == 'both' }}
Expand All @@ -145,8 +166,18 @@ jobs:
contents: |
[Reactant]
xla_runtime = "PJRT"
- name: "Setup Runtime Preferences for ${{ inputs.project }} (PJRT)"
if: ${{ (inputs.runtime == 'pjrt' || inputs.runtime == 'both') && inputs.project != '.' }}
uses: "DamianReeves/write-file-action@master"
with:
path: ${{ inputs.project }}/LocalPreferences.toml
write-mode: "overwrite"
contents: |
[Reactant]
xla_runtime = "PJRT"

- name: "Run Tests (PJRT)"
if: ${{ inputs.runtime == 'pjrt' || inputs.runtime == 'both' }}
if: ${{ (inputs.runtime == 'pjrt' || inputs.runtime == 'both') && inputs.project == '.' }}
timeout-minutes: 120
run: |
import Pkg
Expand All @@ -159,6 +190,11 @@ jobs:
env:
ALLOW_RERESOLVE: ${{ !inputs.downgrade_testing }}
REACTANT_TEST_GROUP: ${{ inputs.test_group }}
- name: "Run ${{ inputs.project }} Integration Tests (PJRT)"
if: ${{ (inputs.runtime == 'pjrt' || inputs.runtime == 'both') && inputs.project != '.' }}
timeout-minutes: 30
run: julia --color=yes --project=${{ inputs.project }} --threads=auto --check-bounds=yes -O1 ${{ inputs.project }}/runtests.jl
shell: bash

- name: "Setup Runtime Preferences (IFRT)"
if: ${{ inputs.runtime == 'ifrt' || inputs.runtime == 'both' }}
Expand All @@ -169,8 +205,18 @@ jobs:
contents: |
[Reactant]
xla_runtime = "IFRT"
- name: "Setup Runtime Preferences for ${{ inputs.project }} (IFRT)"
if: ${{ (inputs.runtime == 'ifrt' || inputs.runtime == 'both') && inputs.project != '.' }}
uses: "DamianReeves/write-file-action@master"
with:
path: ${{ inputs.project }}/LocalPreferences.toml
write-mode: "overwrite"
contents: |
[Reactant]
xla_runtime = "IFRT"

- name: "Run Tests (IFRT)"
if: ${{ inputs.runtime == 'ifrt' || inputs.runtime == 'both' }}
if: ${{ (inputs.runtime == 'ifrt' || inputs.runtime == 'both') && inputs.project == '.' }}
timeout-minutes: 120
run: |
import Pkg
Expand All @@ -183,6 +229,11 @@ jobs:
env:
ALLOW_RERESOLVE: ${{ !inputs.downgrade_testing }}
REACTANT_TEST_GROUP: ${{ inputs.test_group }}
- name: "Run ${{ inputs.project }} Integration Tests (IFRT)"
if: ${{ (inputs.runtime == 'ifrt' || inputs.runtime == 'both') && inputs.project != '.' }}
timeout-minutes: 30
run: julia --color=yes --project=${{ inputs.project }} --threads=auto --check-bounds=yes -O1 ${{ inputs.project }}/runtests.jl
shell: bash

- name: "Upload MLIR modules"
uses: actions/upload-artifact@v4
Expand Down
2 changes: 1 addition & 1 deletion ext/ReactantFillArraysExt.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module ReactantFillArraysExt

using Reactant: Reactant, TracedUtils, TracedRNumber, Ops, Sharding, unwrapped_eltype
using Reactant: Reactant, TracedRNumber, Sharding, unwrapped_eltype
using ReactantCore: ReactantCore
using FillArrays: FillArrays, AbstractFill, Fill, Ones, Zeros, OneElement
using GPUArraysCore: @allowscalar
Expand Down
26 changes: 0 additions & 26 deletions test/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,17 @@
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
ArrayInterface = "4fba245c-0d91-5ea0-9b3e-6abc04ee57a9"
CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba"
DLFP8Types = "f4c16678-4a16-415b-82ef-ed337c5d6c7c"
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
Enzyme = "7da242da-08ed-463a-9acd-ee780be4f1d9"
ExplicitImports = "7d51a73a-1435-4ff3-83d9-f097790105c7"
FFTW = "7a1cc6ca-52ef-59f5-83cd-3a7055c09341"
FillArrays = "1a297f60-69ca-5386-bcde-b61e274b549b"
Float8s = "81dfefd7-55b0-40c6-a251-db853704e186"
Flux = "587475ba-b771-5e3f-ad9e-33799f191a9c"
Functors = "d9f16b24-f501-4c13-a1f2-28368ffc5196"
HypothesisTests = "09f84164-cd44-5f33-b23f-e6b0d136a0d5"
InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
KernelAbstractions = "63c18a36-062a-441e-b654-da1e3ab1ce7c"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Lux = "b2108857-7c20-44ae-9111-449ecde12c47"
LuxLib = "82251201-b29d-42c6-8e01-566dec8acb11"
MethodAnalysis = "85b6ec6f-f7df-4429-9514-a64bcd9ee824"
NNlib = "872c559c-99b0-510c-b3b7-b6c96a88d5cd"
OffsetArrays = "6fe1bfb0-de20-5000-8ca7-80f57d26f881"
OneHotArrays = "0b1bfda6-eb8a-41d2-88d8-f5af5cad476f"
Optimisers = "3bd65402-5787-11e9-1adc-39752487f4e2"
Preferences = "21216c6a-2e73-6563-6e65-726566657250"
PythonCall = "6099a3de-0909-46bc-b1f4-468b9a2dfc0d"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
Random123 = "74087812-796a-5b5d-8853-05524746bad3"
SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f"
Expand All @@ -33,32 +21,19 @@ StableRNGs = "860ef19b-820b-49d6-a774-d7a799459cd3"
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f"

[compat]
Adapt = "4.1"
ArrayInterface = "7.17.1"
CUDA = "5.5"
DLFP8Types = "0.1"
Distributions = "0.25"
Enzyme = "0.13.28"
FFTW = "1.8"
FillArrays = "1"
Float8s = "0.1"
Flux = "0.15, 0.16"
Functors = "0.5"
HypothesisTests = "0.11"
InteractiveUtils = "1.10"
KernelAbstractions = "0.9.30"
LinearAlgebra = "1.10"
Lux = "1.21"
LuxLib = "1.11"
NNlib = "0.9.26"
OffsetArrays = "1"
OneHotArrays = "0.2.6"
Optimisers = "0.4"
Preferences = "1.4"
PythonCall = "0.9"
Random = "1.10"
Random123 = "1.7"
SafeTestsets = "0.1"
Expand All @@ -67,7 +42,6 @@ StableRNGs = "1"
Statistics = "1.10"
StatsBase = "0.34"
Test = "1.10"
Zygote = "0.7"

[extras]
Reactant_jll = "0192cb87-2b54-54ad-80e0-3be72ad8a3c0"
File renamed without changes.
File renamed without changes.
File renamed without changes.
7 changes: 2 additions & 5 deletions test/bcast.jl → test/core/bcast.jl
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
using Test
using Reactant
using Enzyme, NNlib
using Reactant.MLIR
using Statistics
using Test, Reactant, Enzyme, Statistics
using Reactant: MLIR

@noinline function no(@nospecialize(x))
x = @ccall $(Base.@cfunction(identity, Any, (Any,)))(x::Any)::Any
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
14 changes: 1 addition & 13 deletions test/wrapped_arrays.jl → test/core/wrapped_arrays.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Reactant, Test, Statistics, NNlib, LinearAlgebra
using Reactant, Test, Statistics, LinearAlgebra

function view_getindex_1(x)
x = view(x, 2:3, 1:2, :)
Expand Down Expand Up @@ -77,18 +77,6 @@ end
@test v1 ≈ v2
end

function btranspose_badjoint(x)
x1 = NNlib.batched_transpose(x)
x2 = NNlib.batched_adjoint(x)
return x1 .+ x2
end

@testset "batched transpose/adjoint" begin
x = rand(4, 2, 3)
x_ra = Reactant.to_rarray(x)
@test @jit(btranspose_badjoint(x_ra)) ≈ btranspose_badjoint(x)
end

function bypass_permutedims(x)
x = PermutedDimsArray(x, (2, 1, 3)) # Don't use permutedims here
return view(x, 2:3, 1:2, :)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
9 changes: 9 additions & 0 deletions test/integration/CUDA/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[deps]
CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba"
KernelAbstractions = "63c18a36-062a-441e-b654-da1e3ab1ce7c"
Reactant = "3c362404-f566-11ee-1572-e11a4b42c853"
SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[sources]
Reactant = {path = "../../.."}
File renamed without changes.
11 changes: 11 additions & 0 deletions test/integration/CUDA/runtests.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
using Test, SafeTestsets

@testset "CUDA Integration" begin
@safetestset "CUDA" begin
include("cuda.jl")
end

@safetestset "KernelAbstractions" begin
include("kernelabstractions.jl")
end
end
7 changes: 7 additions & 0 deletions test/integration/FFT/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[deps]
FFTW = "7a1cc6ca-52ef-59f5-83cd-3a7055c09341"
Reactant = "3c362404-f566-11ee-1572-e11a4b42c853"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[sources]
Reactant = {path = "../../.."}
File renamed without changes.
Loading
Loading