Skip to content

Gpu test for VectorFieldPosterior#1542

Merged
janfb merged 4 commits intosbi-dev:mainfrom
jorobledo:gpu_test
Mar 28, 2025
Merged

Gpu test for VectorFieldPosterior#1542
janfb merged 4 commits intosbi-dev:mainfrom
jorobledo:gpu_test

Conversation

@jorobledo
Copy link
Collaborator

Following PR #1527 and issue #1530 , improved the test for vector field methods.

  • Added testing for training and/or sampling on device. Cross test for cpu-gpu are handled by setting two devices.
  • Removed testing both on FMPE and NPSE since they are redundant (both share log_prob implementation).
  • Fixed minor bug on time tensor in _loss function not being on the same device when moving to device the training.
  • Added docstrings for GPU tests.

This one is small! Let me know if anything is missing or you think that it can be improved @StarostinV @janfb

@jorobledo jorobledo requested a review from janfb March 27, 2025 19:15
@codecov
Copy link

codecov bot commented Mar 27, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 78.94%. Comparing base (8900ca0) to head (d46cfbe).
Report is 9 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff             @@
##             main    #1542       +/-   ##
===========================================
- Coverage   89.45%   78.94%   -10.52%     
===========================================
  Files         128      133        +5     
  Lines       10170    10370      +200     
===========================================
- Hits         9098     8187      -911     
- Misses       1072     2183     +1111     
Flag Coverage Δ
unittests 78.94% <100.00%> (-10.52%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
.../inference/trainers/npse/vector_field_inference.py 95.48% <100.00%> (ø)

... and 37 files with indirect coverage changes

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

Copy link
Contributor

@janfb janfb left a comment

Choose a reason for hiding this comment

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

Looks good, thanks @jorobledo !

added a couple of small suggestions / typo fixes.

jorobledo and others added 2 commits March 28, 2025 11:12
Co-authored-by: Jan <janfb@users.noreply.github.com>
@jorobledo jorobledo requested a review from janfb March 28, 2025 13:10
@janfb
Copy link
Contributor

janfb commented Mar 28, 2025

thanks @jorobledo , looks perfect now! 🎉

@janfb janfb merged commit 2db5860 into sbi-dev:main Mar 28, 2025
8 checks passed
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.

2 participants