[BUG]: Compiling PTX with undefined extern succeeds and produces empty kernel
Nessuno ha ancora preso questa issue.
- Lingua principale
- Cython
- Stelle
- 3.4k
- Fork
- 329
- Merge medio
- 1g 23h
- PR unite (30g)
- 116
Descrizione
Is this a duplicate?
- I confirmed there appear to be no duplicate issues for this bug and that I agree to the Code of Conduct
Type of Bug
Silent Failure
Component
cuda.core
Describe the bug
Attempting to compile PTX with an undefined extern function seems to succeed and produce a cubin with an empty kernel. I am doing this like:
from cuda.core.experimental import Program, ProgramOptions
options = ProgramOptions(arch="sm_75")
program = Program(code, code_type="ptx", options=options)
cubin = program.compile("cubin")
The same PTX compiled with ptxas results in a failure to compile:
$ ptxas -arch sm_75 add_float16.ptx
ptxas fatal : Unresolved extern function '_ZplRK6__halfS1__1'
Am I using the Program.compile() interface incorrectly?
How to Reproduce
Run the attached file:
python cudapy.py
This will produce a cubin with an empty kernel, and show ptxas raises an error for the same PTX.
Expected behavior
An exception or some other error raised by Program.compile()
Operating System
Ubuntu Linux
nvidia-smi output
No response
Guida per i contributori
Apri la guida per i contributori
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.
Direzione di ricerca
Inizia con il cudapy.py allegato e con l'entry point cuda.core.experimental Program.compile("cubin"), quindi confronta il suo comportamento con ptxas sullo stesso PTX. Traccia il modo in cui le funzioni extern non definite vengono gestite durante la compilazione. Il lavoro è completato quando Program.compile() genera un errore o segnala in altro modo la funzione extern non risolta, invece di produrre un cubin vuoto.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- python
- Ambito
- compilers
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100