[hiptools] robust kernel demangle parsing and double kernarg support#10
[hiptools] robust kernel demangle parsing and double kernarg support#10apinge wants to merge 1 commit into
Conversation
Signed-off-by: apinge <Tong.Qiu2@amd.com>
| 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") |
There was a problem hiding this comment.
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.
| p = os.path.abspath(os.path.expanduser(p)) | ||
| if os.path.isfile(p): | ||
| mt = max(mt, os.path.getmtime(p)) | ||
| return mt |
There was a problem hiding this comment.
Cache invalidation problem, in which case we will meet problem?
| pre += f"-{k}={v}" | ||
|
|
||
| assert ext == ".cpp" or ext == ".s" | ||
| gfx_arch = amdgpu_arch() |
There was a problem hiding this comment.
Use gfx_arch for cross compilation.
|
|
||
|
|
||
| def test_strip_void_prefix_matches_python_func_name(): | ||
| """demangle 常带 ``void foo(...)``;pyhip 用 ``getattr(mod, \"foo\")``,必须去掉 ``void ``。""" |
No description provided.