[BUG]: Compiling PTX with undefined extern succeeds and produces empty kernel
まだ誰も着手していません。
- 主要言語
- Cython
- スター
- 3.4k
- フォーク
- 329
- 平均マージ
- 1日 23時間
- マージ済み PR(30日)
- 116
説明
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
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
添付の cudapy.py と cuda.core.experimental の Program.compile("cubin") エントリポイントから始め、同じ PTX に対する ptxas の動作と比較してください。コンパイル中に未定義の extern 関数がどのように処理されるかを追跡してください。Program.compile() がエラーを発生させるか、未解決の extern を別の方法で報告し、空の cubin を生成しなければ完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- python
- 領域
- compilers
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100