generated from amazon-archives/__template_Apache-2.0
-
Notifications
You must be signed in to change notification settings - Fork 13
Speed up past/future split #83
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2e7ae75 to
854fe10
Compare
abdulfatir
approved these changes
Jan 9, 2026
| """ | ||
| # Flatten indices if dataset has been sorted/filtered, so row order in dataset | ||
| # matches the physical order in the underlying Arrow table | ||
| if getattr(dataset, "_indices", None) is not None: |
Collaborator
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Has this property been fairly standard for a while?
| cutoff_scalar = pc.cast(pa.scalar(cutoff), timestamps_flat.type) | ||
| mask = pc.less_equal(timestamps_flat, cutoff_scalar) | ||
| cumsum = np.concatenate([[0], np.cumsum(mask.to_numpy(zero_copy_only=False))]) | ||
| return cumsum[offsets[1:]] - cumsum[offsets[:-1]] |
Collaborator
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just thinking out loud: will this work also when all timestamps are less than cutoff?
This was referenced Jan 14, 2026
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue #, if available:
Currently the operations based on
Dataset.filterandDataset.mapare quite slow. Just running the following code takes ~20 minutes and generates 10+GB of intermediate files in~/.cache/huggingface/datasetsThese are not the only bottlenecks - there are also slow map-based operations in the metrics that I will address in a separate PR.
Description of changes:
fev-benchtakes ~4 minutes (down from 20+) and does not save any results to disk.TimeSeriesDataFramein AutoGluon that essentially performsdf.groupby("item_id").nth(slice(start, end))in flat numpy arrays.main/ PR branch.By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.