Repository navigation
Studio VLM conversion: fetch repo image files on a pool, settle rows in order - #17029
Merged
Merged
Conversation
This was referenced Nov 7, 2026
…verters [skip ci]
Member
Author
|
@codex review |
1 similar comment
Member
Author
|
@codex review |
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. What shall we delve into next? Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
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.
In image + text datasets, the image column sometimes holds bare file names (
0001.jpg,images/0001.jpg) that point at files in the dataset repo.convert_to_vlm_formatresolved those with onehf_hub_downloadper row, one row at a time, before training could start. Each call is at least one Hub request (a HEAD even when the file is cached, since no revision is pinned), so 10k rows meant 10k sequential round trips. #15786 already moved the ShareGPT + image converter onto an in-order pool for the same case. This converter's image + text path was still serial.Change
For rows whose image is a repo file name, the download and decode run on a thread pool:
min(safe_thread_num_proc(), 8)workers, the same cap as the ShareGPT converter. Rows are still settled in row order on the calling thread, so the converted list, therandom.choicepick for list captions, the failure count and the first-failure log line are the same as before. At most 2x workers images are held while waiting. Each task runs in a copy of the caller's context, so the fetch sees the same account and HF cache settings. Rows with local paths, URLs or embedded images are unchanged, and URL datasets keep their own probe-and-batch path.Both converters now share one
_settle_in_orderhelper (bounded in-order pool, context copy per task, queued tasks cancelled on interrupt), replacing the ShareGPT converter's inline copy. Net change informat_conversion.py: about 40 lines added, 60 removed.Results (200 rows, fake Hub with 100 ms per download, 3 alternating runs per side)
convert_to_vlm_formatThe gain scales with the per-request latency and the worker count (8 here).
Tests
tests/test_vlm_repo_image_fetch_pool.py. 48 rows that mix repo-relative and bare names, list captions picked with a fixed seed, and one download that fails: the pooled output equals the serial output, in the same order with the same captions. The same files are fetched, and more than one fetch runs at a time. It fails on main, because fetches run one at a time there.tests/test_vlm_*.py+tests/test_sharegpt_*.py: 119 passed (ShareGPT pool tests unchanged and green on the shared helper).