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
76 changes: 38 additions & 38 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,47 +48,47 @@ steps:
if: build.message !~ /\[skip tests\]/
timeout_in_minutes: 120

# - label: ":julia: :linux: AMDGPU Julia v{{matrix.version}} -- {{matrix.group}} -- {{matrix.runtime}}"
# matrix:
# setup:
# version:
# - "1.10"
# group:
# - core
# - neural_networks
# - integration
# runtime:
# - "IFRT"
# plugins:
# - JuliaCI/julia#v1:
# version: "{{matrix.version}}"
# - JuliaCI/julia-coverage#v1:
# codecov: true
# dirs:
# - src
# - ext
# - lib/ReactantCore/src
# agents:
# queue: "juliagpu"
# rocm: "*"
# commands: |
# touch LocalPreferences.toml
- label: ":julia: :linux: AMDGPU Julia v{{matrix.version}} -- {{matrix.group}} -- {{matrix.runtime}}"
matrix:
setup:
version:
- "1.10"
group:
- core
- neural_networks
- integration
runtime:
- "IFRT"
plugins:
- JuliaCI/julia#v1:
version: "{{matrix.version}}"
- JuliaCI/julia-coverage#v1:
codecov: true
dirs:
- src
- ext
- lib/ReactantCore/src
agents:
queue: "juliagpu"
rocm: "*"
commands: |
touch LocalPreferences.toml

# echo "[Reactant]" >> LocalPreferences.toml
# echo "xla_runtime = \"{{matrix.runtime}}\"" >> LocalPreferences.toml
echo "[Reactant]" >> LocalPreferences.toml
echo "xla_runtime = \"{{matrix.runtime}}\"" >> LocalPreferences.toml

# cat LocalPreferences.toml
cat LocalPreferences.toml

# julia --project=. -e 'println("--- :julia: Instantiating project")
# using Pkg
# Pkg.develop([PackageSpec(path="lib/ReactantCore")])'
julia --project=. -e 'println("--- :julia: Instantiating project")
using Pkg
Pkg.develop([PackageSpec(path="lib/ReactantCore")])'

# julia --project=. -e 'println("--- :julia: Run Tests")
# using Pkg
# Pkg.test(; coverage="user")'
# env:
# REACTANT_TEST_GROUP: "{{matrix.group}}"
# JULIA_DEBUG: "Reactant,Reactant_jll"
# CUDA_VISIBLE_DEVICES: 0
julia --project=. -e 'println("--- :julia: Run Tests")
using Pkg
Pkg.test(; coverage="user")'
env:
REACTANT_TEST_GROUP: "{{matrix.group}}"
JULIA_DEBUG: "Reactant,Reactant_jll"
CUDA_VISIBLE_DEVICES: 0
# if: build.message !~ /\[skip tests\]/
# timeout_in_minutes: 120
2 changes: 1 addition & 1 deletion test/integration/kernelabstractions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ if !Reactant.Accelerators.TPU.has_tpu()
A = Reactant.to_rarray(ones(100, 100))
out = Reactant.to_rarray(ones(100, 100))
platform_name = Reactant.XLA.platform_name(Reactant.XLA.default_backend())
raise = platform_name ∉ ("cpu", "cuda")
raise = platform_name ∉ ("cpu", "cuda", "rocm")
@jit raise = raise matmul!(out, A)
out_c = Array(out)
A_c = Array(A)
Expand Down
20 changes: 14 additions & 6 deletions test/nn/luxlib.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
using LuxLib, Reactant, Enzyme, NNlib, Test

const MightUseMIOpen = contains(lowercase(string(Reactant.devices()[1])), "rocm")

@testset "Fused Dense" begin
sumabs2fuseddense(act, weight, x, bias) =
sum(abs2, fused_dense_bias_activation(act, weight, x, bias))
Expand Down Expand Up @@ -182,15 +184,21 @@ end
padding in ((0, 0), (2, 2), (2, 0)),
dilation in ((1, 1), (1, 2))

conv_dims = DenseConvDims(x, weight; stride, padding, dilation, groups)
if any(!=(1), dilation) && MightUseMIOpen
continue # MIOpen doesn't support dilation != 1 yet
end

reactant_res = @jit fused_conv_bias_activation(
act, weight_reactant, x_reactant, bias_reactant, conv_dims
)
might_fail = MightUseMIOpen && any(!=(1), dilation)

luxlib_res = fused_conv_bias_activation(act, weight, x, bias, conv_dims)
conv_dims = DenseConvDims(x, weight; stride, padding, dilation, groups)

@test reactant_res ≈ luxlib_res atol = 1e-5 rtol = 1e-2
@test begin
reactant_res = @jit fused_conv_bias_activation(
act, weight_reactant, x_reactant, bias_reactant, conv_dims
)
luxlib_res = fused_conv_bias_activation(act, weight, x, bias, conv_dims)
isapprox(reactant_res, luxlib_res; atol=1e-5, rtol=1e-2)
end broken = might_fail
end

# TODO: test for gradients
Expand Down
Loading