Honor calibration batch ranges and reset the reader on rewind - #2689
Open
Sylvester Kaczmarek (sylvesterkaczmarek) wants to merge 1 commit into
Open
Sylvester Kaczmarek (sylvesterkaczmarek) wants to merge 1 commit into
Sylvester Kaczmarek (sylvesterkaczmarek) wants to merge 1 commit into
Conversation
Fixes microsoft#2688. Add regression coverage.
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Copilot started reviewing on behalf of
Sylvester Kaczmarek (sylvesterkaczmarek)
September 25, 2026 11:45
View session
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
Reviewed changes address the stated calibration range and rewind issues with regression coverage.
Review effort: Lite
Findings: None
What changed in this PR
Fixes calibration batch-range selection and reader rewind behavior.
Changes:
- Repositions iterators for noncontiguous ranges.
- Resets reader state on rewind while preserving bounds.
- Adds regression and ONNX Runtime calibration tests.
| File | Description |
|---|---|
test/data_container/test_calibration_dataloader_ranges.py |
Adds range, rewind, and calibration regression coverage. |
olive/data/component/dataloader.py |
Corrects range positioning and rewind behavior. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This branch has not been deployed
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
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.
Describe your changes
Fixes #2688.
The default calibration reader updates its range counters without positioning the underlying iterator. Requesting batches [2, 4) from a fresh reader returns batches 0 and 1. Rewinding a bounded reader can also return no data because the current index is not reset.
This change positions the iterator when the requested start differs from the current index, reuses the existing iterator for contiguous windows, and resets the current index on rewind while preserving the configured end bound.
Default unbounded iteration, input conversion, labels, and reader length are unchanged.
Tests
Checklist before requesting a review
Issue link
#2688