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

Add AMDGPU extension #2189

Merged
merged 16 commits into from
Feb 28, 2023
Merged

Add AMDGPU extension #2189

merged 16 commits into from
Feb 28, 2023

Conversation

pxl-th
Copy link
Member

@pxl-th pxl-th commented Feb 15, 2023

This PR adds initial support for AMDGPU via extension mechanism.

PR Checklist

  • Tests are added (will add more in a bit).
  • Entry in NEWS.md
  • Documentation, if applicable

  • Add FLUX_TEST_AMDGPU env variable to specify whether to run AMDGPU tests or not.
  • Add ability to switch between GPU backends using Preferences.jl.
    E.g. Flux.gpu_backend!("AMD") or gpu_backend="AMD" in LocalPreferences.toml allows specifying which backend to use.
  • Handle regular convolution, since MIOpen only supports cross-correlation as convolution.
    Therefore I plan to specify adaptor for convolution for Flux.amd which will flip weights during conversion once.
    Not sure if this is optimal way, so if anyone has suggestions do let me know :)
  • Use MIOpen for BatchNorm.

src/Flux.jl Outdated Show resolved Hide resolved
@pxl-th pxl-th marked this pull request as ready for review February 21, 2023 11:55
@pxl-th
Copy link
Member Author

pxl-th commented Feb 21, 2023

Updated to the latest NNlib which includes AMDGPU extension.
Added documentation on AMDGPU as well.
Should be good to go if there are no complains

ext/AMDGPUExt/conv.jl Outdated Show resolved Hide resolved
test/amd/utils.jl Outdated Show resolved Hide resolved
test/amd/basic.jl Outdated Show resolved Hide resolved
Copy link
Member

@ToucheSir ToucheSir left a comment

Choose a reason for hiding this comment

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

Looks real good, just a few touch-up comments from me. What are your thoughts on CI? Should we wait until the AMDGPU runners are stable before adding a Buildkite pipeline?

ext/AMDGPUExt/functor.jl Outdated Show resolved Hide resolved
ext/AMDGPUExt/functor.jl Outdated Show resolved Hide resolved
test/runtests.jl Outdated Show resolved Hide resolved
test/runtests.jl Outdated Show resolved Hide resolved
@pxl-th
Copy link
Member Author

pxl-th commented Feb 28, 2023

Looks real good, just a few touch-up comments from me. What are your thoughts on CI? Should we wait until the AMDGPU runners are stable before adding a Buildkite pipeline?

I think we can wait until we know the CI is working and then add it here.
NNlib has configurations for AMD so we will see it there

Copy link
Member

@ToucheSir ToucheSir left a comment

Choose a reason for hiding this comment

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

Ok, let's do this. Thanks @pxl-th !

@ToucheSir ToucheSir merged commit cc1ae6c into FluxML:master Feb 28, 2023
@pxl-th pxl-th deleted the pxl-th/amdgpu branch February 28, 2023 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants