Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved Efficiency of the DiskUsage Metric #1647

Merged
merged 2 commits into from
May 28, 2024

Conversation

vlomonaco
Copy link
Member

Hello,

This PR speeds up the DiskUsage metric.

It turns out that if you have a lot of dirs/files in the current directory (the default target for the size inspection) especially the eval mode with disk_usage_metrics(stream=True) becomes super slow (the metric is computed every mini-batch).

In my case it takes about 4 seconds for every inspection. I use the "du" command (it improves the timing of about 4x) if you are on Linux adding a warning in case the metric compute time exceeds 0.5 seconds.

Let me know if you think I should change anything.

@vlomonaco vlomonaco requested a review from AntonioCarta May 28, 2024 11:45
@coveralls
Copy link

Pull Request Test Coverage Report for Build 9268694310

Details

  • 18 of 30 (60.0%) changed or added relevant lines in 2 files are covered.
  • 2 unchanged lines in 2 files lost coverage.
  • Overall coverage decreased (-0.004%) to 51.799%

Changes Missing Coverage Covered Lines Changed/Added Lines %
tests/evaluation/test_disk_usage.py 6 9 66.67%
avalanche/evaluation/metrics/disk_usage.py 12 21 57.14%
Files with Coverage Reduction New Missed Lines %
avalanche/benchmarks/datasets/cub200/cub200.py 1 27.55%
avalanche/benchmarks/classic/ex_model.py 1 31.13%
Totals Coverage Status
Change from base Build 9204029670: -0.004%
Covered Lines: 15091
Relevant Lines: 29134

💛 - Coveralls

@AntonioCarta AntonioCarta merged commit 9df4621 into ContinualAI:master May 28, 2024
12 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.

3 participants