-
Notifications
You must be signed in to change notification settings - Fork 19.6k
Enable ROCm devices to correctly use keras.layers.CuDNNGRU and keras.layers.CuDNNLSTM #21443
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
base: r2.13
Are you sure you want to change the base?
Conversation
.github/workflows/format.yml
Outdated
@@ -20,7 +20,7 @@ jobs: | |||
python -m pip install --upgrade pip setuptools | |||
echo "::set-output name=dir::$(pip cache dir)" | |||
- name: pip cache | |||
uses: actions/cache@v2 | |||
uses: actions/cache@v4 |
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.
Please remove these 2 files from the PR
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.
Reverted to the original state before the changes.
self.bias[self.units * 5 :], | ||
] | ||
|
||
if tf.sysconfig.get_build_info()["is_cuda_build"]: |
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 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.
The default layout is compatible with ROCm; here, the CUDA layout is adapted by checking whether the device is CUDA.
Using keras.layers.CuDNNGRU and keras.layers.CuDNNLSTM on ROCm devices may introduce accuracy issues due to incorrect weight layout. This modification ensures compatibility with both CUDA and ROCm weight layouts.