百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
返回工具页/返回 Issues 列表
#49190·transformers

[急切的 MOE] 选择的专家 ID 最好不要被视为 0-d GPU 张量

作者: fxmarty-amd创建于 2026年9月29日更新于 2026年10月2日
标签bug
  • https://GitHub.com/huggingface/transformers/blob/e159fcef58f43aec5ce588a891c726572451974a/src/transformers/models/qwen3_moe/modeling_qwen3_moe.py#L236 creates aten::eq and aten::is_nonzero once per expert.
  • Repeated tensor-scalar indexing produces extra select and as_strided view operations (expert_mask[expert_idx], self.gate_up_proj[expert_idx], self.down_proj[expert_idx])
  • Each scalar materialization then creates both aten::item and aten::_local_scalar_dense.

It appears that using instead:

内容来源: huggingface/transformers

查看 GitHub 原文在 GitHub 查看讨论