修复 Fused MoE Python 绑定构建时的共享库回退逻辑 #60

Open
Mengz wants to merge 2 commits from Mengz/op_optimization:mengz/fused-moe-python-linker into master
First-time contributor

现在 Fused MoE Python 绑定脚本对 Python 共享库的寻址过于依赖 sysconfig 返回的 LDLIBRARY 名称,一旦容器里只有 static library、版本后缀不同,或者 shared library 被安装为 libpython3.x.so.1.0 这类变体,构建会直接失败。

这个修复补上了对 LDLIBRARY、LIBRARY、libpython{version}.so 和 libpython{version}.so.1.0 等候选名称的回退枚举,如果 sysconfig 先给出的是 .a 文件,还会优先尝试对应的 .so 变体,最后再回填给 mxcc 需要的目录和文件名。

已在沐曦 GPU 环境完成实测,这条链路可以成功构建 pybind 模块,后续 Python 端依次跑通 fused_moe_i8_tn_topk1、topk2、topk3 的测试,输出数值与预期一致。

现在 Fused MoE Python 绑定脚本对 Python 共享库的寻址过于依赖 sysconfig 返回的 LDLIBRARY 名称,一旦容器里只有 static library、版本后缀不同,或者 shared library 被安装为 libpython3.x.so.1.0 这类变体,构建会直接失败。 这个修复补上了对 LDLIBRARY、LIBRARY、libpython{version}.so 和 libpython{version}.so.1.0 等候选名称的回退枚举,如果 sysconfig 先给出的是 .a 文件,还会优先尝试对应的 .so 变体,最后再回填给 mxcc 需要的目录和文件名。 已在沐曦 GPU 环境完成实测,这条链路可以成功构建 pybind 模块,后续 Python 端依次跑通 fused_moe_i8_tn_topk1、topk2、topk3 的测试,输出数值与预期一致。
Mengz added 2 commits 2026-06-26 10:04:37 +08:00
This pull request has changes conflicting with the target branch.
  • 基于AI Agent开发范式的国产GPU大模型推理算子库优化/baselines/fused_moe/scripts/build_fused_moe_i8_tn_pybind.sh
You can also view command line instructions.

Step 1:

From your project repository, check out a new branch and test the changes.
git checkout -b Mengz-mengz/fused-moe-python-linker master
git pull mengz/fused-moe-python-linker

Step 2:

Merge the changes and update on Gitea.
git checkout master
git merge --no-ff Mengz-mengz/fused-moe-python-linker
git push origin master
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: metax-maca/op_optimization#60
No description provided.