bug(pt-expt): compiled DPA2 lower miscompiles descriptors that depend on atype_ext

Đang mở
#5,953 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 3 ngày

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

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
45/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
python, pytorch

Hướng nghiên cứu

Bắt đầu từ deepmd/dpmodel/utils/env_mat.py và lần theo EnvMat.call đến đường dẫn pt_expt DPA2 lower và call_lower được torch.compile sử dụng. Tái hiện trường hợp descriptor phụ thuộc vào atype_ext và so sánh các lực đã biên dịch với đường dẫn eager/dense. Được coi là hoàn thành khi hành vi của lower được đặc trưng và được bao phủ bởi một regression test, hoặc khi ràng buộc độc lập với atype_ext được ghi lại bằng một assertion.

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

Mô tả

bug

Summary

Making a DPA2/DPA3 or shared descriptor path depend on atype_ext (e.g. by masking em/diff/sw with atype_ext >= 0 inside EnvMat.call) produces wrong forces when the model is run through the compiled pt_expt DPA2 lower.

Reproduction context

This was hit while developing deepmd/dpmodel/utils/env_mat.py for #5833 (commit 6d67a1257). The naive fix of re-masking the zeroed virtual-center outputs using atype_ext made the descriptor read atype_ext, and the pt_expt DPA2 compiled (torch.compile / graph-lowered call_lower) path returned incorrect forces; forces were correct in the eager/dense path. This is why #5833 chose to neutralize the davg/dstd normalization instead of re-masking, keeping EnvMat.call independent of atype_ext.

Impact / risk

  • A future developer who adds an atype_ext dependency to a descriptor for a reasonable reason could silently reintroduce wrong forces when a compiled DPA2 model happens to use that descriptor.
  • Nothing in CI currently pins this behavior; there is no regression test or assertion.

Suggested follow-ups

  • Characterize the pt_expt DPA2 lower miscompilation (which transformation of the atype_ext-dependent branch breaks) and add a regression test on the compiled lower.
  • At minimum, add a comment/assertion documenting that EnvMat.call must remain atype_ext-independent.

Related: #5833

Ngôn ngữ chính
Python
Star
2.1k
Fork
663
Merge trung bình
3 ngày 11 giờ
Pull request đã merge (30 ngày)
25

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

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

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 deepmodeling/deepmd-kit

Tất cả issue của deepmodeling/deepmd-kit

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.