OpenNMT / OpenNMT/CTranslate2

DirectML Support

Open
#1,615 3 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
C++
Stars
4.7k
Forks
536
Avg merge
12h 12m
Merged PRs (30d)
4

Description

Assume that I already followed Microsoft's instructions to Enable PyTorch with DirectML on Windows and the DirectML library loads correctly according to MS's example code.

If I wanted to use PyTorch + DirectML + Ctranslate2 + an AMD GPU, how would I do it? Does Ctranslate2 need any major updates? Shouldn't I just need to pass directml instead of cuda to device= as found in the quickstart?

What is the bottleneck to this not working right now?

Aside: MS's instructions for DirectML's Python library install pytorch==2.0 as of early 2024. MS's documentation suggests it only works with PyTorch 1.3, which seems to be incorrect? So, it should not be a matter of supporting PyTorch 1.x since DirectML runs on 2.x in practice.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the CTranslate2 quickstart and Microsoft's PyTorch with DirectML instructions, then determine whether the requested PyTorch, DirectML, CTranslate2, and AMD GPU combination is supported. Done should identify the current bottleneck and clearly define whether CTranslate2 updates or usage documentation are required.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, pytorch
Domain
machine-learning
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.