Repository navigation
Studio: hide safetensors models that exceed VRAM when the fit filter is on - #13945
Conversation
Codex Review SummaryThis 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. |
|
Reached Codex review convergence at oobabooga#379. |
|
Two reds here are specific to this PR rather than main:
|
|
Reached Codex review convergence again at oobabooga#379 after the bundle budget fix (9c97d0f). |
|
I put together a small test-only commit on top of All three groups passed against the unchanged pure modules: 36 filter/badge comparisons across GPU sizes, parameter counts and spare RAM; two inferred-parameter cases; and checks that curated sizes and media loads still take their intended paths. No installs or model loads were needed. This doesn't test the Hub UI, full frontend CI, or the physical accuracy of the estimator. I'd keep the badge/filter agreement check alongside the size examples, and retain separate checks for the explicit exceptions when this predicate changes. From |
One CUDA / ROCm card block-swaps decoder layers into host RAM (offload_layers="auto"), so it counts RAM; several cards and XPU stay VRAM only. Prequantized checkpoints fit as stored, or as a bnb 4-bit rebuild for compressed-tensors; fp8 stays fp8 in Studio. Byte sizes use GiB like the device inventory. The picker passes the device count of the inventory a row is judged against.
|
Pushed 8056c3e on top of this branch. The filter now sizes a safetensors row by how the chat load actually places it:
Macs / APUs are unchanged (host pool keeps the existing rule). |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8056c3e61e
ℹ️ 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".
|
@codex review |
|
Codex Review: Didn't find any major issues. Nice work! 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". |
# Conflicts: # studio/frontend/scripts/check-bundle-budget.ts
|
Merged latest |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2f54e7a91d
ℹ️ 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".
A prequantized row with no safetensors byte size fell back to the 0.9 B/param bnb estimate, hiding packed checkpoints the filter kept before.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ee242dd750
ℹ️ 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".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ee242dd750
ℹ️ 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".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ee242dd750
ℹ️ 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".
Studio's Default engine runs no compressed-tensors checkpoint (it offers vLLM / SGLang, which place the stored weights), so crediting a bnb 4-bit rebuild for it kept rows that do not fit. Only a bitsandbytes checkpoint counts host RAM.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 34d31d32d3
ℹ️ 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".
|
@codex review |
|
Codex Review: Didn't find any major issues. Chef's kiss. 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". |
|
Review loop done on
What changed during this round:
Codex findings answered without a change, with reasons in their threads: the |
…13991) ## Summary `Frontend build + bundle sanity` is red on main again. #13969 merged with it red, and its run reported `over the startup budget: transfer 1995.0 KB > 1994.7 KB, raw 6633.8 KB > 6632.7 KB`. Main at 6106de9 measures 6,796,799 B raw / 2,044,202 B transfer, against limits of 6,792,425 / 2,042,777. Measured commit by commit (one machine and build, Node 24, 95 chunks throughout, `rm -rf dist` before each build): | commit | raw B | transfer B | |---|---|---| | 1790106 (#13983, last raise from me) | 6,791,768 | 2,042,404 | | 7d33eff (#13965) | 6,792,034 | 2,042,515 | | cc0cb59 (#13966) | 6,792,447 | 2,042,693 | | 7bee02d (#13969) | 6,793,737 | 2,043,138 | | ce83dee (#13973) | 6,796,298 | 2,044,201 | | 6106de9 (main, after #13974, #13972, #13951, #13945) | 6,796,799 | 2,044,202 | The two largest steps: - Inline chat markdown tables with hover controls and the expand dialog (#13973): +2,561 B raw / +1,063 B transfer, in the eager chat chunk. - Latest Unsloth Models ranking (#13969): +1,290 B raw / +445 B transfer. #13945 already raised the budget for its own 497 B. ## Change The budget is set to the measured build plus the margin main had at 1790106 (160 B raw, 189 B transfer), with the per-commit numbers recorded beside the limits as in the earlier raises. If #13973's expand dialog should be lazy-loaded instead, that is a follow-up for its owner. This only gets main and every open PR off a red that none of them caused. ## Testing - `npm run build && npm run bundle:check` on main with this change: within budget (0.2 KB transfer, 0.2 KB raw to spare). Without it: over by 4,374 B raw / 1,425 B transfer. - `tests/bundle-budget-cli.test.ts` and `tests/bundle-budget-closure.test.ts`: 43 passed. - `prettier --check scripts/check-bundle-budget.ts`: clean.
Problem
With "Only show models that fit" on, the Hub page keeps safetensors models that their own row badge marks as over budget. On a host with 72 GiB of VRAM and 94 GiB of RAM, Safetensors format selected:
Cause
hfModelFitsDevicejudged safetensors rows with the GGUF rule: 0.4 bytes per parameter (the smallest GGUF quant), plus half of system RAM as offload room. A safetensors chat load goes through transformers, 4-bit by default, andraise_if_offloadedrejects any CPU offload. The badge already uses the 4-bit estimate (estimateLoadingVram+checkVramFit), so the filter and the badge disagreed.Fix
On a discrete GPU, a safetensors row now gets the badge's verdict against VRAM only, and is kept unless it is "exceeds". GGUF, MLX, Images / Video, catalog-sized rows, and Macs / APUs (
hostPooledMemory) keep the existing rule. Downloaded models still always show.The estimate is still a heuristic. This makes the filter agree with the badge; it does not prove a kept model will load. I did not run a load.
Verification
tests/fit-on-device-setting.test.ts: fails on main, passes here. The rest ofnpm testfails the same pre-existing tests as main, apart from one flaky timing test.npm run typecheckandeslintpass.