-
-
Notifications
You must be signed in to change notification settings - Fork 21k
[CI/Build][ROCm] Run the TileLang HIP symbol checks in their own interpreter #53117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
AndreasKaratzas
merged 2 commits into
vllm-project:main
from
stefankoncarevic:ci-tilelang-hip-symbol-checks
Aug 21, 2026
+74
−45
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| #!/usr/bin/env python3 | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| # SPDX-FileCopyrightText: Copyright contributors to the vLLM project | ||
| """Check that DeepSeek V4 and the JIT monitor leave the HIP symbols alone. | ||
|
|
||
| TileLang ships a libhip_stub.so that takes over `hipFree` in the global symbol | ||
| table once it is loaded, so neither the model import nor the JIT monitor may | ||
| pull TileLang in on ROCm. Both claims are about process-global state, which is | ||
| why this runs in an interpreter of its own. | ||
| """ | ||
|
|
||
| import ctypes | ||
| import sys | ||
|
|
||
| from vllm.model_executor.layers import mhc # noqa: F401 | ||
| from vllm.models import deepseek_v4 # noqa: F401 | ||
| from vllm.utils import jit_monitor | ||
|
|
||
|
|
||
| class DlInfo(ctypes.Structure): | ||
| _fields_ = [ | ||
| ("dli_fname", ctypes.c_char_p), | ||
| ("dli_fbase", ctypes.c_void_p), | ||
| ("dli_sname", ctypes.c_char_p), | ||
| ("dli_saddr", ctypes.c_void_p), | ||
| ] | ||
|
|
||
|
|
||
| def _must_not_run() -> None: | ||
| raise AssertionError("TileLang JIT monitor must not run on ROCm") | ||
|
|
||
|
|
||
| jit_monitor._active = False | ||
| jit_monitor._setup_triton_autotuning_print = lambda: None | ||
| jit_monitor._setup_triton_jit_hook = lambda: None | ||
| jit_monitor._setup_cutedsl_jit_hook = lambda: None | ||
| jit_monitor._setup_tilelang_jit_hook = _must_not_run | ||
| jit_monitor.activate() | ||
|
|
||
| imported = [ | ||
| name for name in sys.modules if name == "tilelang" or name.startswith("tilelang.") | ||
| ] | ||
| assert not imported, f"TileLang was imported: {imported}" | ||
|
|
||
| libdl = ctypes.CDLL("libdl.so.2") | ||
| dlsym = libdl.dlsym | ||
| dlsym.argtypes = [ctypes.c_void_p, ctypes.c_char_p] | ||
| dlsym.restype = ctypes.c_void_p | ||
| dladdr = libdl.dladdr | ||
| dladdr.argtypes = [ctypes.c_void_p, ctypes.POINTER(DlInfo)] | ||
| dladdr.restype = ctypes.c_int | ||
|
|
||
| address = dlsym(None, b"hipFree") | ||
| assert address is not None, "hipFree is not available in the global symbol table" | ||
| info = DlInfo() | ||
| assert dladdr(address, ctypes.byref(info)) | ||
| source = info.dli_fname.decode() if info.dli_fname else "<unknown>" | ||
| assert "libhip_stub.so" not in source, source | ||
| assert "libamdhip64.so" in source, source | ||
| print("OK") | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need a separate file for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The subprocess is the point of the change, and I put the script in a file to
follow what is already in the tree:
tests/cuda/test_platform_no_cuda_init.pykeeps its checks in
tests/cuda/scripts/check_*.pyand runs them the same way,with
subprocess.run([sys.executable, str(script_path)])and apytest.failona non-zero exit.
The alternative is to inline the source as a string and pass it with
python -c,as
tests/config/test_config_utils.pydoes, but this check needs actypesstructure and the
dlsym/dladdrcalls, and inside a string none of that isformatted or linted. I can switch if you prefer no new file in the tree.