torch-directml

by Microsoft · Framework · Text & code

A PyTorch plugin that runs model training and inference on AMD, Intel or Nvidia graphics cards under Windows through DirectX 12.

Latest · Nov 28Training an e5-small-shaped encoder at batch 16x128 ran at 582 ms/step on the RX 6700 XT with DirectML on Windows

AccessOpen codeLicenseMIT

Seen running on

MachineSpeedHowSeen by
1 run on 12 GB
RX 6700 XT
and 2 more builds in the same post
no speed givenshige888Japanese · Nov 28

Evidence

  1. Nov 28
    Same probe (e5-small-shaped encoder, batch 16x128): 582 ms/step on RX 6700 XT via DirectML versus 1,598 ms/step on the Ryzen 5700G CPU
    Hands-on testshige888Japanese
  2. Nov 28
    A training-script smoke run finished 8 steps in 12.2 s, then completed ONNX export, int8 quantization and evaluation
    Hands-on testshige888Japanese
  3. Nov 28
    Wheels did not match Python 3.14; a dedicated Python 3.11 venv with torch 2.4.1 and torch-directml 0.2.5 worked
    Hands-on testshige888Japanese
  4. Nov 28
    With an iGPU and a discrete GPU, both show up (gpu[0] iGPU, gpu[1] RX 6700 XT); without an explicit index the slower one may be picked
    Hands-on testshige888Japanese
  5. Nov 28
    Known limitation confirmed: AdamW's lerp op falls back to CPU, though training still runs
    Hands-on testshige888Japanese

Everything said about torch-directml, on the wire