Skip to content

Studio: print memory refusals to one decimal so the need never reads below what is free - #17948

Merged
danielhanchen merged 2 commits into
mainfrom
studio-h3-image-host-refusal-rounding
Nov 16, 2026
Merged

danielhanchen merged 2 commits into
mainfrom
studio-h3-image-host-refusal-rounding

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

Summary

Two memory refusals rounded the need to whole GB while printing what is available to one decimal (or both to whole GB), so they could contradict themselves:

  • MiniMax-H3-Image placement refusal, seen on a real Colab T4 (51 GB host, forced sequential): "MiniMax-H3-Image needs about 52 GB of free system memory ... and 52.2 GB is available." The real need was 52.4 GB (24.2 GB of host DiT blocks + the 27.2 GB text encoder + 1 GB).
  • LTX-2.5 dense text encoder fallback: for example a 24.3 GB need with 23.8 GB free read "needs about 24 GB of free memory (24 GB free)".

Both now print one decimal. Only the message text changes; when a load is refused is unchanged.

Tests

  • test_diffusion_minimax_h3_image.py: new test_the_host_refusal_names_a_need_above_what_is_available (the T4 case above) fails before and passes after.
  • test_video_hub_unreachable_cached_load.py: the encoder refusal assertion now pins the one-decimal text (fails before).
  • Related H3-Image, H3 video and LTX suites pass (206 tests).

Checked the other need-vs-available messages in the diffusion and video backends: the MiniMax-H3 video guard only refuses when capacity is at least 0.5 GB below the need, so its rounding cannot contradict, and is left as is.

…eds to one decimal

A forced sequential load on a 51 GB T4 high-memory host needs 52.4 GB (24.2 GB of host DiT blocks, the 27.2 GB
text encoder, 1 GB) and has 52.2 GB; rounded to whole GB the refusal read "needs about 52 GB ... and 52.2 GB is
available".
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-16T09:14:57.939627Z fde52f9 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.

@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: fde52f9ed3

ℹ️ 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 aa297dc into main Nov 16, 2026
@danielhanchen
danielhanchen deleted the studio-h3-image-host-refusal-rounding branch November 16, 2026 09:54
danielhanchen added a commit that referenced this pull request Nov 16, 2026
…(rest red on main) (#17963)

## Summary

`(Python 3.13, rest)` is red on main (seen on the staging runs of #17953
and #17957, base `bf7f6e050d`):

```
studio/backend/tests/test_video_ltx25_te_hosted.py::test_a_rejected_hosted_file_refuses_the_dense_fallback_without_room
E   Expected regex: 'needs about 24 GB'
E   Actual message: '... quantizing the dense encoder at load needs about 23.9 GB of free memory (8.0 GB free).'
studio/backend/tests/test_video_ltx25_te_hosted.py::test_the_dense_fallback_room_check_prices_the_load_dtype[float32-30-True]
E   Expected regex: 'needs about 48 GB'
E   Actual message: '... needs about 47.8 GB of free memory (30.0 GB free).'
```

#17948 changed the LTX-2.5 dense text encoder refusal to print the need
to one decimal, so it can no longer read "needs about 24 GB ... (24 GB
free)" for a 24.3 GB need with 23.8 GB free. That is intended. It
updated the same assertion in
`test_video_hub_unreachable_cached_load.py` but not these two in
`test_video_ltx25_te_hosted.py`, which still pin the old whole-GB text.

## Change

Test only, `studio/backend/tests/test_video_ltx25_te_hosted.py`:

- The hosted-file refusal pins the full one-decimal text: `needs about
23.9 GB of free memory (8.0 GB free)`.
- The dtype pricing case derives the need from `LTX25_TE_BF16_GB` (a
float32 load needs twice the bf16 encoder) and pins both figures to one
decimal, so a change to the encoder size constant does not break it
again while a return to whole-GB rounding still does.

No product code changes; when a load is refused is unchanged.

## Testing

- `test_video_ltx25_te_hosted.py`: 18 passed. On main the two tests
above fail.
- Sabotage: printing the need with `:.0f` again (the pre-#17948
rounding) fails both tests.
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