Skip to content

Commit

Permalink
Merge pull request #47 from williamfgc/ci-refactoring
Browse files Browse the repository at this point in the history
Refactor CI and address AMD sync issue
  • Loading branch information
williamfgc authored Feb 28, 2024
2 parents ba1e820 + dd1343f commit 2deecc2
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-cpu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
run: julia --project -e 'using Pkg; Pkg.instantiate();'

- name: Test Threads
run: julia -t 2 --project -e 'using Pkg; Pkg.test()'
run: julia -t 4 --project -e 'using Pkg; Pkg.test()'

macos:
runs-on: macos-latest
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci-gpu-AMD.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ jobs:

- name: Instantiate
if: steps.check.outputs.triggered == 'true'
run: |
run: |
source /etc/profile.d/lmod.sh
module load julia/1.9.1
module load rocm/6.0.0
Expand All @@ -88,7 +88,7 @@ jobs:
source /etc/profile.d/lmod.sh
module load julia/1.9.1
module load rocm/6.0.0
julia --project -e 'using Pkg; Pkg.test(;test_args=["perf"])'
julia --project -e 'using Pkg; Pkg.test()'
- name: Report PR status
if: always() && steps.check.outputs.triggered == 'true'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-gpu-NVIDIA.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ jobs:
- name: Test
if: steps.check.outputs.triggered == 'true'
run: julia --project -e 'using Pkg; Pkg.test(;test_args=["perf"])'
run: julia --project -e 'using Pkg; Pkg.test()'

- name: Report PR status
if: always() && steps.check.outputs.triggered == 'true'
Expand Down
4 changes: 2 additions & 2 deletions ext/JACCAMDGPU/JACCAMDGPU.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ function JACC.parallel_for(N::I, f::F, x...) where {I<:Integer,F<:Function}
threads = min(N, numThreads)
blocks = ceil(Int, N / threads)
@roc groupsize = threads gridsize = threads * blocks _parallel_for_amdgpu(f, x...)
AMDGPU.synchronize()
# AMDGPU.synchronize()
end

function JACC.parallel_for((M, N)::Tuple{I,I}, f::F, x...) where {I<:Integer,F<:Function}
Expand All @@ -17,7 +17,7 @@ function JACC.parallel_for((M, N)::Tuple{I,I}, f::F, x...) where {I<:Integer,F<:
Mblocks = ceil(Int, M / Mthreads)
Nblocks = ceil(Int, N / Nthreads)
@roc groupsize = (Mthreads, Nthreads) gridsize = (Mblocks * Mthreads, Nblocks * Nthreads) _parallel_for_amdgpu_MN(f, x...)
AMDGPU.synchronize()
# AMDGPU.synchronize()
end

function JACC.parallel_reduce(N::I, f::F, x...) where {I<:Integer,F<:Function}
Expand Down
15 changes: 2 additions & 13 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,12 @@ import JACC
const backend = JACC.JACCPreferences.backend

@static if backend == "cuda"
println("CUDA backend loaded")
@show "CUDA backend loaded"
include("tests_cuda.jl")
if "perf" in ARGS
println("Running performance tests")
include("tests_cuda_perf.jl")
end

elseif backend == "amdgpu"
@show "AMDGPU backend loaded"
include("tests_amdgpu.jl")
if "perf" in ARGS
println("Running performance tests")
include("tests_amdgpu_perf.jl")
end

elseif backend == "oneapi"
@show "OneAPI backend loaded"
Expand All @@ -25,8 +17,5 @@ elseif backend == "oneapi"
elseif backend == "threads"
@show "Threads backend loaded"
include("tests_threads.jl")
if "perf" in ARGS
println("Running performance tests")
include("tests_threads_perf.jl")
end

end

0 comments on commit 2deecc2

Please sign in to comment.