Skip to content

pt: make get_data non-blocking#3422

Merged
wanghan-iapcm merged 1 commit intodeepmodeling:develfrom
njzjz:avoid-blocking-to
Mar 8, 2024
Merged

pt: make get_data non-blocking#3422
wanghan-iapcm merged 1 commit intodeepmodeling:develfrom
njzjz:avoid-blocking-to

Conversation

@njzjz
Copy link
Copy Markdown
Member

@njzjz njzjz commented Mar 6, 2024

to(DEVICE) is cpu-blocking but to(DEVICE, non-blocking=True) is not blocking. This improves performance by at least 0.1s/100 steps.

Before, get_data is blocking:

1709698811097

1709698811150

After, get_data is not blocking:
1709698811122
1709698811169

The subsequent blocking is phys2inter (via torch.linalg.inv).

Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 6, 2024

Codecov Report

Attention: Patch coverage is 50.00000% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 76.95%. Comparing base (b0171ce) to head (f1e1ba6).
Report is 2 commits behind head on devel.

Files Patch % Lines
deepmd/pt/train/training.py 50.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##            devel    #3422   +/-   ##
=======================================
  Coverage   76.94%   76.95%           
=======================================
  Files         423      423           
  Lines       35878    35883    +5     
  Branches     1620     1620           
=======================================
+ Hits        27607    27612    +5     
  Misses       7403     7403           
  Partials      868      868           

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

@wanghan-iapcm wanghan-iapcm added this pull request to the merge queue Mar 8, 2024
Merged via the queue into deepmodeling:devel with commit 268591c Mar 8, 2024
@njzjz njzjz mentioned this pull request Apr 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants