Skip to content

[hiptools] robust kernel demangle parsing and double kernarg support#10

Open
apinge wants to merge 1 commit into
tingqli:mainfrom
apinge:update_hiptools
Open

[hiptools] robust kernel demangle parsing and double kernarg support#10
apinge wants to merge 1 commit into
tingqli:mainfrom
apinge:update_hiptools

Conversation

@apinge

@apinge apinge commented Apr 14, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

Signed-off-by: apinge <Tong.Qiu2@amd.com>
@apinge apinge requested a review from sammysun0711 April 14, 2026 11:24
@apinge apinge marked this pull request as ready for review April 15, 2026 01:38
Comment thread src/core/hiptools.py
override = os.environ.get("PYHIP_AMDGPU_ARCH", "").strip()
if override:
return override
gfx_archs = subprocess.check_output(["/opt/rocm/llvm/bin/amdgpu-arch"]).decode("utf-8")

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For future rocm release (e.g. rocm 7.11+) , the rocm may be not installed in default /opt/rocm folder, because in additional to deb/rpm package or tarball installation, rocm can be installed in python virtual environment as follow:

python3 -m pip install --index-url https://rocm.nightlies.amd.com/v2/gfx94X-dcgpu/ \ "rocm[libraries,devel]"

We may use environment variable ROCM_PATH for rocm root used in vllm docker image: https://github.com/vllm-project/vllm/blob/60995c05b4ca3a26b92dfa7abed8f5db850301cc/docker/Dockerfile.rocm_base#L28

The ROCM_PATH can be get via rocm-sdk path --root in python wheel installation. The $ROCM_PATH/llvm/bin/amdgpu-arch should be consistent cross different installation method.

Comment thread src/core/hiptools.py
p = os.path.abspath(os.path.expanduser(p))
if os.path.isfile(p):
mt = max(mt, os.path.getmtime(p))
return mt

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cache invalidation problem, in which case we will meet problem?

Comment thread src/core/hiptools.py
pre += f"-{k}={v}"

assert ext == ".cpp" or ext == ".s"
gfx_arch = amdgpu_arch()

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use gfx_arch for cross compilation.



def test_strip_void_prefix_matches_python_func_name():
"""demangle 常带 ``void foo(...)``;pyhip 用 ``getattr(mod, \"foo\")``,必须去掉 ``void ``。"""

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants