[BUG]: cuda-core: attributes.ptx_version() returns .target field, not .version from ptx file

未关闭
#627 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
42/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
停滞
技术栈
python
领域
hpc

调研方向

首先使用 test.ptx 运行提供的 main.py,并检查 cuda.core.experimental ObjectCode.from_ptx 和 kernel 属性的入口点,尤其是 ptx_version()。完成的标准是:对于此输入,ptx_version() 报告 PTX 的 .version 值 8.8,同时其他报告的属性保持其预期值。

由索引模型根据 Issue 内容生成。

描述

awaiting-response bug cuda.core
Is this a duplicate?
Type of Bug

Something else

Component

cuda.core

Describe the bug

test.ptx

.version 8.8
.target sm_86
.address_size 64

.visible .entry test_kernel()
{
	ret;
}

main.py

from cuda.core.experimental import Device, LaunchConfig, Program, ProgramOptions, launch, ObjectCode

dev = Device()
dev.set_current()
s = dev.create_stream()

mod = ObjectCode.from_ptx('test.ptx')

print(mod.get_kernel('test_kernel').attributes.num_regs())
print(mod.get_kernel('test_kernel').attributes.ptx_version())
print(mod.get_kernel('test_kernel').attributes.binary_version())

Prints

4
86
89

An aside, I am so excited for this library!

How to Reproduce

Run the above code

Expected behavior

I would expect ptx_version() to return the .version field from the ptx source.

Operating System

Ubuntu Linux 24.04

nvidia-smi output
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 575.51.03              Driver Version: 576.28         CUDA Version: 12.9     |
|-----------------------------------------+------------------------+----------------------+
| GPU  Name                 Persistence-M | Bus-Id          Disp.A | Volatile Uncorr. ECC |
| Fan  Temp   Perf          Pwr:Usage/Cap |           Memory-Usage | GPU-Util  Compute M. |
|                                         |                        |               MIG M. |
|=========================================+========================+======================|
|   0  NVIDIA GeForce RTX 4090        On  |   00000000:01:00.0  On |                  Off |
|  0%   45C    P3             72W /  450W |    2921MiB /  24564MiB |      1%      Default |
|                                         |                        |                  N/A |
+-----------------------------------------+------------------------+----------------------+

+-----------------------------------------------------------------------------------------+
| Processes:                                                                              |
|  GPU   GI   CI              PID   Type   Process name                        GPU Memory |
|        ID   ID                                                               Usage      |
|=========================================================================================|
|  No running processes found                                                             |
+-----------------------------------------------------------------------------------------+
主要语言
Cython
星标
3.4k
派生
329
平均合并
1 天 21 小时
30 天内合并 PR
113

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

NVIDIA/cuda-python 的其他 Issue

查看 NVIDIA/cuda-python 的全部 Issue

相似的 Issue

更多 HPC Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。