bugfix: fix tilelang g_tilingKey multiple definition across kernel families. - #2242
Open
fengz72 wants to merge 1 commit into
Open
bugfix: fix tilelang g_tilingKey multiple definition across kernel families.#2242fengz72 wants to merge 1 commit into
fengz72 wants to merge 1 commit into
Conversation
fengz72
requested review from
DongheJin,
DragonFive,
JimHsiung,
Kang-Meng,
liujinguang0125,
liutongxuan,
ustcfy,
xiao-yu-chen,
yingxudeng,
yinjiawei01 and
zhang-minchao
as code owners
August 14, 2026 09:23
zhang-minchao
approved these changes
Aug 18, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
修复不同 TileLang kernel family 共享相同 variant key 后缀(如
w4、w5、w6)时g_tilingKey多重定义的链接错误。根因
_run_variant_worker中将g_tilingKey定义为g_tilingKey__{variant_key},当spec_verify_token_update和spec_verify_attention_tiling_update两个 family 使用相同的 variant 后缀(w4/w5/w6)时,生成相同的全局符号名。两者同时链接进libtilelang_kernels.a后,链接器报 multiple definition 错误:ld: multiple definition of g_tilingKey__w4'
ld: multiple definition of g_tilingKey__w5'
ld: multiple definition of `g_tilingKey__w6'
修复方案
在
-Dg_tilingKey宏定义中加入kernel_name前缀:-Dg_tilingKey=g_tilingKey_{kernel_name}{variant_key}
使每个 family 生成唯一符号(如
g_tilingKey__spec_verify_token_update_w4与g_tilingKey__spec_verify_attention_tiling_update_w4),消除冲突。kernel_family_builder.py本身已包含在缓存依赖文件列表中,修改后自动触发所有 variant 重新编译,无需手动清理缓存Related Issues
Change Type
Pull Request Checklist
Thank you for contributing to xLLM. Before requesting review, please make sure the following items are complete.
PR Title and Commit Messages
<type>: <subject>.Pre-commit Checks
pre-commitby runningpip install pre-commitor an equivalent command.pre-commit install.pre-commit run --all-filesand fixed any reported issues.Self Review
.agents/skills/code-review/references/custom-code-style.md, especially code written or assisted by AI.mainbranch.Build and Test Coverage
python setup.py build testhas passed on a CUDA machine.python setup.py build testhas passed on an NPU machine.python setup.py build testhas passed on an MLU machine.Reviewer Notes