fix(tf): handle multiframe DeepSpin extension#5851
Open
njzjz-bot wants to merge 1 commit into
Open
Conversation
Build TensorFlow DeepSpin virtual-atom coordinates for every frame and use explicit frame strides when copying physical, magnetic, and atomic outputs back from extended buffers. Derive atomic-energy frame width from the TensorFlow output so physical-only energies do not interleave frames in the extended atom layout. Coding-Agent: Codex Codex-Version: codex-cli 0.144.4 Model: gpt-5.6-sol Reasoning-Effort: xhigh
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #5851 +/- ##
==========================================
- Coverage 78.58% 70.33% -8.25%
==========================================
Files 1050 1024 -26
Lines 120637 114250 -6387
Branches 4356 3535 -821
==========================================
- Hits 94801 80357 -14444
- Misses 24278 33088 +8810
+ Partials 1558 805 -753 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Member
|
Possible reviewers based on changed lines, exact file history, and exact-file review history:
No review request was made automatically. Coding agent: Codex |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #5660.
Summary
aparamstrides during NULL-atom selectiondoubleandfloatWhy existing tests missed this
All TensorFlow DeepSpin C++ tests used scalar-energy, single-frame calls. The extension helpers therefore only needed frame-zero buffers, and frame-zero copyback filled every asserted output. No test exercised the documented vector-energy overload with
nframes > 1, so undersized extension buffers, incorrect inferred frame counts, and missing output frame offsets remained invisible.The new tests perturb both coordinates and spins in frame 2, evaluate each frame separately, and compare every batched slice against its one-frame reference. They also assert the frame references differ, preventing duplicated-frame behavior from passing.
Validation
ruff format .ruff check .clang-format --dry-run --Werroron all changed C++ filesdeepmd_op,deepmd_backend_tf, andrunUnitTests_ccTestInferDeepSpinandTestInferDeepSpinNopbctyped tests passedCoding agent: Codex
Codex version: codex-cli 0.144.4
Model: gpt-5.6-sol
Reasoning effort: xhigh