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

Support for lazily created streams #671

Merged
merged 5 commits into from
Jun 18, 2021

Conversation

lrzpellegrini
Copy link
Collaborator

@lrzpellegrini lrzpellegrini commented Jun 17, 2021

This PR introduces the support for lazy streams (discussed in #600)

This PR introduces some changes on the internals of GenericCLScenario and adds proper helpers to support the creation of streams based on generator expressions or functions.

This also introduces the support for dropping the references to previous experiences to allow for a more fine-grained memory management (to be documented).

Beware that the helper used to create data incremental benchmarks and the helper used to create a validation stream will still work in non-lazy mode (will load all experiences at once). This behavior will be fixed in the future.

The behavior for non-lazy benchmarks will not be affected by these changes.

@coveralls
Copy link

Pull Request Test Coverage Report for Build 947677077

  • 391 of 417 (93.76%) changed or added relevant lines in 7 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.6%) to 78.99%

Changes Missing Coverage Covered Lines Changed/Added Lines %
avalanche/benchmarks/scenarios/generic_cl_scenario.py 53 59 89.83%
avalanche/benchmarks/scenarios/generic_benchmark_creation.py 25 33 75.76%
avalanche/benchmarks/scenarios/lazy_dataset_sequence.py 50 62 80.65%
Totals Coverage Status
Change from base Build 942071966: 0.6%
Covered Lines: 9429
Relevant Lines: 11937

💛 - Coveralls

@vlomonaco
Copy link
Member

Hi @lrzpellegrini this is awesome, thanks! We are looking forward to see this integrated in the benchmark generators (and manipulators). Do you thing this could be done with a simple flag? Also, what's the disadvantage of making the whole system lazy?

@lrzpellegrini
Copy link
Collaborator Author

For the moment there are no disadvantages in supporting lazy streams. However, for the vast majority of helpers adding a lazy option won't help in reducing times. The helpers that can benefit the most from a lazy approach are the ones that load the whole dataset in memory, but we currently don't have any of those. In the future, we may want to implement a path-based tensor dataset, in which case the laziness may help a lot.

@lrzpellegrini lrzpellegrini merged commit 176f31a into ContinualAI:master Jun 18, 2021
@lrzpellegrini lrzpellegrini deleted the issue_600 branch June 18, 2021 13:45
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