Archived
radiance 1.10.0
LoRA for image and video generators: - civitai and Hugging Face adapter files as published: kohya, ComfyUI and diffusers/PEFT key names; LoRA, LoCon, LoHa, LoKr and full-weight diffs; DoRA, OFT and Tucker are refused by name - stacked per request with a strength each, through the `loras` field or <lora:name:strength> tags in the prompt; --lora-dir serves every file in a directory, GET /v1/loras lists them, and --max-loras / --max-lora-rank size the slots on the card (generators default to rank 64) - Krea 2, Qwen-Image 2.1, FLUX.3 [klein], MiniMax H3, LTX-2.5, Anima and SDXL New models: - Anima (base, aesthetic and turbo): Cosmos-Predict2 DiT with the Qwen3-0.6B text encoder and the Qwen-Image VAE, on one card - Stable Diffusion XL and its single-file finetunes (Illustrious, NoobAI including V-Pred, Pony), read as civitai ships them, with the Euler, Euler a and DPM++ 2M samplers Recipes: - q38-27b-mxfp4-df2: any bf16 Qwen3.8-27B or finetune at MXFP4 with the DFlash2 drafter - Krea 2 finetunes from civitai: scripts/krea2_native.py reads Krea's own key names, and krea-2-fp8-unscaled keeps a plain-fp8 file's codes exactly Changes: --max-num-batched-tokens defaults to 2048 (was 8192). Plugin ABI 25: out-of-tree plugins must be rebuilt.
This commit is contained in:
1 parent
685ec5bd85
commit
4246a1dd04
124 files changed
+14326
-387
No files matched your search
@@ -22,7 +22,9 @@ plugin claims.
|
||||
| `arch/gemma4` | `gemma4` | *(empty)* | Gemma 4 text from Google's bf16 checkpoint (the 26B-A4B MoE and the dense sizes without per-layer embeddings) with z-lab's DFlash drafter; routed experts bf16 or block fp8 |
|
||||
| `arch/qwenimage21` | `qwenimage21` | *(empty)* | Qwen-Image 2.1 and 2.1-Turbo, an image generator, from the diffusers pipeline directory; DiT and text encoder bf16 or block fp8 |
|
||||
| `arch/krea2` | `krea2` | *(empty)* | Krea 2 Raw and Turbo, an image generator: Qwen3-VL-4B's tapped layers through a text-fusion transformer, a 12.9B single-stream DiT and Wan 2.1's VAE, from the diffusers pipeline directory; bf16 or block fp8 |
|
||||
| `arch/sdxl` | `sdxl` | *(empty)* | Stable Diffusion XL and its finetunes (Illustrious, NoobAI, Pony), an image generator: CLIP ViT-L and OpenCLIP bigG text encoders, the 2.6B UNet sampled by k-diffusion's Euler, Euler ancestral or DPM++ 2M on ComfyUI's schedules, the SDXL VAE; from the single-file checkpoint, bf16, one card |
|
||||
| `arch/flux3` | `flux3` | *(empty)* | FLUX.3 [klein] and its base, an image generator and editor: Qwen3-VL-4B's tapped layers, a 5.6B three-mode DiT over the text, up to ten reference pictures and the image, FLUX.2's VAE; bf16 or block fp8 |
|
||||
| `arch/anima` | `anima` | *(empty)* | Anima (Base, Aesthetic, Turbo), an image generator: Qwen3-0.6B-Base through the LLM adapter over the prompt's T5 tokens, Cosmos-Predict2's 2B cross-attention DiT and the Qwen-Image VAE, from the release's single files; bf16 or block fp8, one card |
|
||||
| `arch/flux3distilled` | `flux3distilled` | *(empty)* | the same plugin under the name FLUX.3 [klein]'s step-distilled release gives itself (`Flux3DistilledModularPipeline`; its base is a `Flux3ModularPipeline`) |
|
||||
| `arch/qwen3asr_bf16` | `qwen3asr` | *(empty)* | Qwen3-ASR: a Whisper-style audio encoder over a dense Qwen3 decoder, speech to text |
|
||||
| `arch/minimaxmusic3` | `minimaxmusic3` | *(empty)* | MiniMax-Music3, songs from a description and lyrics: a Qwen3-8B frame model, a depth decoder, a flow-matching DiT and a DAC vocoder, from the diffusers pipeline directory, bf16 |
|
||||
@@ -39,6 +41,25 @@ The traps below are readings that are wrong without any error: the model produce
|
||||
widths, the KV page size and the attention kernel's band. `core/engine_bringup.cpp` takes it from
|
||||
the container's meta.
|
||||
|
||||
## Adapter key names of the generators
|
||||
|
||||
A generator that serves LoRA files ([GUIDE §4.9.2](GUIDE.md)) declares, before its GEMMs, how
|
||||
those files name its modules (`rad_lora_root`, `rad_lora_alias`; `lora_names` in
|
||||
`arch/common/rad_arch.h`). Files follow the model's original code or ComfyUI's port of it, while
|
||||
containers keep the diffusers names, and the two disagree in ways that load without an error and
|
||||
generate garbage: a fused `qkv` against separate q, k and v, a SwiGLU projection whose gate half
|
||||
comes first in one and second in the other. The tables, by plugin:
|
||||
|
||||
| plugin | adapter files | checkpoint |
|
||||
|---|---|---|
|
||||
| `krea2` | `blocks.N.attn.wq/wk/wv/wo/gate`, `mlp.gate/up/down`, `txtfusion.{layerwise,refiner}_blocks.N.*`, `first`, `last_linear`, `tmlp.0/2`, `tproj.1`, `txtmlp.1/3` | `transformer_blocks.N.attn.to_q/...`, `ff.*`, `text_fusion.*`, `img_in`, `final_layer.linear`, `time_embed.linear_1/2`, `time_mod_proj`, `txt_in.linear_1/2` |
|
||||
| `qwenimage21` | the checkpoint's names, or `img_mlp.gate_up` = [gate; up] | `img_mlp.gate_layer`, `img_mlp.proj` |
|
||||
| `minimaxh3` | `blocks.N.attn.qkv_proj` (q, k, v), `out_proj`, `mlp.fc1` = [gate; up], `fc2`; `token_refiner.blocks.N.*`; `video_patch_proj`, `audio_patch_proj`, `condition_proj`, `time_embedder.proj_in/out`, `final_layer.video_out/audio_out` | `attn.to_q/k/v`, `to_out.0`, `ff.net.0.proj` = [up; gate], `ff.net.2`; `token_refiner.refiner_blocks.N.*`; `proj_in`, `audio_proj_in`, `context_embedder`, `time_embedder.linear_1/2`, `proj_out`, `audio_proj_out` |
|
||||
| `flux3` | `single_blocks.N`, `txt_mode_blocks.N`, `content_mode_blocks.{image,image_cond}.N` with `q_proj/k_proj/v_proj` or `qkv`, `attn_out`, `mlp_in`, `mlp_out` | `single_transformer_blocks.N`, `txt_mode_blocks.N`, `mode_blocks.{image,image_cond}.N` with `attn.to_q/k/v`, `attn.to_out.0`, `ff.linear_in/out` |
|
||||
| `ltx2` | the checkpoint's names | |
|
||||
| `anima` | the checkpoint's names behind `diffusion_model.` / `lora_unet_`; the text encoder as `lora_te_layers_N_...` | DiT under `net.` or `model.diffusion_model.`, Qwen3 under `model.layers.` |
|
||||
| `sdxl` | kohya's `lora_unet_` over the single-file UNet paths (convolutions included), `lora_te1_` / `lora_te2_` over the CLIPs' transformers names | UNet under `model.diffusion_model.`, CLIP-L and bigG under `conditioner.embedders.{0,1}.transformer.` |
|
||||
|
||||
---
|
||||
|
||||
# `llama`: the plain decoder
|
||||
@@ -922,6 +943,76 @@ quantisation's: the container's codes decoded to bf16 on the host give the same
|
||||
|
||||
---
|
||||
|
||||
# `sdxl`: Stable Diffusion XL and its finetunes, an image generator
|
||||
|
||||
`arch/sdxl` serves SDXL 1.0 and every finetune published as one `.safetensors` in Stability's
|
||||
(sgm) layout: Illustrious, NoobAI, Pony and the civitai checkpoints built on them. rad-convert's
|
||||
importer (`core/format/checkpoint.cpp`, `open_sgm`) reads the file as it ships; the plugin is a
|
||||
JOINT_STEP generator whose conditioning rides in each lane's store and is read by the UNet's cross
|
||||
attention, and whose sampler is the core's discrete-time one (`RadGeneratorDecl::train_steps`).
|
||||
|
||||
```
|
||||
names the UNet under model.diffusion_model.*, CLIP ViT-L under
|
||||
conditioner.embedders.0.transformer.text_model.*, both as the file has them; OpenCLIP
|
||||
bigG renamed to transformers' CLIPTextModelWithProjection under
|
||||
conditioner.embedders.1.transformer.* (in_proj split into q/k/v_proj, c_fc/c_proj as
|
||||
fc1/fc2, ln_* as layer_norm*, text_projection transposed into a linear's weight); the VAE
|
||||
decoder in diffusers' names under vae.*. These are the names kohya's lora_unet_*,
|
||||
lora_te1_* and lora_te2_* adapters are written against
|
||||
text the prompt in CLIP windows: BOS, up to 75 tokens, EOS, padding to 77 (the core cuts them,
|
||||
RadGeneratorDecl::chunk_tokens), each window encoded on its own and causally. ViT-L (12
|
||||
layers, quick_gelu) and bigG (32 layers, gelu); the context is ViT-L's and bigG's
|
||||
PENULTIMATE hidden states side by side (2048 wide, no final norm); the pooled vector is
|
||||
bigG's LAST layer through final_layer_norm at the first window's EOS, through
|
||||
text_projection
|
||||
padding ViT-L's padding is EOS (49407), bigG's is token 0 ("!"), as the two tokenizers pad; the
|
||||
padded rows are part of the context the UNet attends to
|
||||
UNet 320/640/1280 channels at 1, 1/2, 1/4 of the latent; residual blocks (GroupNorm(32) eps
|
||||
1e-5, SiLU, 3x3 conv, the time embedding's projection added per channel, a 1x1 skip when
|
||||
the width changes); spatial transformers (GroupNorm eps 1e-6, linear proj_in/out, blocks
|
||||
of self attention, cross attention over the context and GEGLU, 64-wide heads) 2 deep at
|
||||
1/2, 10 deep at 1/4 and in the middle; skip connections concatenated after h
|
||||
added the time embedding (sinusoid of the timestep, cos first, 320 wide) plus label_emb of
|
||||
[pooled | sinusoids of (height, width), (0, 0), (height, width)] (2816 wide)
|
||||
VAE AutoencoderKL, 4 channels at 8x, the latent divided by 0.13025; run bf16
|
||||
sampler k-diffusion over 1000 scaled-linear timesteps (betas 0.00085..0.012): f32 latent lanes,
|
||||
the UNet's input x / sqrt(sigma^2 + 1), the timestep the nearest trained one (ComfyUI),
|
||||
guidance on the denoised estimates; Euler, Euler ancestral, DPM++ 2M on ComfyUI's
|
||||
normal, karras, exponential, sgm_uniform and simple schedules
|
||||
```
|
||||
|
||||
Each denoising pass runs the UNet once per entry at that entry's size: a convolution's image size
|
||||
comes from its operands, so two sizes cannot share a launch. The sampler ops run over every entry.
|
||||
Every 3x3 convolution is `im2col_nhwc` and a `gemm_nt_bias` over the weight read as
|
||||
`[cout, cin * 9]` (the checkpoint's order), so it carries a runtime LoRA like a linear; this is 9%
|
||||
faster than `conv2d_nhwc` over the UNet's shapes at 1024x1024, slower only at 1/1 with 320
|
||||
channels. conv_in and out.2 (4 channels) are direct convolutions.
|
||||
|
||||
Traps:
|
||||
|
||||
- **The context is the penultimate layer of both encoders.** hidden_states[-2], before any final
|
||||
norm; only the pooled vector goes through bigG's final norm, from its last layer.
|
||||
- **bigG's padding is not EOS.** Its tokenizer pads with "!"; reading the padding as EOS changes
|
||||
the context rows the UNet attends to (it does not change the pooled vector).
|
||||
- **The size conditioning is (height, width), not (width, height)**, each through its own
|
||||
256-wide sinusoid, after the pooled vector.
|
||||
- **open_clip's text_projection multiplies from the right** (x @ P); a linear's weight is P^T.
|
||||
- **bf16, not f16.** The release is f16 and the SDXL VAE overflows in f16; bf16 has f32's range.
|
||||
|
||||
Against a torch reference -- diffusers' text encoders, UNet and VAE in f32 under the same
|
||||
k-diffusion loop, schedule and Philox noise -- from the same seeds at 1024x1024 on one R9700 (relative
|
||||
L2; diffusers' own bf16 run against the same f32 one in brackets): ViT-L's context 0.28% (0.28%),
|
||||
bigG's 1.8% (2.0%), the pooled vector 0.9% (1.0%), the UNet's first evaluation 0.25% (0.31%); the VAE
|
||||
on the same latent 45.0 dB. Whole pictures (PSNR against f32; diffusers bf16 in brackets): SDXL 1.0
|
||||
Euler 31.3 dB (27.4), DPM++ 2M Karras 34.6 dB, Euler ancestral 24.8 dB (18.0); Illustrious-XL v2.0
|
||||
Euler 30.0 dB, Euler ancestral 22.3 dB (25.7), 832x1216 Euler 33.1 dB (28.3 against a reference
|
||||
given (width, height) for its size); NoobAI-XL V-Pred 1.0 (v prediction, zero terminal
|
||||
SNR) Euler 22.4 dB (22.6). A 91-token prompt's two windows against the same windows encoded by
|
||||
transformers in f32 (Illustrious): ViT-L 0.7% in each, bigG 1.6% and 2.2%, the pooled vector 1.3%.
|
||||
An image is the same bytes whether its pass carries other requests' images of other sizes or not.
|
||||
|
||||
---
|
||||
|
||||
# `flux3`: FLUX.3 [klein] and its base, an image generator and editor
|
||||
|
||||
`arch/flux3` declares a JOINT_STEP generator over three modes: the text, the reference pictures'
|
||||
@@ -968,6 +1059,64 @@ base guided 2.30, an edit with one reference picture 1.16.
|
||||
|
||||
---
|
||||
|
||||
# `anima`: Anima (Base, Aesthetic, Turbo), an image generator
|
||||
|
||||
`arch/anima` declares a JOINT_STEP generator, though its DiT is a cross-attention model: the
|
||||
conditioning pass leaves each lane's 512 context rows in its store, and every denoising step reads
|
||||
them back (the entry's text mode, `mode_src`) for the cross-attention's keys and values; the text
|
||||
rows the layout carries are never run through the DiT. Served on `/v1/images/generations`; it
|
||||
takes no reference pictures.
|
||||
|
||||
```
|
||||
text Qwen3-0.6B-Base over the prompt as it is (no template); its last hidden state after the
|
||||
final norm. An empty prompt is one <|endoftext|> (min_tokens 1), not " "
|
||||
adapter the LLM adapter: the prompt's T5 tokens (the container's second vocabulary) as query
|
||||
rows, embedded from a 32128-row table; six blocks of RMS-normed self-attention over them,
|
||||
cross-attention to the Qwen3 rows and a GELU MLP, 16 heads of 64, q and k RMS-normed and
|
||||
rotated (NeoX, theta 1e4) at their own row index on either side; out_proj and an RMS
|
||||
norm; zero-padded to 512 rows
|
||||
DiT Cosmos-Predict2's MiniTrainDIT at 2B: 28 blocks of 2048 (16 heads of 128); per block a
|
||||
self-attention (q/k RMS norms, a NeoX rotary of 22 + 21 + 21 frequency pairs over
|
||||
frame, row and column at 10000 x 4^(42/40); the frame is 0), a cross-attention to the
|
||||
512 context rows (q/k norms, no rotary) and a GELU MLP, each behind a LayerNorm without
|
||||
affine times (1 + scale) plus shift and added back times its gate
|
||||
modulation each of a block's three: Linear(256, 6144)(Linear(2048, 256)(silu(e))) + the shared
|
||||
AdaLN-LoRA term Linear(2048, 6144)(silu(Linear(2048, 2048)(t))), t the sinusoid of the
|
||||
step's sigma (a timestep in [0, 1], [cos | sin]) and e its RMS norm
|
||||
patches a token is 2 x 2 latents, 64 values channel-major; the patch embedding was trained on 68
|
||||
(a padding-mask channel, always zero), read over its first 64 columns (RAD_MAP_COLS);
|
||||
the final linear's rows reordered from (row, column, channel) to channel-major
|
||||
VAE the Qwen-Image VAE under ComfyUI's Wan 2.1 names, 16 channels at 8x; the latent
|
||||
denormalised with Wan 2.1's statistics in f32
|
||||
schedule ComfyUI's FLOW sampling (multiplier 1, shift 3) and its `simple` scheduler over 1000
|
||||
timesteps (sigma_grid), Euler steps; guidance uncond + s (cond - uncond). Base and
|
||||
Aesthetic: 30 steps, s 4, the card's negative prompt; Turbo: 10 steps, unguided. The
|
||||
variant is `anima.variant` (rad-convert --set)
|
||||
```
|
||||
|
||||
Traps:
|
||||
|
||||
- **T5 tokens, not Qwen3's, are the queries.** The adapter reads the same prompt twice: Qwen3's
|
||||
ids for the source, T5's for the queries; T5's normaliser is SentencePiece's precompiled map
|
||||
over extended grapheme clusters (core/text/tokenizer_grapheme.h). Reading the queries off Qwen3's
|
||||
tokens gives a plausible, wrong picture.
|
||||
- **The padding rows are attended to.** The context is zero-padded to 512 rows and the DiT's
|
||||
cross-attention reads all 512: a zero row is a zero key and value, which still takes its share
|
||||
of the softmax.
|
||||
- **The DiT keys have two spellings.** Base ships `net.blocks.N...`, Aesthetic 1.1 and Turbo 1.1
|
||||
`model.diffusion_model.blocks.N...`; the plugin reads the prefix off the checkpoint at convert
|
||||
and keeps the file's own names as the name map's sources.
|
||||
- **The empty negative prompt is not " ".** ComfyUI encodes "" as one padding token for Qwen3 and
|
||||
</s> for T5; the core keeps an empty prompt empty for a model with `min_tokens`.
|
||||
|
||||
Against ComfyUI in bf16 on an RTX 4090 from the same noise: the DiT's velocity at sigma 1 rel
|
||||
0.48% (cos 0.99999) from the bf16 container and 1.5% from the block-fp8 one, the adapter's 512 rows
|
||||
rel 1.9% (Qwen3's output in bf16 against ComfyUI's f32), the VAE on the same latent 46.9 dB; three
|
||||
1024 x 1024 pictures after 30 guided steps 32.8, 36.0 and 39.0 dB from bf16, 26.7, 26.0 and 28.6 dB
|
||||
from fp8 (the same picture to the eye).
|
||||
|
||||
---
|
||||
|
||||
# `qwen3asr`: speech to text
|
||||
|
||||
`model_type: qwen3_asr` (`Qwen3ASRForConditionalGeneration`), served from the checkpoint as it
|
||||
|
||||
@@ -145,7 +145,9 @@ the cards the engine runs on.
|
||||
| `qwen-image-2.1.yaml` | `qwen-image-2.1-fp8.rad` | Qwen-Image 2.1 as block fp8 on two cards: OpenAI's images API, generation and edits |
|
||||
| `qwen-image-2.1-turbo.yaml` | `qwen-image-2.1-turbo-fp8.rad` | Qwen-Image 2.1 Turbo, the same in 8 steps |
|
||||
| `krea-2-turbo.yaml`, `krea-2-raw.yaml` | `krea-2-turbo-fp8.rad`, `krea-2-raw-fp8.rad` | Krea 2 Turbo and Raw as block fp8: text to image on one card (`RADIANCE_GPU`) |
|
||||
| `anima.yaml` | `anima-aesthetic-fp8.rad` | Anima Aesthetic as block fp8: text to image on one card (`RADIANCE_GPU`); the Base and Turbo containers serve the same way |
|
||||
| `flux-3-klein.yaml` | `flux-3-klein-fp8.rad` | FLUX.3 [klein] as block fp8: generation and edits on one card (`RADIANCE_GPU`); the base container serves the same way |
|
||||
| `sdxl.yaml` | `illustrious-xl-v2.0-bf16.rad` | Stable Diffusion XL in bf16 (here Illustrious-XL v2.0; any single-file SDXL checkpoint converts the same way): text to image on one card (`RADIANCE_GPU`) |
|
||||
| `qwen3-asr-1.7b.yaml` | `Qwen3-ASR-1.7B-hf/` (the checkpoint) | Qwen3-ASR 1.7B: `/v1/audio/transcriptions` and live `/v1/realtime`, on one card (`RADIANCE_GPU`) |
|
||||
| `minimax-h3.yaml` | `minimax-h3-fp8.rad` | MiniMax-H3 as block fp8: video with its stereo soundtrack on `/v1/videos`, two cards and about 39 GiB of pinned host memory |
|
||||
| `fasth3.yaml` | `fasth3-8-step-v2-fp8.rad` | FastVideo's FastH3 8-Step V2, the same in eight steps |
|
||||
|
||||
+134
-11
@@ -277,6 +277,7 @@ and runs.
|
||||
| `embgemma2` | EmbeddingGemma 2, an embedding model (§5.6) |
|
||||
| `qwenimage21` | Qwen-Image 2.1 and 2.1-Turbo, an image model (§5.6) |
|
||||
| `krea2` | Krea 2 Raw and Turbo, an image model from text (§5.6) |
|
||||
| `anima` | Anima Base, Aesthetic and Turbo, an anime and illustration image model from text (§5.6) |
|
||||
| `flux3`, `flux3distilled` | FLUX.3 [klein] and its base, an image model that also edits (§5.6); one plugin under the two names the releases give themselves |
|
||||
| `qwen3asr_bf16` | Qwen3-ASR, speech to text from the checkpoint as it ships (§5.14) |
|
||||
| `minimaxmusic3` | MiniMax-Music3, songs from a description and lyrics (§5.15) |
|
||||
@@ -405,6 +406,36 @@ rad-convert /srv/models/krea/Krea-2-Turbo -o krea-2-turbo-fp8.rad \
|
||||
rad-convert /srv/models/black-forest-labs/flux-3-image-klein -o flux-3-klein-fp8.rad \
|
||||
--recipe data/recipes/flux-3-klein-fp8.recipe
|
||||
|
||||
# A Krea 2 finetune shipped as one DiT file in Krea's key names (civitai, ComfyUI): rewritten as the
|
||||
# transformer/ of a directory holding the release's other parts (Turbo's model_index.json for a Turbo
|
||||
# finetune, Raw's for a Raw one); a plain-fp8 file keeps its codes under krea-2-fp8-unscaled.recipe
|
||||
P=/srv/models/lustify-krea2; mkdir -p $P/transformer
|
||||
cp -r /srv/models/krea/Krea-2-Turbo/{model_index.json,scheduler,text_encoder,tokenizer,vae} $P/
|
||||
cp /srv/models/krea/Krea-2-Turbo/transformer/config.json $P/transformer/
|
||||
scripts/krea2_native.py lustifyNSFWCheckpoint_v10Krea2_fp8.safetensors \
|
||||
$P/transformer/diffusion_pytorch_model.safetensors
|
||||
rad-convert $P -o lustify-krea2-turbo-fp8.rad --recipe data/recipes/krea-2-fp8-unscaled.recipe
|
||||
|
||||
# Anima, an image model (§5.6): the release's three single files merged (--add), Qwen3-0.6B-Base's
|
||||
# config.json and tokenizer.json (--config: the repository or a directory with just those two), and
|
||||
# ComfyUI's T5 tokenizer (comfy/text_encoders/t5_tokenizer/tokenizer.json, with its
|
||||
# tokenizer_config.json beside it) as the second vocabulary. The variant (base, aesthetic, turbo)
|
||||
# sets the defaults; anima-bf16.recipe keeps every linear bf16
|
||||
A=/srv/models/circlestone-labs/Anima/split_files
|
||||
rad-convert $A/diffusion_models/anima-aesthetic-v1.1.safetensors \
|
||||
--add $A/text_encoders/qwen_3_06b_base.safetensors --add $A/vae/qwen_image_vae.safetensors \
|
||||
--config /srv/models/Qwen/Qwen3-0.6B-Base --tokenizer2 /srv/ComfyUI/comfy/text_encoders/t5_tokenizer/tokenizer.json \
|
||||
--arch anima --set anima.variant=aesthetic -o anima-aesthetic-fp8.rad \
|
||||
--recipe data/recipes/anima-fp8.recipe
|
||||
|
||||
# Stable Diffusion XL or any of its finetunes (Illustrious, NoobAI, Pony, ...), an image model
|
||||
# (§5.6): the single .safetensors as civitai and Hugging Face publish it (Stability's layout, read as
|
||||
# it ships), bf16 throughout (6.4 GiB, one card). The file carries no tokenizer: CLIP's tokenizer.json
|
||||
# (openai/clip-vit-large-patch14) is passed beside it
|
||||
rad-convert /srv/models/OnomaAIResearch/Illustrious-XL-v2.0/Illustrious-XL-v2.0.safetensors \
|
||||
-o illustrious-xl-v2.0-bf16.rad --recipe data/recipes/sdxl-bf16.recipe \
|
||||
--tokenizer /srv/models/openai/clip-vit-large-patch14/tokenizer.json
|
||||
|
||||
# LTX-2.5, video with sound (§5.16): the diffusers pipeline directory, latent_upsampler/ included
|
||||
# for the distilled release's two-stage recipe; fp8 blocks for the text encoder, the connectors and
|
||||
# the DiT, or bf16 (both recipes keep the vocoders f32, which they run in)
|
||||
@@ -515,6 +546,13 @@ rad-convert /srv/models/amd/GLM-5.3-Flash-Quark-MXFP4 \
|
||||
rad-convert /srv/models/unsloth/Qwen3.8-27B-NVFP4 --draft-model /srv/models/z-lab/Qwen3.8-27B-DFlash2 \
|
||||
--recipe data/recipes/q38-27b-nvfp4-df2.recipe -o q38-27b-nvfp4-df2.rad
|
||||
|
||||
# A bf16 Qwen3.8-27B or finetune (here orcarouter's Uncensored) with the DFlash2 drafter: the trunk
|
||||
# rounded to MXFP4 once, the head block fp8; the --set keys select the quantised plugin
|
||||
rad-convert /srv/models/orcarouter/Qwen3.8-27B-Uncensored --draft-model /srv/models/z-lab/Qwen3.8-27B-DFlash2 \
|
||||
--recipe data/recipes/q38-27b-mxfp4-df2.recipe \
|
||||
--set quantization_config.quant_method=fp8 --set quantization_config.fmt=e4m3 \
|
||||
-o qwen3.8-27b-uncensored-mxfp4.rad
|
||||
|
||||
# An int4 W4A16 Qwen3.8-27B (compressed-tensors AWQ or GPTQ, AutoRound's auto_gptq; here ukisai's
|
||||
# Swift 1.5 W4A16-AWQ, and its INT4 and W4A16-AutoRound the same way): the shipped grids on the
|
||||
# 4-bit GEMMs, the head block fp8
|
||||
@@ -1345,11 +1383,57 @@ below.
|
||||
Refused at startup or load, by name: DoRA, embedding or `lm_head` LoRA, `modules_to_save`, trained
|
||||
biases, PEFT's `layer_replication`, QA-LoRA and activated LoRA, a module the base does not have, and
|
||||
a module some op cannot carry -- a routed MoE expert, a rotated (ParoQuant) or otherwise transformed
|
||||
weight, a GEMM fed int8 codes in the WMMA's step order (`w4a8`, `w8a8`, `w2a8`). Adapters serve models that generate text: an
|
||||
image, audio or video generator and an embedding model refuse `--lora` and `--max-loras`. A fused
|
||||
GEMM over a targeted weight (the fp8 gated gate_up fold) is not used while LoRA is on, for base
|
||||
requests too; the unfused pair runs instead. A drafter keeps the base's weights: proposals are
|
||||
still verified by the adapter, so output is exact and only the acceptance rate can drop.
|
||||
weight, a GEMM fed int8 codes in the WMMA's step order (`w4a8`, `w8a8`, `w2a8`). An audio
|
||||
generator and an embedding model refuse `--lora` and `--max-loras`; image and video generators take
|
||||
adapter files instead (§4.9.2). A fused GEMM over a targeted weight (the fp8 gated gate_up fold) is
|
||||
not used while LoRA is on, for base requests too; the unfused pair runs instead. A drafter keeps the
|
||||
base's weights: proposals are still verified by the adapter, so output is exact and only the
|
||||
acceptance rate can drop.
|
||||
|
||||
### 4.9.2 LoRA files for image and video models
|
||||
|
||||
The LoRAs shared for image and video models (Civitai, Hugging Face) are single `.safetensors` files,
|
||||
named after the model's original code and written by whichever trainer or UI made them. Radiance
|
||||
reads them as they come, on Krea 2, Anima, Stable Diffusion XL and its finetunes (Illustrious,
|
||||
NoobAI, Pony), Qwen-Image 2.1, MiniMax H3, FLUX.3 [klein] and LTX-2.5:
|
||||
|
||||
```sh
|
||||
radiance --model krea-2-turbo-fp8.rad --lora-dir /loras --lora film=/loras/film-grain.safetensors
|
||||
```
|
||||
|
||||
- **Spellings:** kohya (`lora_unet_blocks_0_attn_wq.lora_down/up` + `alpha`), ComfyUI
|
||||
(`diffusion_model.*.lora_A/B` or `lora_down/up`), PEFT/diffusers (`transformer.*.lora_A/B`,
|
||||
`.default`), bare keys, and the checkpoint's own names. Each model declares how its original
|
||||
module names map onto the container's (a fused `qkv` onto separate q, k and v, a SwiGLU whose
|
||||
halves are ordered the other way), so a file trained against either layout lands on the same
|
||||
weights.
|
||||
- **Kinds:** LoRA and LoCon (`alpha / rank * up @ down`; on SDXL a LoCon's convolutions too, its
|
||||
3 x 3 `down` read flattened as the UNet's im2col GEMMs read theirs), LoHa (`hada_w*`, applied exactly as a
|
||||
product of rank1 x rank2), LoKr (`lokr_w*`, by its Kronecker structure) and full deltas (`.diff`).
|
||||
DoRA, OFT and Tucker cores are refused by name; bias and norm deltas are reported and left out.
|
||||
- **Choosing per request:** `/v1/images/generations`, `/v1/images/edits` and `/v1/videos` take
|
||||
`"loras": ["film", "ink:0.6", {"name": "style/watercolor", "weight": 0.8}]` (or an object
|
||||
`{"film": 1, "ink": 0.6}`), and Stable Diffusion web UI tags in the prompt, `<lora:film:0.8>`,
|
||||
which are taken out of the prompt. A strength not given is 1; several adapters stack.
|
||||
`GET /v1/loras` lists what a request may name: the `--lora` files and every `NAME.safetensors`
|
||||
under `--lora-dir` (subdirectories one level deep, as `sub/NAME`).
|
||||
- **Slots:** a slot holds one combination of adapters at their strengths. The first request that
|
||||
asks for a combination composes it into a free slot, or into the least recently used one no running
|
||||
request holds (milliseconds to a second, logged with what it left out); later requests find it
|
||||
there. Requests with different combinations run in separate passes. `--max-loras` sets the slot
|
||||
count (default: the number of `--lora`, 2 with `--lora-dir` alone).
|
||||
- **Rank:** `--max-lora-rank` (default 64 for a generator) is the rank every checkpoint module's
|
||||
slot holds. The slots are VRAM the weights and the arena would otherwise have (startup prints
|
||||
their size); LTX-2.5, which fills one card on its own, fits one slot at rank 16. Stacked adapters whose ranks fit it, and LoHa and LoKr within it, are held exactly;
|
||||
past it the sum is truncated to its best rank-R approximation, and the log says how much of the
|
||||
delta was kept.
|
||||
- **What carries an adapter:** every plain GEMM of the denoiser (attention, feed-forward, the text
|
||||
fusion or refiner, embedders and modulation where they are plain), and of the text encoder where
|
||||
adapter files train it (Anima's Qwen3, SDXL's two CLIPs as kohya's `lora_te1_` / `lora_te2_`;
|
||||
CLIP-L's last layer, whose output SDXL never reads, has nothing to adapt). An adapter module the model has no
|
||||
such GEMM for is reported and skipped, as UIs do.
|
||||
- `POST /v1/load_lora_adapter {"lora_name": "x", "lora_path": "/file.safetensors"}` adds a file
|
||||
under a name; unload removes it and frees the slots of every combination using it.
|
||||
|
||||
### 4.10 Every flag
|
||||
|
||||
@@ -1368,7 +1452,7 @@ still verified by the adapter, so output is exact and only the acceptance rate c
|
||||
|
||||
| flag | default | |
|
||||
|---|---|---|
|
||||
| `--max-num-batched-tokens N` | 8192 | largest token count one step may carry |
|
||||
| `--max-num-batched-tokens N` | 2048 | largest token count one step may carry |
|
||||
| `--prefill-interleave N` | 0 (off) | decode-only steps after each prefill chunk while other sequences decode (§4.5), at most 64 |
|
||||
| `--busy-prefill-chunk MODE` | auto | a prefill chunk's share of a step that has other work: `auto` leaves decode rows and waiting requests their room (§4.5), `off` takes the whole step, `N` holds it to N tokens |
|
||||
| `--max-num-seqs N` | 256 | largest number of sequences one step may carry |
|
||||
@@ -1392,9 +1476,10 @@ still verified by the adapter, so output is exact and only the acceptance rate c
|
||||
|
||||
| flag | default | |
|
||||
|---|---|---|
|
||||
| `--lora NAME=PATH` | none | serve a PEFT LoRA adapter as model NAME; repeatable |
|
||||
| `--max-loras N` | the number of `--lora` | adapter slots resident at once; 0 with no `--lora` is off |
|
||||
| `--max-lora-rank R` | 16 | the rank each slot is sized for |
|
||||
| `--lora NAME=PATH` | none | serve a LoRA adapter: a PEFT directory as model NAME (text), a `.safetensors` file requests name in `loras` (image and video, §4.9.2); repeatable |
|
||||
| `--lora-dir DIR` | none | image and video models: requests may name any `NAME.safetensors` under DIR |
|
||||
| `--max-loras N` | the number of `--lora` (2 with `--lora-dir` alone) | adapter slots resident at once; 0 with no adapter is off |
|
||||
| `--max-lora-rank R` | 16 text, 64 image and video | the rank each slot is sized for |
|
||||
| `--lora-target-modules LIST` | the adapters' own | HF module names adapters may target |
|
||||
|
||||
**Host tier for finished conversations**
|
||||
@@ -1756,7 +1841,7 @@ becomes up to 280 tokens by default (`--image-tokens`, or a request's `image_tok
|
||||
`document`, `Retrieval-query`, `STS`, ...) and applies to text and content-part inputs; a model that
|
||||
states a default prompt applies it when the request names none.
|
||||
|
||||
**An image model** (Qwen-Image 2.1 or 2.1-Turbo, Krea 2, FLUX.3 [klein]) serves OpenAI's images API only; completions, chat
|
||||
**An image model** (Qwen-Image 2.1 or 2.1-Turbo, Krea 2, FLUX.3 [klein], Anima) serves OpenAI's images API only; completions, chat
|
||||
and embeddings answer 501. OpenAI images clients (Open WebUI, the OpenAI SDKs) work unchanged; the
|
||||
picture always comes back in the response. The engine sizes the step, batch and context for an image
|
||||
model itself (`--max-num-batched-tokens` and `--max-model-len` from the model's largest pass,
|
||||
@@ -1829,6 +1914,44 @@ pictures, each shrunk to 1024x1024 of area when larger. The guidance scale is `g
|
||||
`true_cfg_scale` (one of them), in the model card's terms. FLUX.3's pipeline can rewrite a prompt
|
||||
with a separate language model first; radiance reads the prompt as given.
|
||||
|
||||
**Anima** makes RGB pictures, 1024x1024 by default, sides rounded down to multiples of 16, up to
|
||||
1536x1536 (9216 latent tokens; the card's range is 512x512 to 1536x1536). Base and Aesthetic run 30
|
||||
steps at guidance 4 (`uncond + s (cond - uncond)`, so 1 is off) against the card's negative prompt
|
||||
(`worst quality, low quality, score_1, score_2, score_3, artist name, blurry, jpeg artifacts,
|
||||
chromatic aberration`); Turbo runs 10 unguided. The sampler is ComfyUI's Euler over its `simple`
|
||||
schedule at shift 3, so a seed's noise aside, a picture is what ComfyUI's `euler` / `simple`
|
||||
workflow makes. The prompt is read as written, Danbooru tags and natural language as the card
|
||||
describes: ComfyUI's `(word:1.2)` weighting and its `\(` escapes are not interpreted, so write
|
||||
`fern (sousou no frieren)` rather than `fern \(sousou no frieren\)`. A prompt is at most 512
|
||||
tokens to either of its two tokenizers. Anima reads only text, so `/v1/images/edits` answers 501.
|
||||
It is under the CircleStone Labs non-commercial license (the pictures may be used commercially).
|
||||
On one R9700 a 1024x1024 picture takes 8.5 s from the Aesthetic or Base fp8 container (30 guided
|
||||
steps) and 12.0 s from bf16; Turbo takes 1.6 s (fp8) and 2.2 s (bf16); 1536x1536 takes 24.8 s (fp8).
|
||||
The fp8 pictures look the same as bf16's; against ComfyUI from the same noise bf16 is 33 to 39 dB,
|
||||
fp8 26 to 29 dB (docs/ARCHITECTURES.md).
|
||||
|
||||
**Stable Diffusion XL** and its finetunes (Illustrious, NoobAI, Pony: any single-file SDXL
|
||||
checkpoint, §3.2) take the same fields and two more, `sampler` and `scheduler`, by ComfyUI's names:
|
||||
|
||||
| field | |
|
||||
|---|---|
|
||||
| `sampler` | `euler`, `euler_ancestral` (the default) or `dpmpp_2m` |
|
||||
| `scheduler` | `normal` (the default), `karras`, `exponential`, `sgm_uniform` or `simple` |
|
||||
|
||||
A model sampled by flow matching refuses both fields. SDXL makes RGB pictures, 1024x1024 by default,
|
||||
sides rounded down to multiples of 32, up to 36864 latent tokens (1536x1536, or that area at another
|
||||
aspect: 2048x1152). It runs 28 steps at guidance 6 (`guidance_scale`, uncond + s (cond - uncond))
|
||||
against an empty negative prompt unless the request names one; guidance 1 turns it off. A prompt
|
||||
longer than CLIP's 75 tokens is read in windows of 75, each encoded on its own and laid end to end
|
||||
(A1111's and ComfyUI's long-prompt behaviour), up to 8 windows. Emphasis syntax such as
|
||||
`(masterpiece:1.2)` is not interpreted: the parentheses and the number are read as text. The noise
|
||||
is radiance's own (the same seed gives the same picture here, not the picture ComfyUI gives).
|
||||
`/v1/images/edits` answers 501: there is no image-to-image or inpainting yet. A v-prediction
|
||||
checkpoint (NoobAI-XL V-Pred, marked by its `v_pred` tensor) is sampled as one, with the zero
|
||||
terminal SNR schedule when the checkpoint says so (`ztsnr`). On one R9700 a 1024x1024 picture at 28
|
||||
guided steps takes about 5.1 s and 1536x1536 at 25 about 10.8 s; images in flight together share
|
||||
passes but not launches (the UNet runs once per image and branch), so two take twice as long.
|
||||
|
||||
### 5.7 Request fields
|
||||
|
||||
| field | notes |
|
||||
@@ -2748,7 +2871,7 @@ is the part of a log to paste into an issue. Its sections:
|
||||
warning is also printed as a `W` line of its own.
|
||||
|
||||
```
|
||||
I STARTUP REPORT -- radiance 1.9.0
|
||||
I STARTUP REPORT -- radiance 1.10.0
|
||||
I CONFIGURATION -- every option, the value in force, and where it came from
|
||||
I --model /models/flashnext.rad [command line]
|
||||
I --tp 2 [command line]
|
||||
|
||||
+60
-2
@@ -219,6 +219,7 @@ at once. Run it before adding a kernel plugin; the loader names only the first c
|
||||
| `gelu_mul` | `M`(range) `n` `dtype` | `gate_up` → `y` (splits `[M,2n]` into gelu·up, tanh approx) |
|
||||
| `seg_sinusoid` | `M`(range) `n` `period` `max_timescale`:f64/opt `cu_div`/opt `dtype` | `cu_seqlens` → `y` |
|
||||
| `gelu` / `silu` | `M`(range) `n` `dtype` | `x` → `y` |
|
||||
| `gelu_quick` | `M`(range) `n` `dtype` | `x` → `y` |
|
||||
| `cast` | `M`(range) `n` `from` `to` | `x` → `y` |
|
||||
| `softmax` | `M`(range) `n` `dtype` | `x` → `y` |
|
||||
| `sigmoid` | `M`(range) `n` `dtype` | `x` → `y` |
|
||||
@@ -230,6 +231,10 @@ at once. Run it before adding a kernel plugin; the loader names only the first c
|
||||
`gelu` (exact erf) and `silu` share one schema; `silu` has a row of its own because a row names one
|
||||
op.
|
||||
|
||||
**`gelu_quick`** is CLIP's `quick_gelu`, `x * sigmoid(1.702 x)`, rounded where torch stores each
|
||||
tensor in a reduced dtype: `a = rd(1.702 x)`, `s = rd(1 / (1 + exp(-a)))`, `y = rd(x s)`, `rd` the
|
||||
rounding to `y`'s dtype and the arithmetic f32 (CLIP-L's feed-forward in SDXL's text encoder).
|
||||
|
||||
**`rmsnorm`** is `y = x * rsqrt(mean(x^2) + eps) * (w + wadd)`; `wadd` is GemmaRMSNorm's `1 +`,
|
||||
added in f32. `mult` scales the normed row before its one rounding, for a residual branch weighted
|
||||
by a constant (Gemma 4's audio feed-forward adds half its output). For a power of two this equals
|
||||
@@ -732,6 +737,7 @@ butterfly), so every tile is byte-identical (`tests/r4d_emu/test_f32.cpp`).
|
||||
|---|---|---|
|
||||
| `lora_shrink` | `M`(range) `K` `R` `S` `group`/opt `dtype` | `a`, `a_scale`?, `slot`, `lora_a` → `t` |
|
||||
| `lora_expand` | `M`(range) `N` `R` `S` `dtype` | `t`, `slot`, `lora_b`, `scale`, `y`:inout |
|
||||
| `lora_expand_mm` | `M`(range) `N` `R` `S` `dtype` | `t`, `slot`, `lora_b`, `scale`, `y`:inout |
|
||||
|
||||
The two halves of `y += scale ⊙ (B · (A · x))` at a trunk GEMM, issued by the core right after the
|
||||
GEMM in the GEMM's own row slice, with several adapters and no adapter mixed in one step; a step
|
||||
@@ -740,7 +746,9 @@ an i32 per row naming its adapter's pool slot -- the step batch's `RadBatch::lor
|
||||
GEMM's first row on; **a row with `slot < 0 || slot >= S` is a base row and neither op touches
|
||||
it**: `lora_shrink` writes nothing into its `t` row, and `lora_expand` does not read or write its
|
||||
`y` row at all — so a base row stays bit for bit what the GEMM wrote, where `y + 0` would already
|
||||
have turned a -0 into +0.
|
||||
have turned a -0 into +0. On an image or video generator's pass every row runs the same adapter,
|
||||
and `slot` is a run of the core's slot-row table holding that slot's index in every element, so the
|
||||
GEMM's rows need not be the pass's token rows.
|
||||
|
||||
- `lora_shrink`: `t[m, j] = Σ_k x(m, k) · lora_a[s, j, k]`, `s = slot[m]`, f32 accumulate.
|
||||
`a`/`a_scale` are the GEMM's own first two operands, and `x(m, k)` is the value `gemm_nt_q` uses
|
||||
@@ -756,6 +764,13 @@ have turned a -0 into +0.
|
||||
`[S, N, R]` bf16 and `scale` `[S, N]` f32 — per output column, so a fused projection whose parts
|
||||
carry different `alpha / r` is one launch.
|
||||
|
||||
- `lora_expand_mm`: `lora_expand` with `t` rounded to bf16 and the sum over `j` in any order,
|
||||
`y[m, n] = y[m, n] + scale[s, n] · Σ_j bf16(t[m, j]) · lora_b[s, n, j]`, f32 accumulate, one
|
||||
rounding to `y`; base rows as `lora_expand`. A row's bytes may depend on `M`. The core declares
|
||||
it in place of `lora_expand` for an image or video generator, whose passes are thousands of rows
|
||||
of one adapter and where the exact row's scalar sum is most of the adapter's cost; libr4d runs
|
||||
it on the WMMA over 64 x 64 tiles.
|
||||
|
||||
`a`, `a_scale` and `y` may be row and column slices of wider buffers; every row stride is the
|
||||
tensor's. The pools are ordinary inputs and not weights: the engine owns them as program buffers
|
||||
and copies an adapter into a slot between steps, so a recorded pass replays the same pointers and
|
||||
@@ -1006,8 +1021,11 @@ says which (`libref/ref_gen.cpp`).
|
||||
| `lane_store` | `M`(range) `n` `stride` `dtype` | `src`, `lane`, `dst`:inout |
|
||||
| `randn_lanes` | `M`(range) `n` `stride` `dtype` | `flags`, `seed`, `lane`, `cu_seqlens`, `dst`:inout |
|
||||
| `flow_euler` | `M`(range) `n` `stride` `dtype` | `v`, `sigma`, `sigma_next`, `cfg`, `pair`, `lane`, `flags`, `seed`, `cu_seqlens`, `inp_lat`?, `inp_mask`?, `state`:inout, `preview`:inout? |
|
||||
| `kd_input` | `M`(range) `n` `stride` `dtype` | `sigma`, `pair`, `lane`, `flags`, `seed`, `cu_seqlens`, `state`:inout → `y` |
|
||||
| `kd_step` | `M`(range) `n` `stride` `pred` `dtype` | `out`, `sigma`, `sigma_next`, `sigma_prev`, `cfg`, `pair`, `lane`, `flags`, `seed`, `sampler`, `step`, `cu_seqlens`, `state`:inout, `hist`:inout, `preview`:inout? |
|
||||
| `chan_affine` | `M`(range) `n` `mul` `add` `mode` `dtype` `round`/opt | `x` → `y` |
|
||||
| `conv2d_nhwc` | `M`(range) `cin` `cout` `k` `stride` `pad` `up` `dtype` | `x`, `w`w, `b`w → `y` |
|
||||
| `im2col_nhwc` | `M`(range) `cin` `k` `stride` `pad` `up` `dtype` | `x` → `y` |
|
||||
| `l2norm_chan` | `M`(range) `n` `act` `dtype` | `x`, `gamma`w → `y` |
|
||||
| `d2s_add` | `M`(range) `cin` `cout` `ft` `dtype` | `x`, `y`:inout |
|
||||
| `s2d_avg_add` | `M`(range) `cin` `cout` `ft` `dtype` | `x`, `y`:inout |
|
||||
@@ -1057,6 +1075,34 @@ source into every listed lane (a repainted picture's latent into each of its ima
|
||||
`x' = bf16(m x' + (1 - m)((1 - sigma_next) src + sigma_next noise))` with `m` the lane's f32
|
||||
`inp_mask` row, `src` its `inp_lat` row and `noise` the seed's stream.
|
||||
|
||||
**The k-diffusion sampler.** A denoiser trained on discrete timesteps of a variance-preserving
|
||||
schedule (SDXL; eps- or v-prediction) is sampled as k-diffusion samples it, in the
|
||||
variance-exploding form `x = x0 + sigma eps`: the lane holds `x` in f32 (`state` and `hist` are f32
|
||||
`[lanes * stride, n]`), the model reads `c_in x` with `c_in = 1 / sqrt(sigma^2 + 1)`, and its output
|
||||
`out` (`dtype`, in the pass's compact image order bounded by `cu_seqlens`) becomes the clean
|
||||
estimate. Entries, pairs, lanes, flags and seeds are `flow_euler`'s; `sigma`, `sigma_next`,
|
||||
`sigma_prev` and `cfg` are f32 `[n_seq]`, `sampler` and `step` i32 `[n_seq]`. Every product and sum
|
||||
is one f32 rounding; `log`, `expm1` and `sqrt` are the library's. A repaint (flag 2) is refused.
|
||||
|
||||
- `kd_input`: for every entry with `pair != -2`, a first step (flag 1) sets the lane to the seed's
|
||||
normal stream times `sqrt(1 + sigma^2)` (`rad_philox_normal(seed, k n + c)`, the start of a
|
||||
schedule at the model's largest sigma); then `y = rd(x / sqrt(sigma^2 + 1))` at the entry's rows
|
||||
and, when `pair >= 0`, at the pair's rows too, so the negative entry reads the same latent without
|
||||
a second writer.
|
||||
- `kd_step`: for every entry with `pair != -2`, with `x` the lane's value,
|
||||
`D(o) = x - sigma o` (`pred` `eps`) or `x / (sigma^2 + 1) - o sigma / sqrt(sigma^2 + 1)` (`v`),
|
||||
guided as `D = D(o_u) + cfg (D(o_c) - D(o_u))` against the pair's rows (`D(o_c)` without one);
|
||||
flag 4 writes `D` to the lane's `preview`. Then by `sampler`:
|
||||
0, Euler: `x' = x + (sigma_next - sigma)(x - D) / sigma`;
|
||||
1, Euler ancestral (eta 1): `sigma_up = min(sigma_next, sqrt(sigma_next^2 (sigma^2 -
|
||||
sigma_next^2) / sigma^2))`, `sigma_down = sqrt(sigma_next^2 - sigma_up^2)`,
|
||||
`x' = x + (x - D) / sigma (sigma_down - sigma)`, plus `sigma_up` times the seed's stream
|
||||
`1 + step` (`rad_philox_normal_s`, element `k n + c`) while `sigma_next > 0`;
|
||||
2, DPM++ 2M: `x' = D` at `sigma_next` 0; otherwise with `t = -ln sigma`, `h = -ln sigma_next - t`,
|
||||
`x' = (sigma_next / sigma) x - expm1(-h) D'`, where `D' = D` on a first step and otherwise
|
||||
`(1 + 1/(2r)) D - (1/(2r)) hist` with `r = (t + ln sigma_prev) / h`.
|
||||
Every step stores `D` to `hist` for the next. Any other sampler is refused.
|
||||
|
||||
**Images** are `[height, width * channels]`, dense, and the ops read both sizes off the operand
|
||||
shapes: an image's size belongs to a request, and a parameter is fixed at declare.
|
||||
|
||||
@@ -1065,6 +1111,16 @@ shapes: an image's size belongs to a request, and a parameter is fixed at declar
|
||||
is `k/2` zeros a side, `down` is none above and left and one below and right
|
||||
(`ZeroPad2d((0,1,0,1))` before a stride-2 conv), `causal` is `k - 1` rows above, none below and
|
||||
`k/2` columns a side (causal along the rows: LTX-2's audio VAE). f32 accumulation, the bias added, one rounding.
|
||||
- `im2col_nhwc`: `conv2d_nhwc`'s receptive fields as rows, so a convolution is a GEMM against the
|
||||
checkpoint's own weight. `x` is the image `[Hin, Win * cin]` (rows at their own pitch), read
|
||||
through `up`, `pad` and `stride` as `conv2d_nhwc` reads it; `y` is `[Ho * Wo, cin * k * k]`, its
|
||||
rows exactly the output pixels, and row `oy * Wo + ox`, column `(ci * k + i) * k + j` holds the
|
||||
value `conv2d_nhwc` multiplies `w[o, ci, i, j]` by, 0 in the padding. That column order is the
|
||||
weight's own `[cout, cin, k, k]` flattened, so `y @ w.reshape(cout, cin k k)^T + b` (a
|
||||
`gemm_nt_bias`) is the convolution with the weight as stored, and a runtime LoRA over that GEMM
|
||||
reads a conv adapter's down projection `[rank, cin, k, k]` flattened the same way. A copy: no
|
||||
arithmetic, the bits moved. libr4d stages a block's k input rows in LDS so its reads and its
|
||||
stores are both coalesced; it serves `k` up to 7 and `stride` and `up` 1 or 2.
|
||||
- `l2norm_chan`: each pixel's channels to unit L2 (eps 1e-12), times `sqrt(n)`, times `gamma`
|
||||
(three roundings), then `act` `none` or `silu`.
|
||||
- `chan_affine`: `mul` and `add` are space-separated lists of `n` values, each rounded to bf16;
|
||||
@@ -1464,7 +1520,9 @@ Every op honours its activation operands' row pitches. `rd` is a rounding into t
|
||||
and `rstd_g`, and the rest is the implementation's scratch (partial sums of up to 1024 parts a
|
||||
group; libref leaves it untouched). A kernel may take several launches but must be deterministic,
|
||||
a fixed reduction order with no float atomics. `y` may be the same memory as `x`. `w` and `b`
|
||||
`[n]`, bf16 or f32. MiniMax-H3: `n` 512, `groups` 32, `eps` 1e-5.
|
||||
`[n]`, bf16 or f32. MiniMax-H3: `n` 512, `groups` 32, `eps` 1e-5; SDXL's UNet 320 to 2560
|
||||
channels in 32 groups (10 to 80 a group), its VAE 128 to 512. libr4d serves `n` a multiple of 8
|
||||
up to 8192 with an even group width.
|
||||
- `tconv_dw`: a depthwise convolution along the frames (a Conv3d of kernel `(k, 1, 1)`, one group a
|
||||
channel): `geom = (T, H, W)`, `P = H W` rows a frame, `w` PyTorch's `[n, 1, k, 1, 1]` (tap `j` of
|
||||
channel `c` at `c k + j`), `b [n]`, `k` odd:
|
||||
|
||||
@@ -107,6 +107,12 @@ rad-convert [options] <input> -o <model.rad>
|
||||
else every library found
|
||||
--tokenizer F tokenizer.json; its declared chain is baked instead of being
|
||||
reconstructed from a pre-tokenizer name
|
||||
--tokenizer2 F a second tokenizer.json, baked as the container's second vocab: a
|
||||
generator that reads its prompt through two tokenizers
|
||||
--add FILE one more .safetensors file merged in, its tensor names kept (a release
|
||||
shipped as separate single files). Repeatable
|
||||
--config DIR config.json, generation_config.json and tokenizer.json from DIR, for a
|
||||
single-file checkpoint that ships none
|
||||
--imatrix F llama.cpp imatrix: expert profile, column importances, error weighting
|
||||
--set K=V a metadata key, seen by declare and written into the container. Repeatable
|
||||
--max-tok N the max_tok declare is run at (default 8192)
|
||||
@@ -268,6 +274,12 @@ rad-convert $SRC -o new.rad --recipe new.recipe --reuse old.rad
|
||||
refuses a `--max-tok` and context pair whose score plane would pass 2 GiB.
|
||||
- `--max-spec`: a container carries what the model can serve, so a draft head is written even when
|
||||
this run would not draft. `0` leaves it out.
|
||||
- `--add`, `--config` and `--tokenizer2` read a release that ships as ComfyUI's single files
|
||||
(Anima: a diffusion model, a text encoder and a VAE in `split_files/`): the files merge into one
|
||||
namespace with their own tensor names (a name in two files is refused), the text encoder's
|
||||
repository supplies the config and tokenizer the plugin is sized by, and a second tokenizer.json
|
||||
(with its `tokenizer_config.json` beside it) becomes the container's second vocab section, which
|
||||
a generator declaring `aux_tokens` reads its prompt through. GUIDE §3.2 has the Anima command.
|
||||
- `--draft-model` merges a drafter here; the engine refuses the flag. The drafter's tensors go in
|
||||
under a `draft.` prefix and its config under `draft.` keys. It has no embedding and no `lm_head`
|
||||
of its own; it uses the target's.
|
||||
|
||||
Reference in new issue
Block a user