-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Description
Is there an existing issue for this?
- I have searched the existing issues and checked the recent builds/commits
What would your feature do ?
Microsoft have published a new torch version that is called pytorch-directml, which adds a new device called "dml" in pytorch and is able to run with any GPU (including AMD) on Windows 10 with DirectX 12.
I've noticed that dirctml have recently added the support of Python 3.10 and the newset version of Pytorch, however, there are still many problems ahead.
I am wondering if this feature can be added. If do so, the efficiency will be much improved on the Windows devices that only have AMD GPUs or Linux devices that AMD ROCm driver doesn't support.
For an instance, I compared the speed of CPU-Only and CUDA and DirectML in 512x512 picture generation with 20 steps:
CPU-Only: Around 6~9 minutes.
CUDA: Within 10 seconds.
DirectML: Within 10~30 seconds.
Thus it is evident that DirectML is at least 18 times faster than CPU-Only.
For pytorch-directml reference, check pytorch-with-directml
Proposed workflow
The feature is a fundamental change of the project.
If all the dependency problems are solved, what to do is changing device "cuda" in to "dml".
parser.add_argument('--device', type=str, default='dml', help='The device to use for training.')
so the step is:
- Solve the dependency problems.
- Change device used in the code.
Additional information
If the feature is added, the GPU hardware threshold of the project will be much lower !
Please consider !