Skip to content

fix: lazy-load Moore Mate bindings - #1441

Merged
wooway777 merged 1 commit into
mainfrom
feat/moore-mate-fix
Jul 30, 2026
Merged

fix: lazy-load Moore Mate bindings#1441
wooway777 merged 1 commit into
mainfrom
feat/moore-mate-fix

Conversation

@gongchensu

@gongchensu gongchensu commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator

InfiniCore 原先会在包初始化时加载可选的 Mate 原生扩展,即使当前推理并不使用 Mate,也可能因扩展不兼容导致 import infinicore 直接异常退出。此次改为仅在实际调用 Mate 算子时按需加载,避免影响 Paged Attention、Graph 等非 Mate 路径。

@gongchensu
gongchensu requested a review from a team July 30, 2026 04:27
… to prevent SIGILL

Co-authored-by: zhushuang <zhushuang1110@gmail.com>
@spike-zhu

Copy link
Copy Markdown
Contributor

问题背景

部分摩尔镜像创建的容器中的 Mate 版本为非 v0.1.3 版本。InfiniCore 在导入阶段会直接加载 mate 对应的 flash_attn,执行 import infinicore 时触发 Illegal instruction (core dumped)

修改前

使用非 v0.1.3 的 Mate 编译并安装 InfiniCore 后,导入失败:
image

修改内容

  • 增加 Mate v0.1.3 版本校验。
  • flash_attn 调整为算子调用时按需加载。
  • 保留现有 Python API,避免 import infinicore 阶段加载不兼容的 Mate。
  • Mate 版本不满足要求时,在算子调用阶段给出明确错误。

验证结果

修改后,非 v0.1.3 环境可以正常执行 import infinicore,不再触发 core dump:
image

@wooway777
wooway777 merged commit 8e8df0f into main Jul 30, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants