Skip to content

Studio diffusion: a numbered shard without its index is not a complete snapshot - #16418

Merged
danielhanchen merged 3 commits into
mainfrom
dh/diffusion-missing-shard-index
Nov 3, 2026
Merged

danielhanchen merged 3 commits into
mainfrom
dh/diffusion-missing-shard-index

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

Summary

snapshot_weights_complete() accepted a component as soon as one weight file existed, then checked only the shard indexes already on disk. An interrupted or still-running snapshot download that had one numbered shard (model-00001-of-00003.safetensors) but no index passed as complete. The small-host decision then sized only the cached files. That skipped the early download, and the spill route was planned for a fraction of the real weights.

Fix

A numbered shard that no index on disk lists now marks the snapshot incomplete. The loader downloads first and plans memory from the full snapshot.

Tests

studio/backend/tests/test_diffusion_small_host.py gains 5 cases: one DiT shard and no index, plus numbered shards across diffusion_pytorch_model, model and pytorch_model, with and without an fp16 variant. They fail before the fix and pass after: 41 passed in the file (CPU).

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 1, 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-11-03T04:48:32.921777Z 77a14ff 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 added a commit that referenced this pull request Nov 1, 2026
… their copy (#16431)

## Summary

`Chat UI Tests (extra)` fails on PRs based on current main (#16418,
#16421, #16413) in the chat width driver:

```
[chat-width] FAIL in step "measure the 'Standard' preset across 7 viewports" after 30.7s: TimeoutError: Locator.click: Timeout 30000ms exceeded.
  - waiting for get_by_role("option", name="Standard", exact=True)
```

#16408 (`8da4ba2f1c`, customizable new-chat greeting) renamed the chat
width option label from "Standard" to "Default"
(`settings.appearance.custom.chatWidth.standard`) in every locale. The
product change is intended. `tests/studio/playwright_chat_width.py`
clicked the option by its English text, so it waited for an option that
no longer exists.

## Change

- **`playwright_chat_width.py`:** the driver picks each preset by its
position in the open listbox, not by its copy. The component lists the
values as `["standard", "wide", "full"]`. The driver's own names for the
presets (`CHAT_WIDTH_PRESETS`) are unchanged, so the measurements and
messages read the same. I did not switch it to the `_en_catalog` reader,
because `test_en_catalog.py` pins every catalog-reading driver to the
composer workflow, and this one runs in `studio-ui-smoke.yml`.
- **New `tests/studio/test_chat_width_driver_presets.py`:** checks that
`appearance-custom-controls.tsx` still maps over `["standard", "wide",
"full"]` in that order, and that the driver has one preset per option. A
reorder or a new option then fails here instead of measuring the wrong
preset.

## Testing

- The new test, `test_en_catalog.py` and
`test_playwright_suites_run_in_ci.py`: 54 passed.
- Sabotage: with the component's order swapped to `["wide", "standard",
"full"]`, the new test fails.
- The driver itself needs a live Studio. It runs in this PR's own `Chat
UI Tests (extra)` job, and I will only merge once that is green.

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
@danielhanchen danielhanchen self-assigned this Nov 3, 2026
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Breezy!

Reviewed commit: 1d0b12c40b

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

@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: 77a14ffe08

ℹ️ 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 added a commit to danielhanchen/unsloth-staging-2 that referenced this pull request Nov 3, 2026
@danielhanchen
danielhanchen merged commit e02bc9e into main Nov 3, 2026
@danielhanchen
danielhanchen deleted the dh/diffusion-missing-shard-index branch November 3, 2026 05:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant