Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

[BUG] PT-expt se_e2_a type_one_side=False fails symbolic tracing in compiled training

オープン
#6,017 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 4 日以内に返信

@stanleys12 がすでに取り組んでいます。

2026年10月12日 から。

  • #6073 @stanleys12 による — オープン

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
68/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
python, pytorch

調査の方向性

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
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/master 28b7d068801716765ab8119257f814596e49a10c. 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, PyTorch 2.13.0+cu130, CUDA runtime 13.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=False succeeds.
  • Compiled single-task and multi-task training with type_one_side=True succeeds in the same environment.
  • Disabling disp_avg does 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

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

deepmodeling/deepmd-kit のほかの issue

deepmodeling/deepmd-kit の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。