Skip to content

Studio video: report the dense bf16 text encoder when the automatic hosted fp8 encoder cannot be fetched - #16724

Merged
danielhanchen merged 2 commits into
mainfrom
studio-video-te-auto-fallback-log
Nov 5, 2026
Merged

danielhanchen merged 2 commits into
mainfrom
studio-video-te-auto-fallback-log

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

Summary

HunyuanVideo-1.5 picks a hosted fp8 text encoder automatically. When that file cannot be fetched (for example a 401 from the Hub), the load already falls back to the dense bf16 encoder, but it still logs 'fp8' selected automatically, so the log claims a scheme that never ran.

This change records which hosted encoder failed and why, and reports the fallback instead:

  • _fetch_te_prequant takes an optional failures dict and fills {component: "<repo>: <error type>: <first line>"} for an encoder none of whose candidate files could be fetched.
  • auto_te_fetch_failure(fam, scheme, failures) maps that back to the family's automatic scheme (te_prequant_repos), so only the scheme that was actually requested is affected.
  • The automatic pick logs the automatic 'fp8' for hunyuanvideo-1.5 is not available (hosted pre-cast encoder unreachable: ...); the dense bf16 text encoder loads, and the resolved text_encoder_quant status carries the same reason.

What does not change: the repo that is requested, the encoder that loads, and every path where the hosted file is fetched or an encoder quant is requested explicitly.

Tests

  • New tests/test_video_te_auto_fallback_log.py (3 tests): a refused hosted encoder is recorded per component with its repo and error type; the failure maps only to the automatic scheme that asked for it; a fetched encoder records nothing.
  • tests/test_prequant_prefer_cached_pickle.py still passes (54 passed together).
  • The new tests do not import on main (auto_te_fetch_failure does not exist there).

Not covered: a full load that asserts the log line and the resolved status end to end; the path is CPU-side and was not run on a GPU.

@danielhanchen danielhanchen self-assigned this Nov 5, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 5, 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-05T06:30:06.891546Z 58bdc9d 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. Delightful!

Reviewed commit: 58bdc9d26b

ℹ️ 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 ff7b85d into main Nov 5, 2026
@danielhanchen
danielhanchen deleted the studio-video-te-auto-fallback-log branch November 5, 2026 06:59
danielhanchen added a commit to danielhanchen/unsloth-staging-2 that referenced this pull request Nov 9, 2026
…es its hosted encoder (unslothai#17093)

## Problem

unslothai#16724 made the video load say so when an automatic text-encoder pick
(the family's hosted fp8 encoder) cannot be fetched, instead of logging
it as selected. The log line was written right after the prefetch:

```
video.text_encoder_quant: the automatic 'fp8' for ltx-2 is not available (hosted pre-cast encoder unreachable: ...); the dense bf16 text encoder loads
```

The load then tries that hosted encoder again (`te_prequant_pipe_kwargs`
resolves the checkpoint once more), so a transient prefetch failure (a
503, a timeout) can still end with the fp8 encoder injected. In that
case the resolved status correctly reads "engaged (selected
automatically)", but the log said the dense bf16 encoder loads.

## Change

The outcome line for an automatic pick whose prefetch failed is now
written after that retry: "selected automatically" when the hosted
encoder was injected, the "not available ... dense bf16" line when it
was not. A pick with no prefetch failure logs as before, at the same
point. The resolved status text is unchanged. Only log text moves:
placement, budgets and the loaded encoder are untouched.

## Tests


`test_a_failed_te_prefetch_is_logged_by_the_retried_outcome[True|False]`
(`test_video_backend.py`, the existing CPU fake runtime, LTX-2 GGUF with
a recorded prefetch failure): exactly one `video.text_encoder_quant`
line, which matches what the retry injected.

| arm | new test |
|---|---|
| main (`a174823`) | `[True]` fails: logs "is not available ... the
dense bf16 text encoder loads" although the encoder was injected;
`[False]` passes |
| this PR | both pass |

The TE-related cases in `test_video_backend.py` and
`test_video_te_auto_fallback_log.py`: 75 passed.
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