Skip to content

feat: enable MACE pt_expt torch.compile training#134

Merged
njzjz merged 3 commits into
masterfrom
torch-compile-mace-pt-expt
Jun 22, 2026
Merged

feat: enable MACE pt_expt torch.compile training#134
njzjz merged 3 commits into
masterfrom
torch-compile-mace-pt-expt

Conversation

@njzjz

@njzjz njzjz commented Jun 22, 2026

Copy link
Copy Markdown
Member

Summary:

  • add MACE compatibility for DeePMD-kit pt_expt lazy torch.compile tracing
  • use the exportable dense-edge/raw-MACE path during make_fx tracing while sharing the original trainable parameters
  • document training.enable_compile usage and default-config steady-state benchmark results

Benchmark:

  • command path: srun --gres=gpu:1 dp --pt-expt train input.json
  • input: water example data with sel=auto, hidden_irreps="128x0e + 128x1o", batch_size=1, disp_freq=100; 2000 steps were used only to sample stable per-step timings
  • eager steady-state after step 200: 0.2030 s/step
  • torch.compile steady-state after step 200: 0.1495 s/step
  • steady-state speedup: about 1.36x
  • first compiled step included a one-time Inductor trace/compile cost of 97.17 s, amortized over long training runs

Tests:

  • ruff check deepmd_gnn/mace.py
  • pytest -q tests/test_pt_expt.py
  • git diff --check
  • pre-commit hooks on commit, including mdformat

@njzjz njzjz changed the title Enable MACE pt_expt torch.compile training feat: enable MACE pt_expt torch.compile training Jun 22, 2026
@codecov

codecov Bot commented Jun 22, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 22.05882% with 53 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.97%. Comparing base (33be5a2) to head (ff22c86).

Files with missing lines Patch % Lines
deepmd_gnn/mace.py 22.05% 53 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #134      +/-   ##
==========================================
- Coverage   83.85%   80.97%   -2.88%     
==========================================
  Files          12       12              
  Lines        1406     1472      +66     
==========================================
+ Hits         1179     1192      +13     
- Misses        227      280      +53     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@njzjz njzjz enabled auto-merge June 22, 2026 15:07
@njzjz njzjz added this pull request to the merge queue Jun 22, 2026
Merged via the queue into master with commit d431f51 Jun 22, 2026
14 of 16 checks passed
@njzjz njzjz deleted the torch-compile-mace-pt-expt branch June 22, 2026 15:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant