NVIDIA / NVIDIA/cutile-python

[FEA]: CUDA C or PTX Injection

Open
#69 3 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

dep: cuda-tileir feature request
Dominant language
Python
Stars
2.2k
Forks
155
PR merge metrics
No merged PRs in 30d

Description

Is this a new feature, an improvement, or a change to existing functionality?

New Feature

How would you describe the priority of this feature request?

Low (would be nice)

Please provide a clear description of problem this feature solves

According to the test_bytecode.py file, cuTile supports launching kernels provided in CUBIN format, which enables execution of CUDA C kernels compiled offline. However, this creates a strict separation between Python-authored cuTile kernels and CUDA C kernels. Users must choose one approach or the other, with no supported mechanism to combine them. As a result, it is difficult to reuse existing CUDA C or PTX code, or to optimize performance-critical regions within an otherwise Python-based cuTile kernel.

Feature Description

Add support for embedding or injecting CUDA C or PTX code into a Python-authored cuTile kernel. This would enable a hybrid programming model where most kernel logic is expressed in Python, while selected sections can be implemented in CUDA C or PTX for fine-grained performance tuning or access to low-level hardware features. This capability would improve cuTile's flexibility, allow reuse of existing CUDA C/PTX code, and make cuTile a more powerful tool for advanced CUDA kernel development.

Describe your ideal solution

Provide an API that allows directly inserting CUDA C or PTX instructions into a Python-authored cuTile kernel, analogous to asm volatile(...) in CUDA C. This API would act as a low-level escape hatch, enabling users to inline raw code at specific points in the kernel.

Describe any alternatives you have considered

No response

Additional context

No response

Contributing Guidelines
  • I agree to follow cuTile Python's contributing guidelines
  • I have searched the open feature requests and have found no duplicates for this feature request

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 test/test_bytecode.py and the existing CUBIN kernel-launching coverage to understand how externally compiled kernels are currently supported. Define the intended CUDA C/PTX injection boundary and API behavior with maintainers, then add tests showing that embedded code can coexist with Python-authored cuTile kernels.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.