Skip to content

Conversation

larryliu0820
Copy link
Contributor

This pull request adds a CUDA backend to the ExecutorTorch project, enabling Ahead-Of-Time Inductor (AOTI) model execution on CUDA devices. The changes include new build rules, backend implementation, and a test runner for CUDA, as well as minor related improvements. The most important changes are summarized below.

CUDA Backend Implementation:

  • Added a new C++ implementation for the CUDA backend, including dynamic loading of AOTI CUDA model containers, tensor management between CPU and GPU, and execution logic. (backends/cuda/runtime/cuda_backend.cpp)
  • Introduced a CMake build file for the CUDA backend, which sets up the necessary libraries, dependencies, and installation rules. (backends/cuda/CMakeLists.txt)
  • Added a test runner executable for the CUDA backend, allowing end-to-end testing of model loading and execution. (backends/cuda/tests/voxtral_runner.cpp)

Build System Integration:

  • Updated the top-level CMakeLists.txt to conditionally build the CUDA backend and its dependencies when EXECUTORCH_BUILD_CUDA is enabled, and to register the backend for use. (CMakeLists.txt)
  • Modified the executor runner build logic to include the flat tensor extension library if built, improving modularity. (CMakeLists.txt)

Supporting Changes:

  • Added a type alias for AOTITensorHandle in the AOTI model container header to improve code clarity and type safety. (backends/aoti/aoti_model_container.h)
  • Minor Python code fixes and deduplication in the CUDA backend Python module, including resolving a merge conflict and removing redundant enum definitions. (backends/cuda/cuda_backend.py) [1] [2]

@pytorch-bot
Copy link

pytorch-bot bot commented Oct 1, 2025

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/14731

Note: Links to docs will display an error until the docs builds have been completed.

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Oct 1, 2025
@github-actions
Copy link

github-actions bot commented Oct 1, 2025

This PR needs a release notes: label

If your change should be included in the release notes (i.e. would users of this library care about this change?), please use a label starting with release notes:. This helps us keep track and include your important work in the next release notes.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "release notes: none"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

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

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants