You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm here for asking GPU selection problems since I'm still new for Keras 3 when I jump into Keras 3 from PyTorch a while.
I have a Windows 11 Machine contains 2 cards with NVIDIA GeForce RTX 4070ti Super and AMD Radeon RX 7800XT respectively.
Now I have a independent Python 3.11.9 env installed torch-directml. In PyTorch we can manually use .to(device) to set GPU device, and can do check like this:
import torch_directml
# List all available DML devices
device_count = torch_directml.device_count()
print(f"Available DirectML devices: {device_count}")
# Loop over devices and print info
for i in range(device_count):
dml_device = torch_directml.device(i)
print(f"Device {i}: {dml_device}")
# Select device 1 (example)
dml = torch_directml.device(1)
Available DirectML devices: 2
Device 0: privateuseone:0
Device 1: privateuseone:1
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:
Intel Xeon W-3175X
NVIDIA GeForce RTX 4070ti Super
AMD Radeon RX 7800XT
Windows 11 24H2
Python 3.13.2 ---> PyTorch 2.6.0+cu126, Keras 3 # The NVIDIA CUDA one
Python 3.11.9 ---> PyTorch-DirectML, Keras 3 # The DirectML for AMD card environment
I just reviewed the post then doing test and have to say sorry where I find nothing can helps. Here's what happends:
First of all, I'm using Pytorch. keras.distribution not work where it returns None type under torch backend whether is torch+cuda or torch-directml. So keras.distribution.list_devices() not work on anywhere(My Pytorch deployment). The issue #21190 discovered for is TF2/JAX backends.
Second is I used like with keras.device("privateuseone:1"), it still can't run successfully. I uses Task Manager to watch GPU engines and just find out the model have no message hints and running on cpu.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm here for asking GPU selection problems since I'm still new for Keras 3 when I jump into Keras 3 from PyTorch a while.
I have a Windows 11 Machine contains 2 cards with NVIDIA GeForce RTX 4070ti Super and AMD Radeon RX 7800XT respectively.
Now I have a independent Python 3.11.9 env installed
torch-directml
. 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:
Beta Was this translation helpful? Give feedback.
All reactions