NVIDIA / NVIDIA/cutile-python

[FEA]: CUDA C or PTX Injection

Offen
#69 3 Kommentare 2 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

dep: cuda-tileir feature request
Vorherrschende Sprache
Python
Sterne
2.2k
Forks
155
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

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

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne mit test/test_bytecode.py und der vorhandenen Abdeckung zum Starten von CUBIN-Kernels, um zu verstehen, wie derzeit Unterstützung für extern kompilierte Kernels bereitgestellt wird. Lege gemeinsam mit den Maintainer:innen die vorgesehene Grenze für die Injektion von CUDA C/PTX und das API-Verhalten fest und füge anschließend Tests hinzu, die zeigen, dass eingebetteter Code neben mit Python erstellten cuTile-Kernels bestehen kann.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
python
Bereich
compilers
Issue-Typ
Feature
Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Aktivitätsstatus
Ruhig
Klarheit
Muss geklärt werden
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.