-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
feat(ml): introduce support of onnxruntime-rocm for AMD GPU #11063
Draft
Zelnes
wants to merge
7
commits into
immich-app:main
Choose a base branch
from
Zelnes:feature/Add-rocm-support-for-machine-learning
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+125
−81
Draft
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
46c505a
feat(ml): introduce support of onnxruntime-rocm for AMD GPU
Zelnes e2a798e
try mutex for algo cache
mertalev 06510bd
bump versions, run on mich
mertalev c6be557
use 3.12
mertalev cbc3e4e
use OrtMutex
mertalev 96fe38b
use 1.19.2
mertalev ace7dc9
acquire lock before any changes can be made
mertalev File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
machine-learning/0001-fix-avoid-race-condition-for-rocm-conv-algo-caching.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
From c4e6f81b4901b2b8178b964377e8fde7118f0e2e Mon Sep 17 00:00:00 2001 | ||
From: mertalev <101130780+mertalev@users.noreply.github.com> | ||
Date: Fri, 20 Dec 2024 00:59:21 -0500 | ||
Subject: [PATCH] fix: avoid race condition for rocm conv algo caching | ||
|
||
--- | ||
onnxruntime/core/providers/rocm/nn/conv.cc | 2 ++ | ||
1 file changed, 2 insertions(+) | ||
|
||
diff --git a/onnxruntime/core/providers/rocm/nn/conv.cc b/onnxruntime/core/providers/rocm/nn/conv.cc | ||
index d7f47d07a8..134f8a3b43 100644 | ||
--- a/onnxruntime/core/providers/rocm/nn/conv.cc | ||
+++ b/onnxruntime/core/providers/rocm/nn/conv.cc | ||
@@ -122,6 +122,8 @@ Status Conv<T, NHWC>::UpdateState(OpKernelContext* context, bool bias_expected) | ||
bool input_dims_changed = (s_.last_x_dims != x_dims); | ||
bool w_dims_changed = (s_.last_w_dims != w_dims); | ||
if (input_dims_changed || w_dims_changed) { | ||
+ // lock is needed to avoid race condition during algo search | ||
+ std::lock_guard<OrtMutex> lock(s_.mutex); | ||
if (input_dims_changed) | ||
s_.last_x_dims = gsl::make_span(x_dims); | ||
|
||
-- | ||
2.43.0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are the different .whl files? We should only need one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's only one, and it's name is known after compilation. I copied this from this Dockerfile, but if you prefer, I can replace with the full name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It'd be nice for clarity that there's only one wheel involved here.