hip-python-as-cuda: add the cuda-python 12+ cuda.bindings module layout
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 68/100
Direzione di ricerca
Start by inspecting the existing cuda.cuda and cuda.cudart modules and their aliasing approach. Add the cuda.bindings package with driver, runtime, and nvrtc submodules, then verify the documented imports and supported managed-memory and graph calls against the hip-python wheel. Also check the PyPI, Test PyPI, or source-build path so the compatibility package is installable alongside hip-python.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
The CUDA interoperability package currently mirrors the legacy cuda-python layout: from cuda import cuda, from cuda import cudart, from cuda import nvrtc. cuda-python 12.0 restructured its bindings into cuda.bindings.driver, cuda.bindings.runtime, and cuda.bindings.nvrtc, and downstream consumers have moved to that layout.
Concrete consumer: PyTorch imports from cuda.bindings import driver, runtime in several places (torch/cuda/_utils.py, torch/cuda/graphs.py for graph introspection and debug-dot dumps, torch/cuda/memory.py for a managed-memory allocator, torch/cuda/_graph_annotations.py). On ROCm builds, PyTorch currently reports cuda.bindings as unavailable, because NVIDIA's package installs and imports fine on a ROCm box but fails at the first call. If hip-python-as-cuda provided a working cuda.bindings layout, PyTorch could switch that platform gate to a functional probe and light these features up on ROCm.
What would work immediately through such a layout, verified with the hip-python 7.2.2 wheel against a HIP 7.15 runtime on gfx950: managed memory (hipMallocManaged, hipMemAdvise, hipFree, which is all PyTorch's UVM allocator needs), graph topology introspection (hipGraphGetNodes/GetEdges/NodeGetType/KernelNodeGetParams), and hipGraphDebugDotPrint. Some PyTorch features additionally need HIP APIs that do not exist yet (hipGraphNodeGetToolsId, hipGraphGetId/hipGraphExecGetId, hipFuncGetName); those are separate HIP runtime asks and not blockers for the layout itself.
Asks:
- Add a
cuda.bindingspackage (withdriver,runtime,nvrtcsubmodules) to hip-python-as-cuda, using the same aliasing approach as the existingcuda.cuda/cuda.cudartmodules. The call/return convention ((err, *outs)tuples) already matches cuda-python, so this is primarily a module-layout addition. - Publish hip-python-as-cuda wheels to PyPI alongside hip-python, or document the Test PyPI/source-build path prominently; the layout only helps consumers when the package is installable the way cuda-python is.
This issue was drafted with the help of an AI assistant (Claude); the compatibility claims were verified by hand against the hip-python 7.2.2 wheel.
- Lingua principale
- Cython
- Stelle
- 40
- Fork
- 8
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di ROCm/hip-python
-
need window support Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 42/100
ROCm/hip-python#108 ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
ROCm/hip-python#105 ·
Tutte le issue di ROCm/hip-python
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 80/100
microsoft/magentic-ui#588 ·
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
alexgorbatchev/simple-ptt#3 · 1 commento ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
CorrelAid/formtransform#44 ·