Skip to content

Update README.md - #64

Merged
danielhanchen merged 1 commit into
mainfrom
danielhanchen-patch-1
Jan 5, 2024
Merged

danielhanchen merged 1 commit into
mainfrom
danielhanchen-patch-1

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

No description provided.

@danielhanchen
danielhanchen merged commit f1a4849 into main Jan 5, 2024
@danielhanchen
danielhanchen deleted the danielhanchen-patch-1 branch January 6, 2024 06:55
mmathew23 pushed a commit to mmathew23/unsloth that referenced this pull request Jun 8, 2025
* Update compiler.py

* Update compiler.py

* Update gradient_checkpointing.py

* Update gradient_checkpointing.py

* Update compiler.py

* Update gradient_checkpointing.py

* Update gradient_checkpointing.py

* Update gradient_checkpointing.py

* Update gradient_checkpointing.py

* Update gradient_checkpointing.py

* Update gradient_checkpointing.py

* Update gradient_checkpointing.py

* Update gradient_checkpointing.py

* Update gradient_checkpointing.py

* Update gradient_checkpointing.py

* Update gradient_checkpointing.py

* Update compiler.py

* Update compiler.py

* Fix requires grad

* Update peft_utils.py

* Update compiler.py

* Update compiler.py

* Update compiler.py

* Update compiler.py

* Update compiler.py

* Update compiler.py

* Update compiler.py

* Update compiler.py

* Update compiler.py

* Update peft_utils.py

* Update peft_utils.py

* Update peft_utils.py

* Update peft_utils.py

* _get_dtype

* Update utils.py

* better attribution

* Update compiler.py

* Last layer GC

* Update gradient_checkpointing.py

* Update gradient_checkpointing.py

* Update gradient_checkpointing.py

* Update gradient_checkpointing.py

* Update gradient_checkpointing.py

* Update gradient_checkpointing.py

* Update gradient_checkpointing.py

* Update gradient_checkpointing.py

* Update gradient_checkpointing.py

* Update gradient_checkpointing.py

* Saving, llama.cpp

* Update llama_cpp.py

* Update llama_cpp.py

* Add error handling for forward method in patch_gradient_accumulation (unslothai#32)

* Update peft_utils.py

* Update peft_utils.py

* Update gradient_checkpointing.py

* Update gradient_checkpointing.py

* Update __init__.py

* Update gradient_checkpointing.py

* Update gradient_checkpointing.py

* Update gradient_checkpointing.py

* Update llama_cpp.py

* Update tokenizer_utils.py

* Update tokenizer_utils.py

* Update tokenizer_utils.py

* Update saving_utils.py

* Update __init__.py

* Create vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Licensing, bug fixes

* Update patching_utils.py

* Update vllm_utils.py

* Update __init__.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* rotary

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* load lora from tensors

* 0.7.1 lora request

* Update vllm_lora_request.py

* Update vllm_lora_request.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update compiler.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update __init__.py

* Create logging_utils.py

* Update logging_utils.py

* Update logging_utils.py

* Update logging_utils.py

* Update logging_utils.py

* Update vllm_utils.py

* fix_zero_training_loss

* Update dataset_utils.py

* Update training_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_lora_worker_manager.py

* Update vllm_lora_worker_manager.py

* Update vllm_utils.py

* Update vllm_lora_worker_manager.py

* Update vllm_lora_worker_manager.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update __init__.py

* Create rl_replacements.py

* Update __init__.py

* Fixes

* Update rl_replacements.py

* Update rl_replacements.py

* Update rl_replacements.py

* Update rl_replacements.py

* Update rl_replacements.py

* Update rl_replacements.py

* Update rl_replacements.py

* Update rl_replacements.py

* Update rl_replacements.py

* Update rl_replacements.py

* Update rl_replacements.py

* Update rl_replacements.py

* Update rl_replacements.py

* Update rl_replacements.py

* Update rl_replacements.py

* Update rl_replacements.py

* Update rl_replacements.py

* Update rl_replacements.py

* Update rl_replacements.py

* Update rl_replacements.py

* Update saving_utils.py

* Update saving_utils.py

* Update rl_replacements.py

* Update rl_replacements.py

* Update rl_replacements.py

* Update rl_replacements.py

* Update rl_replacements.py

* Update rl_replacements.py

* Update rl_replacements.py

* Update rl_replacements.py

* Update rl_replacements.py

* Update rl_replacements.py

* Update __init__.py

* Update rl_replacements.py

* Update rl_replacements.py

* Update rl_replacements.py

* Update rl_replacements.py

* Update rl_replacements.py

* Update rl_replacements.py

* Update rl_replacements.py

* Update rl_replacements.py

* Update rl_replacements.py

* Update pyproject.toml

* Update rl_replacements.py

* Update rl_replacements.py

* Update __init__.py

* Update gradient_checkpointing.py

* Update gradient_checkpointing.py

* Update gradient_checkpointing.py

* Update gradient_checkpointing.py

* Update tokenizer_utils.py

* Update tokenizer_utils.py

* Update tokenizer_utils.py

* Update gradient_checkpointing.py

* Update gradient_checkpointing.py

* Update gradient_checkpointing.py

* Update __init__.py

* compiling issues

* Update compiler.py

* Update compiler.py

* Update compiler.py

* Update compiler.py

* Update compiler.py

* Update compiler.py

* Update compiler.py

* Update compiler.py

* Update compiler.py

* Update compiler.py

* Update compiler.py

* Update compiler.py

* Update compiler.py

* Update compiler.py

* Update compiler.py

* SFT dataset prepare

* Update pyproject.toml

* Update rl_replacements.py

* Update rl_replacements.py

* Update rl_replacements.py

* Update compiler.py

* Update __init__.py

* Update compiler.py

* Update compiler.py

---------

Co-authored-by: Edd <[email protected]>
mmathew23 pushed a commit to mmathew23/unsloth that referenced this pull request Jun 25, 2025
* Update compiler.py

* Update compiler.py

* Update gradient_checkpointing.py

* Update gradient_checkpointing.py

* Update compiler.py

* Update gradient_checkpointing.py

* Update gradient_checkpointing.py

* Update gradient_checkpointing.py

* Update gradient_checkpointing.py

* Update gradient_checkpointing.py

* Update gradient_checkpointing.py

* Update gradient_checkpointing.py

* Update gradient_checkpointing.py

* Update gradient_checkpointing.py

* Update gradient_checkpointing.py

* Update gradient_checkpointing.py

* Update compiler.py

* Update compiler.py

* Fix requires grad

* Update peft_utils.py

* Update compiler.py

* Update compiler.py

* Update compiler.py

* Update compiler.py

* Update compiler.py

* Update compiler.py

* Update compiler.py

* Update compiler.py

* Update compiler.py

* Update peft_utils.py

* Update peft_utils.py

* Update peft_utils.py

* Update peft_utils.py

* _get_dtype

* Update utils.py

* better attribution

* Update compiler.py

* Last layer GC

* Update gradient_checkpointing.py

* Update gradient_checkpointing.py

* Update gradient_checkpointing.py

* Update gradient_checkpointing.py

* Update gradient_checkpointing.py

* Update gradient_checkpointing.py

* Update gradient_checkpointing.py

* Update gradient_checkpointing.py

* Update gradient_checkpointing.py

* Update gradient_checkpointing.py

* Saving, llama.cpp

* Update llama_cpp.py

* Update llama_cpp.py

* Add error handling for forward method in patch_gradient_accumulation (unslothai#32)

* Update peft_utils.py

* Update peft_utils.py

* Update gradient_checkpointing.py

* Update gradient_checkpointing.py

* Update __init__.py

* Update gradient_checkpointing.py

* Update gradient_checkpointing.py

* Update gradient_checkpointing.py

* Update llama_cpp.py

* Update tokenizer_utils.py

* Update tokenizer_utils.py

* Update tokenizer_utils.py

* Update saving_utils.py

* Update __init__.py

* Create vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Licensing, bug fixes

* Update patching_utils.py

* Update vllm_utils.py

* Update __init__.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* rotary

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* load lora from tensors

* 0.7.1 lora request

* Update vllm_lora_request.py

* Update vllm_lora_request.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update compiler.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update __init__.py

* Create logging_utils.py

* Update logging_utils.py

* Update logging_utils.py

* Update logging_utils.py

* Update logging_utils.py

* Update vllm_utils.py

* fix_zero_training_loss

* Update dataset_utils.py

* Update training_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_lora_worker_manager.py

* Update vllm_lora_worker_manager.py

* Update vllm_utils.py

* Update vllm_lora_worker_manager.py

* Update vllm_lora_worker_manager.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update __init__.py

* Create rl_replacements.py

* Update __init__.py

* Fixes

* Update rl_replacements.py

* Update rl_replacements.py

* Update rl_replacements.py

* Update rl_replacements.py

* Update rl_replacements.py

* Update rl_replacements.py

* Update rl_replacements.py

* Update rl_replacements.py

* Update rl_replacements.py

* Update rl_replacements.py

* Update rl_replacements.py

* Update rl_replacements.py

* Update rl_replacements.py

* Update rl_replacements.py

* Update rl_replacements.py

* Update rl_replacements.py

* Update rl_replacements.py

* Update rl_replacements.py

* Update rl_replacements.py

* Update rl_replacements.py

* Update saving_utils.py

* Update saving_utils.py

* Update rl_replacements.py

* Update rl_replacements.py

* Update rl_replacements.py

* Update rl_replacements.py

* Update rl_replacements.py

* Update rl_replacements.py

* Update rl_replacements.py

* Update rl_replacements.py

* Update rl_replacements.py

* Update rl_replacements.py

* Update __init__.py

* Update rl_replacements.py

* Update rl_replacements.py

* Update rl_replacements.py

* Update rl_replacements.py

* Update rl_replacements.py

* Update rl_replacements.py

* Update rl_replacements.py

* Update rl_replacements.py

* Update rl_replacements.py

* Update pyproject.toml

* Update rl_replacements.py

* Update rl_replacements.py

* Update __init__.py

* Update gradient_checkpointing.py

* Update gradient_checkpointing.py

* Update gradient_checkpointing.py

* Update gradient_checkpointing.py

* Update tokenizer_utils.py

* Update tokenizer_utils.py

* Update tokenizer_utils.py

* Update gradient_checkpointing.py

* Update gradient_checkpointing.py

* Update gradient_checkpointing.py

* Update __init__.py

* compiling issues

* Update compiler.py

* Update compiler.py

* Update compiler.py

* Update compiler.py

* Update compiler.py

* Update compiler.py

* Update compiler.py

* Update compiler.py

* Update compiler.py

* Update compiler.py

* Update compiler.py

* Update compiler.py

* Update compiler.py

* Update compiler.py

* Update compiler.py

* SFT dataset prepare

* Update pyproject.toml

* Update rl_replacements.py

* Update rl_replacements.py

* Update rl_replacements.py

* Update compiler.py

* Update __init__.py

* Update compiler.py

* Update compiler.py

---------

Co-authored-by: Edd <[email protected]>
mmathew23 pushed a commit to mmathew23/unsloth that referenced this pull request Jul 7, 2025
* Update compiler.py

* Update compiler.py

* Update gradient_checkpointing.py

* Update gradient_checkpointing.py

* Update compiler.py

* Update gradient_checkpointing.py

* Update gradient_checkpointing.py

* Update gradient_checkpointing.py

* Update gradient_checkpointing.py

* Update gradient_checkpointing.py

* Update gradient_checkpointing.py

* Update gradient_checkpointing.py

* Update gradient_checkpointing.py

* Update gradient_checkpointing.py

* Update gradient_checkpointing.py

* Update gradient_checkpointing.py

* Update compiler.py

* Update compiler.py

* Fix requires grad

* Update peft_utils.py

* Update compiler.py

* Update compiler.py

* Update compiler.py

* Update compiler.py

* Update compiler.py

* Update compiler.py

* Update compiler.py

* Update compiler.py

* Update compiler.py

* Update peft_utils.py

* Update peft_utils.py

* Update peft_utils.py

* Update peft_utils.py

* _get_dtype

* Update utils.py

* better attribution

* Update compiler.py

* Last layer GC

* Update gradient_checkpointing.py

* Update gradient_checkpointing.py

* Update gradient_checkpointing.py

* Update gradient_checkpointing.py

* Update gradient_checkpointing.py

* Update gradient_checkpointing.py

* Update gradient_checkpointing.py

* Update gradient_checkpointing.py

* Update gradient_checkpointing.py

* Update gradient_checkpointing.py

* Saving, llama.cpp

* Update llama_cpp.py

* Update llama_cpp.py

* Add error handling for forward method in patch_gradient_accumulation (unslothai#32)

* Update peft_utils.py

* Update peft_utils.py

* Update gradient_checkpointing.py

* Update gradient_checkpointing.py

* Update __init__.py

* Update gradient_checkpointing.py

* Update gradient_checkpointing.py

* Update gradient_checkpointing.py

* Update llama_cpp.py

* Update tokenizer_utils.py

* Update tokenizer_utils.py

* Update tokenizer_utils.py

* Update saving_utils.py

* Update __init__.py

* Create vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Licensing, bug fixes

* Update patching_utils.py

* Update vllm_utils.py

* Update __init__.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* rotary

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* load lora from tensors

* 0.7.1 lora request

* Update vllm_lora_request.py

* Update vllm_lora_request.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update compiler.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update __init__.py

* Create logging_utils.py

* Update logging_utils.py

* Update logging_utils.py

* Update logging_utils.py

* Update logging_utils.py

* Update vllm_utils.py

* fix_zero_training_loss

* Update dataset_utils.py

* Update training_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_lora_worker_manager.py

* Update vllm_lora_worker_manager.py

* Update vllm_utils.py

* Update vllm_lora_worker_manager.py

* Update vllm_lora_worker_manager.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update vllm_utils.py

* Update __init__.py

* Create rl_replacements.py

* Update __init__.py

* Fixes

* Update rl_replacements.py

* Update rl_replacements.py

* Update rl_replacements.py

* Update rl_replacements.py

* Update rl_replacements.py

* Update rl_replacements.py

* Update rl_replacements.py

* Update rl_replacements.py

* Update rl_replacements.py

* Update rl_replacements.py

* Update rl_replacements.py

* Update rl_replacements.py

* Update rl_replacements.py

* Update rl_replacements.py

* Update rl_replacements.py

* Update rl_replacements.py

* Update rl_replacements.py

* Update rl_replacements.py

* Update rl_replacements.py

* Update rl_replacements.py

* Update saving_utils.py

* Update saving_utils.py

* Update rl_replacements.py

* Update rl_replacements.py

* Update rl_replacements.py

* Update rl_replacements.py

* Update rl_replacements.py

* Update rl_replacements.py

* Update rl_replacements.py

* Update rl_replacements.py

* Update rl_replacements.py

* Update rl_replacements.py

* Update __init__.py

* Update rl_replacements.py

* Update rl_replacements.py

* Update rl_replacements.py

* Update rl_replacements.py

* Update rl_replacements.py

* Update rl_replacements.py

* Update rl_replacements.py

* Update rl_replacements.py

* Update rl_replacements.py

* Update pyproject.toml

* Update rl_replacements.py

* Update rl_replacements.py

* Update __init__.py

* Update gradient_checkpointing.py

* Update gradient_checkpointing.py

* Update gradient_checkpointing.py

* Update gradient_checkpointing.py

* Update tokenizer_utils.py

* Update tokenizer_utils.py

* Update tokenizer_utils.py

* Update gradient_checkpointing.py

* Update gradient_checkpointing.py

* Update gradient_checkpointing.py

* Update __init__.py

* compiling issues

* Update compiler.py

* Update compiler.py

* Update compiler.py

* Update compiler.py

* Update compiler.py

* Update compiler.py

* Update compiler.py

* Update compiler.py

* Update compiler.py

* Update compiler.py

* Update compiler.py

* Update compiler.py

* Update compiler.py

* Update compiler.py

* Update compiler.py

* SFT dataset prepare

* Update pyproject.toml

* Update rl_replacements.py

* Update rl_replacements.py

* Update rl_replacements.py

* Update compiler.py

* Update __init__.py

* Update compiler.py

* Update compiler.py

---------

Co-authored-by: Edd <[email protected]>
abiswas-realadvice pushed a commit to abiswas-realadvice/unsloth that referenced this pull request May 14, 2026
danielhanchen added a commit that referenced this pull request Oct 23, 2026
… inert

A label's @{ could close on a } quoted inside the real block, so the
scan skipped the real opener. Each @{ is now read independently; any
reading that names a remote image is rewritten, and when two such
readings overlap both openers become mermaid's #64;{ entity, which
shows the same text and opens nothing. The result is re-vetted until
stable.

[skip ci]
Stanley00 pushed a commit to stanley-fork/unsloth that referenced this pull request Oct 27, 2026
…nslothai#14907)

## Problem
`stripRemoteDiagramImages` (unslothai#14427) drops a remote `img` from mermaid
shape data blocks (`id@{ img: "..." }`) before mermaid renders a diagram
from chat markdown, since mermaid fetches the image while it measures
the node. The block scan took the first `@{` anywhere in the source as
an opener, including one inside a quoted label. The label's closing `"`
then flipped the scan into string mode, the real block's `}` was never
found, and the scan returned no blocks at all, so the diagram reached
mermaid unchanged:

```
flowchart LR
  A["@{"] --> B@{ img: "https://attacker.example/label-confusion", w: 10, h: 10 }
```

came back byte-identical on main, while the same block without the label
is stripped. Model output (including prompt-injected text from a fetched
page) controls the diagram, and the Studio page CSP allows `https:`
images, so this reopens the image beacon channel unslothai#14427 closed.

## Change
`studio/frontend/src/components/assistant-ui/mermaid-guard.ts`: whether
a given `@{` is shape data or text (a quoted label, accessibility text,
a sequence message) depends on mermaid's lexer state, which the guard
cannot reproduce, so it no longer picks one reading:
- every `@{` is read on its own, as a block up to its first `}` outside
a string (precomputed in one pass, so any number of markers costs linear
time);
- each reading that names a remote image gets the image taken out, as
before;
- when two such readings overlap, both openers become `unslothai#64;{`, mermaid's
entity for `@`, which shows the same text and opens nothing;
- the result is vetted again until it is stable.

Diagrams without a remote image are unchanged, including an unterminated
`@{` in a sequence message.

## Tests
`studio/frontend/tests/mermaid-remote-images.test.ts`: a `@{` in a
quoted label; a `@{` and a `}` in later labels; a `}` quoted inside the
real block's label; accessibility text with a lone quote; each strips
the remote image and is stable on a second pass. An unterminated `@{` in
a sequence message passes through unchanged, two overlapping readings
become inert, and 16,000 unclosed markers scan in under a second. Main
fails 2 of these; this branch passes all 49 in the file.

Full frontend suite (`node --test "tests/**/*.test.ts"`, TAP): the same
569 failing test IDs on main and on this branch (they need the full
frontend install), no new failures.


## Before / after

The same streamed reply (two mermaid diagrams) rendered by a Studio
built from the merge base and one built from this branch.
`https://attacker.example/**` was answered with a red image so a fetch
is visible.

![Before: the quoted `@{` hides B's shape data, so the remote image
loads (red box) and C's label is cut to "show". After: no remote fetch,
B and D keep their labels, C keeps its full
text.](https://raw.githubusercontent.com/danielhanchen/unsloth-staging-2/pr-media/pr/14907/pr14907_before_after-d92969bd72d3.png)

| | Before | After |
|---|---|---|
| Requests to the remote host | 1 | 0 |
| Remote `<image>` elements | 1 | 0 |
| C node label | `show` | `show @{ img: @{ img: x }` |
debojyoti-dev pushed a commit to debojyoti-dev/unsloth that referenced this pull request Nov 11, 2026
…nslothai#17459)

## Summary

Moves Studio's stable-diffusion.cpp prebuilt from
`master-982-0518b34-uba6ac30` to `master-982-0518b34-ueb0e729`, the
release built from fork master `eb0e729`. That is 36 fork commits on top
of the current pin. The tag keeps the `master-982` prefix because the
fork's release naming still counts from its last upstream release tag.

What the new build brings:

- Upstream resync to `master-1056` (unslothai/stable-diffusion.cpp#54):
packed INT4 convrot, MiniMax-H3 QKV chunking, RelayVSR, SDXL ControlNet
Union. Also Cosmos3-Nano-Sim-Transfer video-to-video (unslothai#53).
- x86 CPU: llamafile tinyBLAS GEMM for Q8_0 (unslothai#42), F16 / BF16 (unslothai#47) and
Q4_1 / Q5_0 / Q5_1 (unslothai#56) weights; an int8 tiled GEMM for Q8_0 / Q4_0 /
Q4_1 / Q5_0 / Q5_1 / IQ4_NL (unslothai#76); AVX512 kernels on Intel and a faster
direct convolution by default (unslothai#36, unslothai#70); Q4_K / Q2_K kept on the tiled
matmul on AMD (unslothai#57); Q5_0 / Q5_1 / Q4_1 through the Q8_0 GEMM at
diffusion batch sizes (unslothai#74); tiled flash attention and SIMD max fixes
(unslothai#66, unslothai#68, unslothai#62).
- aarch64 CPU: ik_llama.cpp GEMM kernels for K-quant and I-quant weights
(unslothai#48, unslothai#75), a NEON + i8mm variant for 128-bit SVE cores (unslothai#58), SVE flash
attention on the NEON path (unslothai#69), a 4x4 flash attention register tile
(unslothai#67).
- Metal: long graphs spread over more command buffers so the GPU
watchdog does not fire (unslothai#44), a coalesced im2col kernel (unslothai#45), flash
attention `auto` now means on without the timing probe (unslothai#46).
- Vulkan: RMS norm for short rows (unslothai#37), direct convolution chosen by an
output check instead of a timing race (unslothai#38), no host-buffer import on
AMD and MoltenVK (unslothai#60).
- HIP: bf16 WMMA operands for gfx11 / gfx12 (unslothai#59), FP32 accumulators in
the tile flash attention kernel (unslothai#61).
- CUDA: the Q8_1 block sum is computed from the quantized values, which
lowers matmul error for Q4_1 / Q5_1 / Q4_K / Q5_K / Q2_K weights (unslothai#63);
BF16 cuBLAS for large Q8_0 matmuls on A100, Hopper and datacenter
Blackwell (unslothai#39).
- Memory: the conditioning cache keeps entries across output sizes and
denoiser-only LoRA changes (unslothai#71); auto-fit charges unified-memory
devices against the RAM budget (unslothai#73, `SD_AUTOFIT_UMA=0` disables);
CPU-resident text-encoder weights are released when the next phase would
not fit (unslothai#72, `SD_TE_RELEASE=0` disables); `--mmap` repacks only what
the CPU repacks (unslothai#43); Qwen Image 2.1 prefix cache concatenated in F16
(unslothai#64).
- Packaging: bundles are smaller (unslothai#41; the Linux CPU bundle is 38.4 to
26.0 MiB, Linux CUDA 12 is 368.5 to 338.3 MiB, Linux Vulkan is 57.9 to
30.5 MiB), the Linux CPU bundles are run on emulated CPUs before
shipping (unslothai#49), and there is a new native Windows arm64 CPU bundle
(unslothai#55).

## Changes

- `studio/install_sd_cpp_prebuilt.py`: `DEFAULT_TAG` now names the new
release.
- Tests that pin the release name and its asset list now point at the
new tag. `test_sd_cpp_args.py` keeps the old pin in its list of builds
that support `--mmap`.
- The pinned asset lists gain `win-cpu-arm64`, with a test that a
Windows ARM64 host gets that bundle for `auto` / `cpu` while an x64 host
keeps `win-cpu-x64`, and that ARM64 with `cuda` or `vulkan` still gets
no match.

No Studio code changes. The existing selector already filters Windows
bundles by host architecture, so a Windows arm64 host, which today finds
no bundle in the pinned release and falls through to the upstream
fallback, now installs the native arm64 CPU build. An x64 Python running
under emulation on Windows arm64 reports `AMD64` and keeps the x64
bundle, as before. No option was removed from `sd-cli --help` or
`sd-server --help`; the new build only adds `--control-type`,
`--input-frames`, `--upscale-factor` and `--vsr-window-size`.

## Testing

- The sd.cpp, args, families, install, pin upgrade and download retry
tests pass (1406 passed). One test and one fixture error fail on main
and on this branch alike on this host, because its huggingface_hub is
older than the installed diffusers expects:
`test_create_causal_mask_patch_is_self_disabling_and_idempotent` and
`test_selection_installs_the_cuda_build`.
- Asset names: every bundle the selector can return was enumerated over
Linux x86_64 / aarch64, Windows AMD64 / ARM64 and macOS arm64 / x86_64,
with `auto`, `cpu`, `cuda` (no major, 12, 13), `vulkan` and `rocm`,
against the real asset list of the new release. Every returned name
exists in the release. The only change from the current pin is Windows
ARM64 `auto` / `cpu`, which goes from no match to `win-cpu-arm64`.
- SD1.5 (`v1-5-pruned-emaonly`), 512x512, 8 steps on CPU and 20 steps on
CUDA, euler, cfg 7, seed 42, both builds on the same machine. Each arm
repeated two or three times; every repeat was pixel-identical to the
first run of its arm. LPIPS is AlexNet.

Linux x86_64 CPU bundle, Xeon Platinum 8559C, 32 threads, wall time per
image:

| Weights | current pin | this branch | old vs new LPIPS | max pixel
diff |
| --- | --- | --- | --- | --- |
| f16 | 34.8 / 34.8 s | 16.4 / 17.2 s | 0.0001 | 13 |
| q8_0 | 31.3 / 32.4 s | 15.7 / 15.2 s | 0.007 | 118 |
| q4_K | 35.5 / 35.0 s | 18.7 / 19.0 s | 0.023 | 211 |

VAE decode alone went from 10 to 12 s down to 3.6 to 3.7 s. The
quantized CPU renders are not bit-identical to the current pin, but they
stay as close to the f16 render as before (q8_0 LPIPS to f16: 0.038 old,
0.046 new; q4_K: 0.163 old, 0.173 new).

Linux CUDA 12 bundle, Colab L4, wall time per image:

| Weights | current pin | this branch | old vs new LPIPS | max pixel
diff |
| --- | --- | --- | --- | --- |
| f16 | 4.70 / 4.70 / 4.71 s | 4.70 / 4.91 / 4.73 s | 0 | 0 |
| q8_0 | 7.42 / 4.92 / 4.90 s | 4.94 / 4.93 / 4.93 s | 0 | 0 |
| q4_1 | 18.13 / 17.97 / 17.94 s | 18.02 / 17.97 / 18.01 s | 0.025 | 198
|
| q4_K | 19.14 / 17.63 / 17.79 s | 17.74 / 17.63 / 17.61 s | 0.106 | 253
|

The current pin's first q8_0 run includes a cold start. f16 and q8_0 are
pixel-identical. q4_K moves, as the Q8_1 fix intends, and moves toward
the f16 render: LPIPS to f16 drops from 0.240 to 0.176 (q4_1: 0.327 to
0.322).

## Not covered

- macOS (Metal) and Windows were not run on hardware yet; the
cross-platform staging legs (Ubuntu, macOS 15, Windows) are still to
run.
- The new Windows arm64 bundle is covered only by the selector test and
the asset check. No Windows arm64 host ran it.
- No Vulkan, ROCm or HIP render with this build, no aarch64 Linux
render, and no Studio HTTP flow run (only `sd-cli` directly).
- No MiniMax-H3, MOSS-Image, Qwen-Image or FLUX.2 render with this
build; only SD1.5.
- CPU timings are from a shared host (both arms ran back to back with
the same thread count), and the CUDA timings come from one L4 VM, three
runs per arm. No T4 run.
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