-
Notifications
You must be signed in to change notification settings - Fork 19.6k
Keras 3 may not work with PyTorch DirectML #21228
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
Comments
Hi @TaiXeflar |
Ok. How can I support this? |
Fixing this requires investigation on root cases of DirectML not working in the Keras codebase. One example is that there are instances of hard-coded |
I've got something works on the early state just for few hours ago, but I need more tests to work with like MNIST example. I will keep this thread up. |
@SamanehSaadat At first, I use a ENV variable do a control to enable torch-directml. Then I adding this to
note that the device name is already known where the AMD device card is I do a non-linear regression test (the dataset is from myself) and find it works: Then I do a MNIST example, I found there's something wrong at some compute has fallback to CPU. That's all what I've tested. If there's new test gets useful, I'll just report here. |
I think there's no rules to specifying device when Keras using |
I think this might be a tech issue so I opened issue from disscutions to here.
Issue description:
My test on Keras 3 may cannot set selected device correctly with DirectML based PyTorch backend. I looked #21190 and still can't find some useful anwers.
Backgrounds:
I have a Windows 11 Machine, contains 2 cards with NVIDIA GeForce RTX 4070ti Super and AMD Radeon RX 7800XT respectively.
Then I deployed a Python 3.11.9 env installed
torch-directml
, by using DirectML backend to use PyTorch. In PyTorch we can manually use.to(device)
to set GPU device, and can do check like this:From the above codes and the result, we can know that device 1 is the AMD card.
How can I manage/add preprocess "on DirectML device select" in Keras? If we just do nothing, the model will be run on CPU only.
Hardware and Software/Environ:
The text was updated successfully, but these errors were encountered: