CosmiQ / solaris

CosmiQ Works Geospatial Machine Learning Analysis Toolkit
https://solaris.readthedocs.io
Apache License 2.0
413 stars 112 forks source link

Fixed (Iss #414): `Inferer` now uses `torch.no_grad()` correctly #415

Closed imadtoubal closed 2 years ago

imadtoubal commented 3 years ago

Description

Inferer.__call__() function in solaris/nets/infer.py does not properly use torch.no_grad(). PyTorch is effectively computing gradient for the inference process, thus, using significantly more GPU memory.

Fixes #414

Type of change

Please delete options that are not relevant.

How Has This Been Tested?

Please describe tests that you added to the pytest codebase (if applicable).

Checklist:

If your PR does not fulfill all of the requirements in the checklist above, that's OK! Just prepend [WIP] to the PR title until they are all satisfied. If you need help, @-mention a maintainer and/or add the Status: Help Needed label.

codecov[bot] commented 3 years ago

Codecov Report

Merging #415 (180627a) into master (07a22d4) will decrease coverage by 0.16%. The diff coverage is 5.26%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #415      +/-   ##
==========================================
- Coverage   55.37%   55.21%   -0.17%     
==========================================
  Files          82       82              
  Lines        7135     7158      +23     
==========================================
+ Hits         3951     3952       +1     
- Misses       3184     3206      +22     
Impacted Files Coverage Δ
solaris/nets/infer.py 21.87% <0.00%> (+0.33%) :arrow_up:
solaris/eval/scot.py 4.65% <7.14%> (+0.59%) :arrow_up:
solaris/nets/transform.py 62.09% <0.00%> (-0.81%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 07a22d4...180627a. Read the comment docs.

rbavery commented 2 years ago

closing since this relates to pytorch and this library no longer covers training or inference related functionality https://github.com/CosmiQ/solaris/blob/32236217bd913fbb238e19f2f8420e5794fd8136/ROADMAP.md