Skip to content

fix: try fix dpa4 compile#5483

Draft
anyangml wants to merge 8 commits into
deepmodeling:masterfrom
anyangml:fix/dpa4-multitask-compile
Draft

fix: try fix dpa4 compile#5483
anyangml wants to merge 8 commits into
deepmodeling:masterfrom
anyangml:fix/dpa4-multitask-compile

Conversation

@anyangml
Copy link
Copy Markdown
Collaborator

@anyangml anyangml commented Jun 1, 2026

No description provided.

Copilot AI review requested due to automatic review settings June 1, 2026 08:43
@anyangml anyangml marked this pull request as draft June 1, 2026 08:43
@dosubot dosubot Bot added the bug label Jun 1, 2026
@github-actions github-actions Bot added the Python label Jun 1, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jun 1, 2026

Review Change Stack

Caution

Review failed

The head commit changed during the review from 4602960 to c0565b8.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

val = getattr(fitting, aname, None)
if val is not None and torch.is_tensor(val):
names.append(_FIT_ATTR_PREFIX + aname)
except AttributeError:
names.append(_FIT_ATTR_PREFIX + aname)
except AttributeError:
pass
except AttributeError:
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR attempts to improve/repair the PyTorch-compiled execution path for the SeZM/DPA4 model, primarily by reducing recompiles/OOM in multi-task setups and addressing symbolic-shape tracing issues in make_fx.

Changes:

  • Add module-level compile sharing and promote selected per-task buffers (e.g., out_bias, bias_atom_e, case_embd) as FX inputs to enable compiled-graph reuse across shared-parameter tasks.
  • Add additional symbolic-shape anti-aliasing logic for trace inputs and temporarily disable ShapeEnv duck sizing during tracing.
  • Change edge-list construction to append a single masked dummy edge (instead of two) and adjust related documentation/behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread deepmd/pt/model/model/sezm_model.py
Comment on lines 2181 to 2184
aparam: torch.Tensor | None = None,
charge_spin: torch.Tensor | None = None,
*,
do_atomic_virial: bool = False,
charge_spin: torch.Tensor | None = None,
) -> torch.nn.Module:
Comment thread deepmd/pt/model/model/sezm_model.py Outdated
Comment on lines +2390 to 2394
# === Step 3. Compact edges + append one masked dummy ===
# NOTE: Always append exactly one masked dummy edge.
# ``torch.nonzero(edge_mask_actual)`` produces a data-dependent
# number of valid edges, which can be zero on sparse or
# single-type systems. make_fx cannot trace an
@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 1, 2026

Codecov Report

❌ Patch coverage is 86.62420% with 21 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.34%. Comparing base (967e525) to head (0e5500b).
⚠️ Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
deepmd/pt/model/model/sezm_model.py 86.62% 21 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5483      +/-   ##
==========================================
- Coverage   81.34%   81.34%   -0.01%     
==========================================
  Files         868      868              
  Lines       96373    96583     +210     
  Branches     4233     4233              
==========================================
+ Hits        78399    78569     +170     
- Misses      16675    16715      +40     
  Partials     1299     1299              

☔ View full report in Codecov by Sentry.
📢 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants