Skip to content

[Feature Request]: Add pytorch-directml Support to Boost The Efficiency on ANY Windows 10 with DirectX 12 #3756

@SheepChef

Description

@SheepChef

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:

  1. Solve the dependency problems.
  2. 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 !

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions