deepmodeling / deepmodeling/deepmd-kit

fix(jax): honor training.stat_file for model statistics

Open
#5,870 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
2k
Forks
649
Avg merge
6d 18h
Merged PRs (30d)
15

Description

## Summary

JAX training carries `training.stat_file` through configuration, but the entrypoint currently invokes statistics computation/loading without passing the configured file path. The option is therefore accepted but appears to be ignored.

## Scope

- Resolve the configured statistics path consistently with the training working directory.
- Pass it into JAX model statistics loading/computation.
- Reuse existing statistics when compatible and write newly computed statistics safely.
- Validate model/type-map/descriptor compatibility before accepting a file.
- Define chief-only file I/O and synchronization for distributed training.
- Close HDF5/file resources on success and failure.

## Acceptance criteria

- A configured compatible statistics file is loaded instead of recomputing statistics.
- A missing target file is created at the configured location when writing is allowed.
- Incompatible or malformed files produce actionable errors.
- Only the designated rank performs mutable file I/O in distributed runs, and all ranks receive identical statistics.
- Tests cover load, create, incompatibility, and distributed ownership paths.

Refs #5756.

Coding agent: Codex
Codex version: codex-cli 0.144.4
Model: gpt-5.6-sol
Reasoning effort: xhigh

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.