Repository navigation
Allow ignored-field dataloaders to use spawned workers - #2760
Open
林SO (Linxiushen) wants to merge 1 commit into
Open
林SO (Linxiushen) wants to merge 1 commit into
林SO (Linxiushen) wants to merge 1 commit into
Conversation
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The narrow refactor preserves collation behavior and includes targeted regression coverage, with no blocking issues identified.
No open issues 🎉
What changed in this PR
Fixes ignored-field DataLoader collation with spawned workers, including the configured DataContainer path on Windows, while preserving existing batching behavior.
Changes:
- Moves the collator to module scope and binds ignored fields with
functools.partialso it can be pickled. - Adds regression coverage for serialization, serial and spawned workers, configured loaders, and existing batching behavior.
| File | Description |
|---|---|
test/data_container/test_ignored_batch_fields.py |
Adds pickle, spawned-worker, configuration, and batching regression tests. |
olive/data/component/dataloader.py |
Replaces the local collator with a picklable module-level helper. |
Review effort: Balanced
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
dataloader_with_ignored_batch_fieldscreates a function-local collator that cannot be pickled by spawned DataLoader workers. Withnum_workers=1andmultiprocessing_context="spawn", iteration fails before the first batch, including through the configuredDataConfig/DataContainerpath on Windows.Move the collator to module scope and bind the ignored fields with
functools.partial, preserving scalar-field conversion, tensors, labels and forwarded options.Validation on Windows CPU:
lintrunner -a, final lintrunner including Pylint, andgit diff --checkpassed.Regression tests use a 120-second worker startup allowance after the initial 20-second allowance timed out on cold imports; those failures are retained. Product timeout defaults are unchanged. Focused pytest uses
--confcutdir=test/data_containerto exclude unrelated model fixtures. The full model/provider suite and performance/GPU validation were not run.Checklist before requesting a review
lintrunner -aRelease note: Fix ignored-field DataLoader collation failing with spawned worker processes, including the configured DataContainer path on Windows.
(Optional) Issue link
Independently reproduced; no linked issue.
AI assistance: implementation, tests and this description were prepared with Codex and reviewed against the exact diff and native test results.