Skip to content

Select a multilang dependency that will run on CPU #1200

Description

@aidanbruneel

Investigation definition

Question to answer

What dependency or runtime approach should multilang-support use so that the service can run reliably on CPU without requiring CUDA or an NVIDIA GPU?

Determine whether the existing MarianMT / Hugging Face transformers implementation can reasonably be made CPU-only, or whether a different translation dependency is needed.

Decision or next step this enables

The result will determine the CPU-compatible translation approach to implement for multilang-support.

Any required production changes should be captured as separate implementation work after an approach is selected.

Current understanding and key unknowns

Confirmed:

  • multilang-support currently provides English-to-French translation using Helsinki-NLP/opus-mt-en-fr through Hugging Face transformers.
  • The service currently depends on PyTorch.
  • Its Docker image currently uses a CUDA-enabled PyTorch base image.
  • docker-compose.yml currently reserves an NVIDIA GPU for the service.
  • The current device-selection code uses CUDA when GPUs are available, but does not currently establish a working CPU fallback when no GPU is present.
  • Current multilang-support and espnet-tts services incompatible with CUDA 12.8 #1198
    addressed the immediate RTX 5090 / CUDA compatibility problem while intentionally retaining GPU execution for multilang-support.

Key unknowns:

  • Whether the existing MarianMT / transformers stack can be made reliably CPU-only with appropriate runtime dependencies and device handling.
  • If not, which CPU-compatible translation dependency would best fit the existing service.
  • Whether CPU translation performance is reasonable for typical IMAGE requests.

Investigation plan

Proposed investigation approach

  1. Review the current model, dependencies, container configuration, and device-selection logic.
  2. Prototype/fix the existing CPU execution path sufficiently to determine whether the current MarianMT / transformers stack is viable without GPU support.
  3. If the existing stack is not suitable, identify and compare viable CPU-compatible alternatives.
  4. Run a minimal proof of concept of the most promising approach without CUDA or an NVIDIA runtime.
  5. Verify English-to-French translation through the existing /service/translate interface.
  6. Record relevant performance and resource observations.
  7. Recommend an approach and identify any follow-up implementation work.

Primary output

Written findings and recommendation

Completion criteria

  • The current sources of the GPU/CUDA requirement are identified.
  • The existing MarianMT / transformers stack has been evaluated as a CPU-only option.
  • Alternative dependencies are compared if the existing stack is unsuitable.
  • At least one viable approach is demonstrated without CUDA or an NVIDIA GPU.
  • English-to-French translation works through the existing service interface.
  • Relevant performance and resource trade-offs are documented.
  • A recommended approach and rationale are recorded.
  • Any resulting implementation work is captured separately.

Additional context

Constraints and boundaries

  • The selected approach must not require CUDA or an NVIDIA GPU.
  • Preserve the existing English-to-French translation functionality.
  • Preserve the existing /service/translate interface unless the Investigation identifies a compelling reason not to.
  • Do not expand this Investigation into adding additional languages.
  • Production implementation is outside the scope of this Investigation.

Evidence, prior work, and related issues

Primary code to review:

Existing consumers of the translation service:

Related work:

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area: servicesAffects shared services such as TTS, translation, LLM access, or SuperCollider.

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions