sbi icon indicating copy to clipboard operation
sbi copied to clipboard

1380 pytorch 260

Open manuelgloeckler opened this issue 11 months ago • 2 comments

There are some unusual issues with Pyright in the new version of PyTorch, 2.6.0. Specifically:

  • Any buffers or parameters no longer support mathematical operations according to Pyright which is wrong.
  • There are multiple Pyright errors related to modules and tensors that shouldn't be happening.

I have used "type: ignore" to bypass these issues. Probably we should add comments at each ignore that it is due to PyTorch 2.6.0. (Assuming Pyright will fix this at some point)

manuelgloeckler avatar Jan 30 '25 16:01 manuelgloeckler

Codecov Report

Attention: Patch coverage is 42.10526% with 11 lines in your changes missing coverage. Please review.

Project coverage is 78.45%. Comparing base (6d527f7) to head (de8f9c8). Report is 18 commits behind head on main.

Files with missing lines Patch % Lines
sbi/inference/trainers/npe/npe_a.py 28.57% 5 Missing :warning:
sbi/inference/trainers/npe/npe_c.py 0.00% 3 Missing :warning:
sbi/inference/abc/smcabc.py 0.00% 2 Missing :warning:
sbi/neural_nets/estimators/nflows_flow.py 0.00% 1 Missing :warning:

:x: Your patch check has failed because the patch coverage (42.10%) is below the target coverage (50.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@             Coverage Diff             @@
##             main    #1382       +/-   ##
===========================================
- Coverage   89.31%   78.45%   -10.87%     
===========================================
  Files         119      119               
  Lines        8779     8786        +7     
===========================================
- Hits         7841     6893      -948     
- Misses        938     1893      +955     
Flag Coverage Δ
unittests 78.45% <42.10%> (-10.87%) :arrow_down:

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

Files with missing lines Coverage Δ
...i/neural_nets/estimators/flowmatching_estimator.py 93.10% <100.00%> (ø)
sbi/neural_nets/estimators/score_estimator.py 92.89% <100.00%> (ø)
sbi/neural_nets/net_builders/score_nets.py 95.23% <100.00%> (+0.04%) :arrow_up:
sbi/neural_nets/estimators/nflows_flow.py 63.46% <0.00%> (ø)
sbi/inference/abc/smcabc.py 12.34% <0.00%> (-70.07%) :arrow_down:
sbi/inference/trainers/npe/npe_c.py 73.15% <0.00%> (-21.48%) :arrow_down:
sbi/inference/trainers/npe/npe_a.py 63.91% <28.57%> (-27.40%) :arrow_down:

... and 31 files with indirect coverage changes

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

codecov[bot] avatar Jan 30 '25 16:01 codecov[bot]

Unfortunately, pyright errors persists on new pyright versions with torch 2.6.0 :(

manuelgloeckler avatar Mar 13 '25 15:03 manuelgloeckler

@manuelgloeckler how has this been resolved? Is it fixed in the new PyTorch release?

janfb avatar Aug 14 '25 05:08 janfb