Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

TransformerLayer implementation is overly complex and difficult to follow

未关闭
#2,903 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 2 天内回复

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
30/100
Issue 类型
重构
描述清晰度
需要澄清
活跃度
冷清
技术栈
python, pytorch

调研方向

先阅读第 70 行附近的 transformer_engine/pytorch/transformer.py,然后将其单个 TransformerLayer 设计与链接的 Hugging Face 模型布局进行比较。该 issue 未定义具体的拆分方式、验收标准或测试,因此需要在实现之前就所需的重构和 definition of done 达成一致。

由索引模型根据 Issue 内容生成。

描述

question

https://github.com/NVIDIA/TransformerEngine/blob/5aa4823dcc4942cadc2862adebef917758b6dc05/transformer_engine/pytorch/transformer.py#L70

I understand that you want to implement a single TransformerLayer class to support various model architectures.

However, this design leads to an issue: the code inside the TransformerLayer class has become overly complex, with too many parameters and a large number of if-else statements. For beginners, it is really difficult to figure out how to configure the parameters to fit their own model structures.

I'm curious why you didn't design it like the Hugging Face Transformers framework, where one model corresponds to one file:
https://github.com/huggingface/transformers/tree/main/src/transformers/models

This kind of design is much more user-friendly, because users only need to focus on the code they care about.

主要语言
Python
星标
3.6k
派生
844
平均合并
4 天 55 分钟
30 天内合并 PR
51

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

NVIDIA/TransformerEngine 的其他 Issue

查看 NVIDIA/TransformerEngine 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。