Skip to content

Fix #197: [Feature Request] add task.unload() function to free up memory - #391

Merged
liuxiaotong15 merged 3 commits into
mainfrom
autofix/issue-197
Nov 10, 2026
Merged

liuxiaotong15 merged 3 commits into
mainfrom
autofix/issue-197

Conversation

@claude

@claude claude Bot commented Oct 24, 2026

Copy link
Copy Markdown
Contributor

Add MatbenchTask.unload() to free the dataset from memory and keep recorded results.

  • unload() sets task.df = None, then runs gc.collect().
  • If the task is not loaded, it does nothing.
  • Added test: test_unload in matbench/tests/test_task.py.
Reviewer checks
  • Only adds a method. Results, scores and defaults do not change.
  • record() still needs the dataset. Load it again before recording more folds.
  • No MatbenchBenchmark.unload(). Add one in a later PR if you want it.
  • The issue's other question (other large objects to delete) is not handled here.

Fixes #197

@claude

claude Bot commented Oct 24, 2026

Copy link
Copy Markdown
Contributor Author

CI test (3.9) fails, so this can't merge yet.

@liuxiaotong15 liuxiaotong15 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM. All checks pass.

@liuxiaotong15
liuxiaotong15 merged commit 73706c8 into main Nov 10, 2026
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.

[Feature Request] add task.unload() function to free up memory

1 participant