ImperialCollegeLondon / pyrealm

Development of the pyrealm package, providing an integrated toolbox for modelling plant productivity, growth and demography using Python.
https://pyrealm.readthedocs.io/
MIT License
16 stars 6 forks source link

Scaling profiling datasets #216

Closed davidorme closed 2 months ago

davidorme commented 3 months ago

Description

This PR restructures the profiling code to do a number of things:

These changes make the profiling more flexible and helps set up for looking at the scaling of functions with input sizes. It allows commands like the following:

# Look at the peak memory usage,  run all the profiling tests, using an 8 fold scaling of the inputs
/usr/bin/time -l pytest -m "profiling" --pmodel-profile-scaleup 8
# Look at the peak memory usage,  running the splash profile, with an 100 fold scaling of the inputs
/usr/bin/time -l pytest -m "profiling" tests/profiling/test_profiling_splash.py --splash-profile-scaleup 100

The peak memory size of running the full test set is basically the combined size of each test and is very roughly:

50Mb splash-profile-scaleup + 1Gb pmodel-profile-scaleup

The defaults --splash-profile-scaleup=125 and --pmodel-profile-scaleup=6 should give about a 6GB size for each dataset. If we could use a single dataset, we'd be able to use bigger loads....

Fixes #215

Type of change

Key checklist

Further checks

codecov-commenter commented 3 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 95.23%. Comparing base (5b50cb4) to head (77c7fae).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## develop #216 +/- ## ======================================== Coverage 95.23% 95.23% ======================================== Files 28 28 Lines 1701 1701 ======================================== Hits 1620 1620 Misses 81 81 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

davidorme commented 2 months ago

@tztsai - Thanks for the comments. I've looked into them and think they're all 'resolved' for this PR. If you're happy, can you approve the PR?

tztsai commented 2 months ago

LGTM