Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NNlibAMDGPUExt] Load MIOpen module only if it is available #483

Merged
merged 7 commits into from
Apr 6, 2023
Merged
Show file tree
Hide file tree
Changes from 3 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
11 changes: 8 additions & 3 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ steps:
if: build.pull_request.labels includes "benchmark"
timeout_in_minutes: 30

- label: "AMDGPU - Julia 1.9 - No Artifacts"
- label: "AMDGPU - Julia 1.9"
plugins:
- JuliaCI/julia#v1:
version: 1.9-nightly
Expand All @@ -76,18 +76,23 @@ steps:
push!(conf[\"targets\"][\"test\"], \"AMDGPU\");
CarloLucibello marked this conversation as resolved.
Show resolved Hide resolved
open(io -> TOML.print(io, conf), \"Project.toml\", \"w\");
"""
- julia --project=. -e """
using Pkg;
Pkg.develop(\"AMDGPU\");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another reason to switch to test/Project.toml sooner than later?

Copy link
Member

@ToucheSir ToucheSir Mar 31, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...or now, thanks!

Pkg.activate(joinpath(Pkg.devdir(), \"AMDGPU\"));
Pkg.add(\"MIOpen_jll\");
"""
timeout_in_minutes: 30
env:
JULIA_AMDGPU_CORE_MUST_LOAD: "1"
JULIA_AMDGPU_HIP_MUST_LOAD: "1"
JULIA_AMDGPU_DISABLE_ARTIFACTS: "1"
NNLIB_TEST_AMDGPU: true

# - label: "GPU julia nightly"
# plugins:
# - JuliaCI/julia#v1:
# version: "nightly"
# - JuliaCI/julia-test#v1: ~
# - JuliaCI/julia-test#v1: ~
# - JuliaCI/julia-coverage#v1:
# codecov: true
# dirs:
Expand Down
15 changes: 10 additions & 5 deletions ext/NNlibAMDGPUExt/NNlibAMDGPUExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ module NNlibAMDGPUExt

using Adapt
using AMDGPU
using AMDGPU.MIOpen
using ChainRulesCore
using NNlib
using NNlib: BatchedAdjoint, BatchedTranspose, BatchedAdjOrTrans
Expand Down Expand Up @@ -53,9 +52,15 @@ function nnlib_padding(dims)
pd[1:2:end]
end

include("conv.jl")
include("pool.jl")
include("softmax.jl")
include("activations.jl")
@static if AMDGPU.functional(:MIOpen)
using AMDGPU.MIOpen

include("conv.jl")
include("pool.jl")
include("softmax.jl")
include("activations.jl")
else
@warn "ROCm MIOpen is not available for AMDGPU. NNlib has limited functionality for AMDGPU."
end

end