Skip to content

Improve model-load error guidance and shorten failure notifications - #16540

Merged
danielhanchen merged 3 commits into
unslothai:mainfrom
Imagineer99:fix/model-load-error-guidance
Nov 4, 2026
Merged

danielhanchen merged 3 commits into
unslothai:mainfrom
Imagineer99:fix/model-load-error-guidance

Conversation

@Imagineer99

@Imagineer99 Imagineer99 commented Nov 3, 2026 •

Copy link
Copy Markdown
Member

Recognised model-load failures currently fall through to the same “check that the GGUF file is valid and you have enough memory” message, while the notification also includes raw runtime output.

Give memory-allocation, incomplete-file and file-open failures short guidance, and keep technical output in the full copyable error and View logs instead of the toast. Preserve the original unknown-cause fallback. Also avoid treating an unrecognised architecture as proof that the file is valid, or missing metadata as proof of a version mismatch.

Related to #15412.

Validation

  • 457 focused backend tests passed, covering classification, diagnostic redaction, route rewriting and adjacent startup recovery.
  • 15 frontend tests passed, including toast formatting and log-action behavior.
  • Full frontend typecheck passed; Python lint, pinned formatter and diff checks passed.
  • Playwright verified four simulated failure cases, log selection, and copying the complete error.

Playwright examples

These are component previews with simulated runtime failures, not reproductions of the reporter's model loads. Messages were generated by the actual classifiers at base 867c4248d0 and head 25b101df3d, then rendered with the real Unsloth components. Before is on the left; the PR change is on the right.

Memory allocation

Memory allocation failure before and after

Incomplete or damaged file

Incomplete model file before and after

File-open failure

File-open failure before and after

Unknown cause — original wording preserved

The fallback text is unchanged. The toast omits raw diagnostic output; the full error and View logs still retain it.

Unknown-cause fallback before and after

Real Studio before/after (truncated GGUF, real llama-server failure)

Two isolated Studio installs (merge base 867c4248d vs head 941566239). A tiny GGUF was truncated mid-tensor and placed in each Studio's Hugging Face cache, then picked from the chat model picker (On Device). The bundled llama-server fails with tensor 'output.weight' data is not within the file bounds. Before: the toast says the generic "check that the GGUF file is valid and you have enough memory" and carries the raw runtime output (1358 px tall). After: the toast names the incomplete download (128 px) and keeps View logs; the full error still carries the output tail and log path.

Truncated GGUF load failure toast, before and after

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 3, 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-04T13:41:05.210312Z fc83591 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 3, 2026
## Summary

Since #16414 (`9a8b229714`), `Repo tests (CPU, rest-2)` has been failing
on unrelated PRs. It reproduces on current main, and it hit #16540 and
#16509 in runs created after #16531 merged:

```
tests/test_source_read_encoding.py::test_checked_in_file_reads_name_an_encoding[2]
E   AssertionError: 1 file reads in the test trees touch a checked-in file with the platform default encoding, so they break on Windows as soon as that file gains a non-ASCII byte. Pass encoding = "utf-8": ['tests/test_multi_lora_scale_overflow_cpu.py:20: read_text()']
```

The new test from #16414 parses `unsloth/kernels/multi_lora.py` with a
bare `read_text()`. That is the same pattern #16531 fixed in
`test_multi_lora_cold_compile_cpu.py`. The guard is right: on Windows, a
bare read uses the locale code page, so this test would break as soon as
the kernel file gains a non-ASCII character. The kernel change in #16414
is fine.

## Change

`tests/test_multi_lora_scale_overflow_cpu.py` line 20: `read_text()`
becomes `read_text(encoding = "utf-8")`.

## Testing

- `tests/test_source_read_encoding.py`:
  - main: 1 failed, 15 passed (the case above);
  - this branch: passes.
- This branch, `tests/test_source_read_encoding.py` plus
`tests/test_multi_lora_scale_overflow_cpu.py`: 28 passed.
@danielhanchen danielhanchen self-assigned this Nov 4, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Nov 4, 2026
@danielhanchen

Copy link
Copy Markdown
Member

@codex review

1 similar comment
@danielhanchen

Copy link
Copy Markdown
Member

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Chef's kiss.

Reviewed commit: fc83591d35

ℹ️ 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 pushed a commit to danielhanchen/unsloth-staging-2 that referenced this pull request Nov 4, 2026
@danielhanchen
danielhanchen merged commit 8f2ba48 into unslothai:main Nov 4, 2026
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.

2 participants