Hacker News new | ask | show | jobs
by sorenjan 946 days ago
I'm on mobile and haven't looked at this project, but usually DirectML support is added as a torch backend. Instead of device = "cuda" if torch.cuda.is_available() else "cpu" you add import torch_directml device = torch_directml.device()

How else are you supposed to support AMD in Pytorch on Windows?

1 comments

My comment was about the “AMD - Windows only” part of readme.
My point was that it's not a matter or DirectML or torch, it's simply a choice of backend for torch. It's an easy way of adding AMD support to torch based projects in Windows, there's probably an equally easy way of adding ROCm support in Linux. It's just that using cpu or Cuda is built in and usually the two default options when writing torch code, and somebody have to care enough to explicitly add AMD support.

It's not exactly as easy as just changing one line by the way, not all operations are implemented so there's some testing and maybe some rewrites needed. Hopefully the GPU backend mess gets solved in the general case soon.

It was more like a case of the author not having AMD hardware to test their automated installer: https://github.com/Acly/krita-ai-diffusion/issues/76