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

FFCV support #1439

Merged
merged 24 commits into from Aug 1, 2023
Merged

Conversation

lrzpellegrini
Copy link
Collaborator

@lrzpellegrini lrzpellegrini commented Jun 29, 2023

Current status: barely working draft

How to enable the support for FFCV in Avalanche:

  • Install FFCV using the official guide (involves some specific conda packages)
  • Use the enable_ffcv function, as shown in the ffcv_enable.py script in examples.

Offers a very good speed when compared to the PyTorch loader especially on "big" benchmarks like TinyImagenet. Minor improvement with the CIFAR or MNIST datasets, where it's still good to offer the same performance for fewer workers.

A few benchmarks, such as CORe50 NICv2 are not properly supported as they are implemented as one leaf dataset per experience. Currently supported benchmarks are the ones for which one single dataset is split into multiple experiences (like the SplitMNIST, SplitCIFAR, ...). Better support for CORe will come in the next PRs.

@coveralls
Copy link

coveralls commented Jul 5, 2023

Pull Request Test Coverage Report for Build 5716867115

  • 500 of 806 (62.03%) changed or added relevant lines in 14 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage decreased (-0.2%) to 72.749%

Changes Missing Coverage Covered Lines Changed/Added Lines %
avalanche/training/templates/problem_type/supervised_problem.py 1 2 50.0%
avalanche/training/templates/base_sgd.py 5 7 71.43%
avalanche/training/plugins/replay.py 5 8 62.5%
tests/unit_tests_utils.py 72 75 96.0%
avalanche/benchmarks/utils/data_loader.py 25 32 78.13%
tests/test_transformations.py 155 163 95.09%
avalanche/benchmarks/utils/transforms.py 51 70 72.86%
avalanche/benchmarks/utils/dataset_traversal_utils.py 103 136 75.74%
tests/benchmarks/ffcv/test_ffcv_support.py 19 64 29.69%
avalanche/benchmarks/utils/ffcv_support/ffcv_components.py 58 243 23.87%
Files with Coverage Reduction New Missed Lines %
avalanche/benchmarks/utils/transforms.py 1 79.01%
Totals Coverage Status
Change from base Build 5693163363: -0.2%
Covered Lines: 17379
Relevant Lines: 23889

💛 - Coveralls

@lrzpellegrini
Copy link
Collaborator Author

Updated PR description, added examples, added a unit test, and removed the remaining workarounds.

I think the PR is ready!

@lrzpellegrini lrzpellegrini marked this pull request as ready for review July 12, 2023 15:23
Copy link
Collaborator

@AntonioCarta AntonioCarta left a comment

Choose a reason for hiding this comment

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

Hi Lorenzo, I did a more thorough review of the PR. It's mostly about missing docstrings.

Looking at the changes, I fell even more strongly that we should try to move the dataloader creation outside. In your PR you had to add custom code wherever we created dataloaders. This is quite difficult to track (in fact, we have some plugins that make their own dataloaders).

Apart from the minor changes requested in the comments I think the PR can be accepted as is

avalanche/training/supervised/ar1.py Outdated Show resolved Hide resolved
examples/ffcv_enable.py Outdated Show resolved Hide resolved
tests/test_transformations.py Show resolved Hide resolved
@AntonioCarta
Copy link
Collaborator

Let me know when I can merge this.

@lrzpellegrini
Copy link
Collaborator Author

It can be merged now!

@AntonioCarta AntonioCarta merged commit 20f896f into ContinualAI:master Aug 1, 2023
18 checks passed
@lrzpellegrini lrzpellegrini deleted the ffcv_support_pt2 branch August 1, 2023 13:00
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.

None yet

3 participants