Skip to content

Commit 966c7fa

Browse files
committed
doc
1 parent 255ac9b commit 966c7fa

3 files changed

Lines changed: 12 additions & 5 deletions

File tree

deepmd/pt/model/model/sezm_model.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2845,9 +2845,10 @@ def deserialize(cls, data: dict[str, Any]) -> SeZMModel:
28452845
def tf32_precision_ctx(self) -> Generator[None, None, None]:
28462846
"""Context manager to temporarily set TF32 matmul precision.
28472847
2848-
Training follows ``enable_tf32``. Eval/inference follows
2849-
``DP_TF32_INFER``: 0 keeps ``highest`` precision, 1 selects
2850-
``high``, and 2 selects ``medium``.
2848+
Training follows ``enable_tf32`` independently of whether the current
2849+
forward uses the compile path. Eval/inference follows ``DP_TF32_INFER``:
2850+
0 keeps ``highest`` precision, 1 selects ``high``, and 2 selects
2851+
``medium``.
28512852
"""
28522853
if not torch.cuda.is_available():
28532854
yield

deepmd/utils/argcheck.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3170,7 +3170,12 @@ def sezm_model_args() -> Argument:
31703170
"Requires torch==2.11. NVIDIA GPUs require CUDA >= 12.6. "
31713171
"Apple Silicon Macs are also supported. Tested with Python 3.13."
31723172
)
3173-
doc_enable_tf32 = "If True, enable TF32 matmul precision when use_compile=True."
3173+
doc_enable_tf32 = (
3174+
"If True, enable TF32 matmul precision for CUDA training forwards. "
3175+
"This training-time setting is independent of `use_compile`; eval-time "
3176+
"TF32 is controlled separately by `validating.tf32_infer` or "
3177+
"`DP_TF32_INFER`."
3178+
)
31743179
doc_bridging_method = (
31753180
"Short-range bridging method. Currently supports 'ZBL'. "
31763181
"The value is case-insensitive; set it to 'None' to disable bridging."

doc/model/dpa4.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,8 @@ During training validation, the input option
456456
`validating.tf32_infer: true` is translated into `DP_TF32_INFER=1` before
457457
model construction, again without overriding an explicitly exported
458458
environment variable. Training forwards are controlled separately by
459-
`model.enable_tf32`.
459+
`model.enable_tf32`, independently of whether `model.use_compile` selects the
460+
compiled or eager training path.
460461

461462
For molecular dynamics and other workflows that are sensitive to potential
462463
energy surface smoothness, keep `DP_TF32_INFER=0`. Enabling TF32 inference may

0 commit comments

Comments
 (0)