Skip to content

Studio: reuse the VLM URL probe's downloads in the conversion - #15870

Merged
danielhanchen merged 3 commits into
mainfrom
perf/vlmprobe
Oct 29, 2026
Merged

danielhanchen merged 3 commits into
mainfrom
perf/vlmprobe

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

What changes

For a vision dataset whose image column holds URLs and has more than 200 rows, convert_to_vlm_format first probes the first 200 URLs to estimate throughput and the broken-link rate, discards the results, and then the conversion loop downloads and decodes those same 200 images again.

The probe now keeps each image it downloaded successfully, keyed by row, and the first conversion batch uses it instead of fetching the URL again. Everything else stays as it was:

  • A URL whose probe download failed is not cached. The conversion retries it exactly as before, so a transient failure in the probe can still succeed.
  • The rest of each row's conversion (instruction, caption, random.choice for list captions) still runs in both passes, so the number of draws from the global RNG is the same as before.
  • Converted rows, their order, failed_count, the fail-rate gate, the ETA text and the progress messages are all unchanged.
  • Each cached image is popped when the first batch uses it. Main already kept the 200 probe results (images included) alive through its futures dict until the first batch started, and the finished list holds every converted image anyway, so peak memory does not grow.
  • One behaviour does differ: a URL whose content changes in the seconds between the probe and the first batch is now converted from the probe's download, where main used its second download. Either copy is a snapshot of the same row taken seconds apart, and the row is still downloaded through the same fetch path with the same checks.

Results

I ran a local HTTP server that serves 64x64 JPEGs, returns 404 for every 11th row, and counts GET requests. Each arm ran 3 times.

rows GETs before GETs after converted output sha256 (texts + pixel bytes) progress messages
450 650 469 409 / 409 identical identical
1200 1400 1219 1090 / 1090 identical identical

After the change, the GET count is the row count plus the probe rows that failed and get retried. Before the change it was the row count plus 200. Both counts were identical across all repeats. On loopback the wall time is inside run-to-run noise. The saving shows up on real remote URLs: about 200 downloads per dataset, or roughly 200 / (probe throughput) seconds.

Tests

  • New studio/backend/tests/test_vlm_probe_reuses_downloads.py with 450 and 1200 rows, permanent and transient probe failures. It checks per-URL fetch counts, that transiently failed probe rows still convert, and the captions and pixels of every kept row. It fails before this change (probe rows are fetched twice) and passes after it.
  • The neighbouring VLM tests (test_vlm_conversion_row_urls, test_vlm_null_caption_rows, test_vlm_probe_untrusted_rows, test_vlm_question_column, test_vlm_repo_relative_image_paths, test_vlm_text_only_rows) give 72 passed both before and after.
  • py_compile passes on Python 3.9 and 3.10.

Not covered

@danielhanchen
danielhanchen marked this pull request as ready for review October 29, 2026 09:11
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-29T09:13:25.794482Z d34c1f9 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. More of your lovely PRs please.

Reviewed commit: d34c1f9a38

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

@danielhanchen
danielhanchen merged commit 6055083 into main Oct 29, 2026
1 of 39 checks passed
@danielhanchen
danielhanchen deleted the perf/vlmprobe branch October 29, 2026 10:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant