[BUG] PT-expt se_e2_a type_one_side=False fails symbolic tracing in compiled training
メンテナーはふだん 4 日以内に返信
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 68/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
調査の方向性
deepmd/dpmodel/descriptor/se_e2_a.py の596行目付近と、_trace_and_compile のある deepmd/pt_expt/train/training.py から始め、公開されている水の例を使って、提供された reproduce_se_a_compile.py コマンドを実行します。シンボリックトレース中に両側の記述子がどのように扱われるかを追跡し、enable_compile=True を指定した type_one_side=False のカバレッジを追加します。完了条件は、データ依存の整数エラーなしにコンパイル済みトレーニングが完了することです。
索引モデルが issue の本文から書いたものです。
説明
Bug summary
PT-expt compiled training fails for se_e2_a with type_one_side=False while tracing the first model forward. The two-sided implementation computes atom-type-dependent slice boundaries by converting a tensor reduction to a Python integer; symbolic tracing cannot concretize that value.
The failure reproduces with disp_avg=False and occurs before display-metric accumulation. It was found during extra validation for #5809, not as a failure of an existing CI unit test.
DeePMD-kit version and environment
- Source checkout:
67837d7ff8b971f1503b8b8d7efcf210d91688c4, based on upstream/master28b7d068801716765ab8119257f814596e49a10c. The failing descriptor code is unchanged from that upstream commit. - Editable CUDA installation built from source; installed version metadata:
3.2.1.dev13+g5580ebd3f.d20260911. - Backend: PyTorch Exportable (
pt_expt). - Python
3.13.15, PyTorch2.13.0+cu130, CUDA runtime13.0. - GPU: NVIDIA RTX PRO 6000 Blackwell.
Steps to reproduce
Run from the repository root in an installed DeePMD-kit environment. The script uses only the repository's public water example and writes training output in a temporary directory.
CUDA_VISIBLE_DEVICES=0 NUM_WORKERS=0 python reproduce_se_a_compile.py
reproduce_se_a_compile.py:
"""Reproduce the two-sided SeA symbolic tracing failure from a public example."""
import json
import os
import tempfile
from pathlib import Path
from deepmd.pt_expt.entrypoints.main import get_trainer
from deepmd.utils.argcheck import normalize
from deepmd.utils.compat import update_deepmd_input
repo = Path.cwd()
config = json.loads((repo / "examples/water/se_e2_a/input_torch.json").read_text())
config["model"]["descriptor"].update(
type_one_side=False, sel=[4, 8], neuron=[4, 8], axis_neuron=4,
rcut=3.0, rcut_smth=0.5,
)
config["model"]["fitting_net"]["neuron"] = [8]
config["model"]["data_stat_nbatch"] = 1
config["training"]["training_data"] = {
"systems": [str(repo / "examples/water/data/data_0")],
"batch_size": 1,
}
config["training"].pop("validation_data", None)
config["training"].update(numb_steps=1, enable_compile=True, disp_avg=False)
config = normalize(update_deepmd_input(config, warning=False))
with tempfile.TemporaryDirectory(prefix="deepmd-se-a-compile-") as work:
os.chdir(work)
get_trainer(config).run()
This exact self-contained reproducer was run and reaches the error below.
Observed error
deepmd/pt_expt/train/training.py: _trace_and_compile -> make_fx
deepmd/dpmodel/descriptor/se_e2_a.py:596
offset += int(xp.sum(xp.astype(atype_loc == ti, xp.int32)))
torch.fx.experimental.symbolic_shapes.GuardOnDataDependentSymNode:
Could not extract specialized integer from data-dependent expression u0
(unhinted: u0). (Size-like symbols: none)
The count depends on the values of atype_loc, not merely its shape. The subsequent slice boundaries therefore require a data-dependent Python integer during symbolic tracing.
Expected behavior and controls
- Compiled training should handle the two-sided descriptor without extracting these tensor values into Python integers.
- Eager training with
type_one_side=Falsesucceeds. - Compiled single-task and multi-task training with
type_one_side=Truesucceeds in the same environment. - Disabling
disp_avgdoes not change the failure.
The ordinary descriptor-consistency suite includes type_one_side=False, but the checked PT-expt compiled-training fixtures use type_one_side=True. A regression for type_one_side=False together with enable_compile=True is needed. The failing combination has not yet been retested on the CI-pinned PyTorch versions; this report establishes the behavior on the environment above.
- 主要言語
- Python
- スター
- 2.1k
- フォーク
- 661
- 平均マージ
- 5日 13時間
- マージ済み PR(30日)
- 11
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
deepmodeling/deepmd-kit のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 73/100
deepmodeling/deepmd-kit#6086 ·
メンテナーはふだん 4 日以内に返信
-
Fine-tune descriptor mismatch warning should ignore seed対応中かも @SiyuanChenToDo が 6 日前に担当しました。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
deepmodeling/deepmd-kit#6038 · コメント 2 件 ·
メンテナーはふだん 4 日以内に返信
-
Docs enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
deepmodeling/deepmd-kit#5766 · コメント 1 件 ·
メンテナーはふだん 4 日以内に返信
-
[Code scan] Freeze Paddle DPA3 parameters with stop_gradient対応中かも @njzjz が 103 日前に担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
deepmodeling/deepmd-kit#5686 · コメント 1 件 ·
メンテナーはふだん 4 日以内に返信
-
branch: master lang: py todo comment type: todo
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
deepmodeling/deepmd-kit#5480 ·
メンテナーはふだん 4 日以内に返信
deepmodeling/deepmd-kit の issue をすべて見る
似ている issue
-
The changelog workflow excludes otelbot but not dependabot, so every Dependabot pull request fails the changelog check対応中かも @ocelotl が今日担当しました。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 82/100
open-telemetry/opentelemetry-python#5825 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
cuga-project/cuga-agent#1020 ·
メンテナーはふだん 2 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 70/100
microsoft/playwright#43640 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
stac-utils/stac-fastapi-elasticsearch-opensearch#965 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
メンテナーはふだん 1 日以内に返信