Skip to content

Tracking: Tile-to-SIMT Interop (cuda-oxide as SIMT participant) #96

Open

Description

@mohamedsamirx

This is a tracking issue. It coordinates work for cuda-oxide to be the Rust SIMT participant in CUDA's Tile-to-SIMT interop story. The original proposal from @mohamedsamirx is preserved at the bottom.

Background

cuda-oxide is the Rust SIMT compiler. The tile programming model itself belongs to separate tile frontends (cuTile Python, CUDA Tile C++, future Rust tile DSLs). cuda-oxide's role here is to produce SIMT artifacts (PTX, LTOIR) that those frontends can launch alongside, or eventually link into, tile kernels.

Tile-to-SIMT interop comes in two flavors (per the public cuTile Python Interoperability page):

  • Inter-kernel — two separate kernels (one tile, one SIMT) launched on the same CUDA stream, sharing arrays. Supported in the public cuTile Python release today.
  • Intra-kernel — a tile kernel calling a SIMT device function from inside its own body. Upstream future work; public tracker: NVIDIA/cutile-python#69.

Plan

Phase 0 — Inter-kernel example (today)

  • Minimal cutile_inter_kernel example combining a cuda-oxide-built SIMT kernel and a cuTile Python tile kernel sharing a CUDA stream and an array.
  • README walking through the build and run steps.
  • Smoketest coverage goes through the normal example path: scripts/smoketest.sh -o "^cutile_inter_kernel$" runs cargo oxide run cutile_inter_kernel, which builds the nested cuda-oxide SIMT PTX crate and then runs the cutile-rs host pipeline.

Phase 1 — Tile kernels calling Rust SIMT code (gated)

Gated on NVIDIA/cutile-python#69 exposing a public way for a tile kernel to call SIMT device functions from inside its own body. The exact shape upstream takes (a pre-compiled artifact, a plug-in library, or both) will determine the cuda-oxide side.

When the upstream surface is available:

  • A one-shot cargo oxide emit-ltoir <crate> command for producing the SIMT artifact in a single step. Useful regardless of which mechanism lands; can ship sooner.
  • A worked example where a tile kernel calls into a Rust #[device] function in its own body.
  • A small Rust macro (working title #[foreign_export]) that takes a natural #[device] function and wraps it to match whatever signature the public mechanism expects, for per-thread, per-warp, and per-block scopes.
  • Make the cuda-oxide compiler usable as a library (no spawning cargo or rustc per request). Useful on its own; independent of the upstream shape; can start anytime.
  • Whatever packaging the public mechanism wants on our side.

How this issue is used

This is an umbrella. Concrete deliverables are spawned as focused child issues only when the work is near-term. Each child issue should reference "Part of #96" so GitHub creates the cross-link. The task lists above tick automatically when their child issues close.


Original proposal by @mohamedsamirx

Summary

CUDA 13.3 introduced CUDA Tile programming for C++ through cuda_tile.h, __tile_global__, and __tile__ functions. I would like to propose investigating whether cuda-oxide should eventually support this programming model, and if so, at which layer.

This is not a request to immediately add a large feature. I am opening this as a design/proposal issue to get maintainer feedback before doing any implementation work.

Motivation

CUDA Tile seems important because it gives CUDA programmers a higher-level way to express tile-oriented GPU work while still mapping efficiently to hardware features such as Tensor Cores, TMA, and modern memory movement patterns.

For cuda-oxide, this could matter long term because:

  • tile-oriented programming is becoming a first-class CUDA model;
  • Rust GPU code will likely need a way to interoperate with or express tile-level kernels;
  • cuda-oxide already has lower-level CUDA abstractions and device-code generation pieces that may eventually intersect with tile programming;
  • deciding the right integration point early could avoid ad-hoc support later.

Open Questions

I would like maintainer guidance on whether this fits the project scope, and where it should live if it does.

Some possible directions:

  • Interop only: support building/linking/launching C++ CUDA Tile kernels from cuda-oxide workflows.
  • Tooling detection: teach cargo oxide doctor or related tooling to detect CUDA 13.3+ Tile capability.
  • Examples first: add a small example showing cuda-oxide host/runtime code interacting with a CUDA Tile kernel.
  • Rust-facing API later: eventually design Rust abstractions for tile-style programming if that aligns with the project.
  • Compiler/backend support: investigate whether cuda-oxide should ever lower Rust code into Tile-compatible IR or whether that is out of scope.

Concerns / Constraints

CUDA Tile appears to be more than a normal intrinsic wrapper. It introduces a distinct tile-level programming model, and current CUDA Tile docs indicate that tile functions and normal SIMT device functions have restrictions around directly calling each other.

That means a direct Rust API may require careful design rather than simply adding bindings.

There may also be practical testing constraints. CUDA Tile requires recent CUDA Toolkit support, and some functionality may depend on newer GPU architectures than many contributors have locally.

Suggested First Step

Before implementation, I suggest we decide what the first useful milestone should be.

My initial preference would be a small investigation/design step, for example:

  1. document how CUDA Tile kernels are compiled and linked;
  2. check whether cuda-oxide can interoperate with a minimal C++ Tile kernel;
  3. identify whether this belongs in cargo-oxide, cuda-core, examples, or compiler/lowering work;
  4. only then decide whether a Rust-facing API makes sense.

Activity

  1. nihalpasham commented on May 28, 2026

    @nihalpasham
    Collaborator

    Thanks for filing the issue. This is a pretty important one. Internally, this is referred to as Tile-to-SIMT Interop

    Tile-to-SIMT interop is split into two flavors (see the Interoperability page):

    • Inter-kernel interop — two separate kernels (one Tile, one SIMT) launched on the same CUDA stream against the same arrays. This is supported today in the public cuTile Python release.
    • Intra-kernel interop — a Tile kernel calling a SIMT device function inside its body, via a foreign FFI dialect. This is not yet exposed publicly but is tracked upstream at NVIDIA/cutile-python#69, where we have stated it is planned but without a public timeline.

    Where cuda-oxide fits: we are the Rust SIMT compiler and not the right home for a tile programming model itself. What cuda-oxide can be is a good SIMT participant in this interop story. The CUDA Tile compiler is the canonical authority on the tile-side details; the same FFI surface is intended to be shared across all tile frontends (cuTile Python today, CUDA Tile C++, cutile-rs, future ones).

    On the proposed directions:

    1. Interop only, yes: this is the direction.
    2. Tooling detection, not really needed: Inter-kernel interop just needs both compilers to produce launchable artifacts. If you have both cuda-oxide and cutile python, cutile-rs, or cutile-c++ installed, you have what you need.
    3. Examples first, yes: and this is the right next step. We'll plan and land a minimal inter-kernel example: a Rust SIMT kernel built by cuda-oxide and a cutile-rs kernel sharing a CUDA stream and arrays.
    4. Rust-facing Tile API, out of scope for this repo: Tile authoring in Rust is not what this compiler is for.
    5. Compiler/backend, yes for the SIMT side: This is mostly already in place. See existing examples like examples/cpp_consumes_rust_device and examples/standalone_device_fn which produce LTOIR JIT linked to produce PTX.

    The restriction you flagged about Tile and SIMT device functions not being able to call each other directly: that's where the intra-kernel case comes in, and the upstream foreign FFI dialect is the planned bridge for it. It isn't a blocker for inter-kernel interop, which is what we'll target first.

    Plan from here:

    1. Re-title this issue as a tracking issue for Tile<>SIMT interop with cuda-oxide as the SIMT participant.
    2. Land a minimal, runnable inter-kernel example.
    3. Track cutile-python#69 for the intra-kernel side; revisit when that public API surface lands.
    4. Spawn smaller, focused issues from there as concrete pieces become near-term.

    I'll keep this open and will update once the example PR lands.

  2. self-assigned this
    on May 28, 2026
  3. added
    tracking
    on May 28, 2026
  4. changed the title [-]Proposal: investigate CUDA Tile support in cuda-oxide[/-] [+]Tracking: Tile-to-SIMT Interop (cuda-oxide as SIMT participant)[/+] on May 28, 2026
  5. added
    epic
    interop
    on May 28, 2026
  6. mohamedsamirx commented on May 28, 2026

    @mohamedsamirx
    ContributorAuthor

    Thanks for turning this into a clear tracking issue.
    The Tile-to-SIMT framing makes sense to me.

    I’d be very interested in helping with this area, especially the focused follow-up pieces after the initial inter-kernel example shape is clear. For example, I’d be happy to help with tests, README/run instructions, cuda-oxide-side build integration, or smaller child issues spawned from this tracker.

    I’ll wait for the initial example PR/update so I don’t duplicate work or choose the wrong API surface, but please feel free to point me at a specific piece when there is one suitable to pick up.

    Thanks again for clarifying the direction.

  7. nihalpasham commented on Jun 1, 2026

    @nihalpasham
    Collaborator

    Initial inter-kernel Tile/SIMT interop example is now landed in d989fa4.

    What changed:

    • Added metadata-driven interop support in cargo oxide run and cargo oxide build for examples that declare extra cuda-oxide device crates.
    • Added cutile_inter_kernel: a cutile-rs Tile row-softmax stage followed by a cuda-oxide SIMT PTX threshold/scale stage.
    • The two kernels run in one host process on the same CUDA stream and share cutile-rs device tensors.
    • Added public docs in the example README, root README, cargo-oxide README, and the cuda-oxide book.

    This covers the first practical inter-kernel path. Intra-kernel Tile interop remains tracked here as follow-up work.

  8. mohamedsamirx commented on Jun 1, 2026

    @mohamedsamirx
    ContributorAuthor

    Now that the first inter-kernel example has landed, one possible gap worth discussing is whether cutile_inter_kernel should also cover cuda-oxide on both sides of the Tile stage.

    The current example proves:

    Tile -> SIMT
    

    A follow-up could exercise:

    SIMT -> Tile -> SIMT
    

    That would show cuda-oxide as a SIMT participant both before and after a Tile kernel:

    • a cuda-oxide SIMT kernel writes or preprocesses a cutile-rs tensor;
    • the cutile-rs Tile kernel consumes that tensor;
    • a cuda-oxide SIMT kernel post-processes the Tile output.

    This would still stay fully inside the public inter-kernel model, so it would not depend on the future intra-kernel foreign FFI surface. The main value I see is that it validates same-stream ordering and shared-device-allocation interop in both directions, not only Tile producing data for a SIMT consumer.

    Curious how important you think this gap is for the inter-kernel story.

  9. nihalpasham commented on Jun 3, 2026

    @nihalpasham
    Collaborator

    I'd (definitely) love more examples. If you'd want to submit a PR, that would be great.

  10. alejandro-soto-franco commented on Jun 6, 2026

    @alejandro-soto-franco
    Contributor

    Really like this issue @mohamedsamirx, took the liberty of preparing a PR for emit-ltoir. Thanks to @nihalpasham for his detailed responses, great contextualisation.

  11. alejandro-soto-franco commented on Jun 29, 2026

    @alejandro-soto-franco
    Contributor

    Hi y'all, just submitted PR #312 for the in-process library-mode compiler. For my purposes, I intend for this to be a stepping stone to a working integration with Burn. Next step would be a CubeCL-IR→#[kernel] bridge, which I will raise as a separate issue. Thanks again to @mohamedsamirx for such an instructive issue :)

  12. added this to the cuda oxide v0.4.0 milestone on Oct 25, 2026
  13. added
    cuda-oxide
    on Oct 29, 2026
  14. added
    cutile-rs
    on Nov 12, 2026
  15. elibol commented on Nov 12, 2026

    @elibol
    Collaborator

    Related current Rust-side work: merged #1603 and #1604 provide shared host handles, allocations and async launches for Tile/SIMT composition. #1749 extends foreign tile-library calls with raw-pointer operands. These are distinct parts of the interop story and should be tracked here alongside the original inter-kernel example.

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

Metadata

Metadata

Assignees

Labels

cuda-oxidecutile-rsepicinteroptracking

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions