Skip to content

fix: lazy-load Moore Mate bindings - #1440

Open
gongchensu wants to merge 1 commit into
issue/1373from
feat/standalone-infinirt-moore-graph-bridge
Open

fix: lazy-load Moore Mate bindings#1440
gongchensu wants to merge 1 commit into
issue/1373from
feat/standalone-infinirt-moore-graph-bridge

Conversation

@gongchensu

@gongchensu gongchensu commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator

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

… to prevent SIGILL

Co-authored-by: zhushuang <zhushuang1110@gmail.com>
@spike-zhu
spike-zhu force-pushed the feat/standalone-infinirt-moore-graph-bridge branch from f5f7ffa to 552ce32 Compare July 30, 2026 07:14
@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

@spike-zhu
spike-zhu requested a review from voltjia July 30, 2026 07:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants