Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

TransformerLayer implementation is overly complex and difficult to follow

Đang mở
#2,903 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 2 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
30/100
Loại issue
Tái cấu trúc
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Ít trao đổi
Công nghệ
python, pytorch
Lĩnh vực
machine-learning

Hướng nghiên cứu

Bắt đầu bằng cách đọc transformer_engine/pytorch/transformer.py quanh dòng 70, sau đó so sánh thiết kế chỉ có một TransformerLayer của nó với cấu trúc model Hugging Face được liên kết. Issue này không xác định cách phân rã cụ thể, tiêu chí nghiệm thu hay các bài kiểm thử, vì vậy cần thống nhất về refactor mong muốn và definition of done trước khi triển khai.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
Python
Star
3.6k
Fork
862
Merge trung bình
4 ngày 15 giờ
Pull request đã merge (30 ngày)
58

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của NVIDIA/TransformerEngine

Tất cả issue của NVIDIA/TransformerEngine

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.