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

add offset header ahead read for chunks #501

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

bhimrazy
Copy link
Collaborator

@bhimrazy bhimrazy commented Mar 7, 2025

Before submitting
  • Was this discussed/agreed via a Github issue? (no need for typos and docs improvements)
  • Did you read the contributor guideline, Pull Request section?
  • Did you make sure to update the docs?
  • Did you write any new necessary tests?

What does this PR do?

Add offset header ahead loading for chunks in PyTreeLoader

Some test metrics:

Note: These were generated locally on a certain set of random fake data
image

image
image

PR review

Anyone in the community is free to review the PR once the tests have passed.
If we didn't discuss your PR in GitHub issues there's a high chance it will not be merged.

Did you have fun?

Make sure you had fun coding 🙃

@bhimrazy bhimrazy self-assigned this Mar 7, 2025
Copy link

codecov bot commented Mar 7, 2025

Codecov Report

Attention: Patch coverage is 95.45455% with 1 line in your changes missing coverage. Please review.

Project coverage is 79%. Comparing base (ba4e981) to head (75963b2).

Additional details and impacted files
@@         Coverage Diff         @@
##           main   #501   +/-   ##
===================================
  Coverage    79%    79%           
===================================
  Files        38     38           
  Lines      5659   5679   +20     
===================================
+ Hits       4483   4502   +19     
- Misses     1176   1177    +1     
🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Collaborator

@tchaton tchaton left a comment

Choose a reason for hiding this comment

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

Mind adding the benchmark to the description of the PR ?

@bhimrazy bhimrazy added the enhancement New feature or request label Mar 7, 2025
@tchaton tchaton marked this pull request as ready for review March 8, 2025 18:49
@bhimrazy
Copy link
Collaborator Author

bhimrazy commented Mar 8, 2025

After benchmarking on ImageNet(resized 13GB), this PR's changes (header ahead read approach) do not seem to make any significant difference on a large dataset.

image

@bhimrazy
Copy link
Collaborator Author

bhimrazy commented Mar 9, 2025

Benchmark results on Imagenet (137GB)

Original v0.2.41
image

PR 501
image

image

@tchaton
Copy link
Collaborator

tchaton commented Mar 9, 2025

@bhimrazy So it doesn't seem very significant for larger dataset where more time is allocated to data transformation but it might be smaller ones with lower data transformation ?

@bhimrazy
Copy link
Collaborator Author

@bhimrazy So it doesn't seem very significant for larger dataset where more time is allocated to data transformation but it might be smaller ones with lower data transformation ?

Maybe but I think it would be good to test on tiny imagenet too and also check the profiling.

@bhimrazy bhimrazy marked this pull request as draft March 11, 2025 05:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants