Skip to content

Reduce memory usage in QRF calibration - #2399

Merged
mo-AliceLake merged 5 commits into
masterfrom
alice/qrf-investigation
Jun 18, 2026
Merged

Reduce memory usage in QRF calibration#2399
mo-AliceLake merged 5 commits into
masterfrom
alice/qrf-investigation

Conversation

@mo-AliceLake

@mo-AliceLake mo-AliceLake commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

There is a need to reduce memory usage of QRF calibration scripts, to be able to run operationally.

This branch reduces memory requirements by removing unnecessary intermediate copies of DataFrames and iris cubes.

@mo-AliceLake mo-AliceLake changed the title Trying to reduce memory QRF memory reduction Jun 18, 2026
@mo-AliceLake mo-AliceLake changed the title QRF memory reduction Reduce memory usage in QRF calibration Jun 18, 2026
@mo-AliceLake
mo-AliceLake marked this pull request as ready for review June 18, 2026 10:41

@brhooper brhooper left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks @mo-AliceLake. This change should reduce memory requirements for the QRF steps (and SAMOS, though we don't actually use this operationally at the moment) by removing some unnecessary dataframe copying and removing objects from memory when they are no longer required.

The existing unit and acceptance tests pass with these changes.

I've made on small suggestion of an additional change we could make. I expect it will only facilitate a small additional memory reduction compared to your changes. I ran the tests with my suggested change included and they still pass.

Comment thread improver/calibration/load_and_apply_quantile_regression_random_forest.py Outdated
Comment thread improver/calibration/load_and_apply_quantile_regression_random_forest.py Outdated
mo-AliceLake and others added 3 commits June 18, 2026 13:17
…_forest.py

Co-authored-by: Ben Hooper <114418734+brhooper@users.noreply.github.com>
…_forest.py

Co-authored-by: Ben Hooper <114418734+brhooper@users.noreply.github.com>

@MoseleyS MoseleyS left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Output from FPOSTEST testing shows that memory use for a screen-temperature QRF apply task has reduced from ~50GB to ~18GB, which allows a larger number of threads to run on the same node. I don't have any evidence that the code also runs faster, but it certainly isn't slower.

@brhooper brhooper left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks @mo-AliceLake, I'm happy with this PR.

@mo-AliceLake
mo-AliceLake merged commit 114db87 into master Jun 18, 2026
12 of 13 checks passed
@MoseleyS
MoseleyS deleted the alice/qrf-investigation branch June 18, 2026 15:17
@MoseleyS

Copy link
Copy Markdown
Member

Output from FPOSTEST testing shows that memory use for a screen-temperature QRF apply task has reduced from ~50GB to ~18GB, which allows a larger number of threads to run on the same node. I don't have any evidence that the code also runs faster, but it certainly isn't slower.

Correction. The memory reduction was from 50GB to 37GB. Still great, but I'd slightly over-egged it due to a calculation error.

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.

3 participants