makepad/libs/diffusion/Cargo.toml
Admin 7f59912916 libs/ai: one AI stack, replacing libs/ggml, llama, mlx, cuda, tts, voice2 and pbr_paint
The model code was spread across eight crates that had grown into each other:
ggml and cuda and mlx each owned part of a tensor runtime, llama and tts and
voice2 each owned part of a model, and libs/diffusion owned everything else.
They are now one tree with an explicit shape:

  libs/ai/cuda     — kernels and launch surface
  libs/ai/metal    — Metal shaders and the shim
  libs/ai/llm      — the language-model runtime (sessions, lanes, contexts,
                     the CUDA and Metal executors, the compiled Metal path)
  libs/ai/models/  — common, flux, h3, music, paint, speech, stems, vision

libs/diffusion is not deleted but demoted: what remains is the VALIDATOR
crate — several dozen `*_validate.rs` oracles that check a native
implementation against a reference, which is where they belong now that the
implementations live next door.

The functional work inside the move is mostly in the LLM runtime: N lanes that
draft while one verify batch serves all of them, per-slot prefill over a shared
folded attention arena, speculation that survives batching, and a scheduler
that reports rather than publishes. And in the CUDA build: a machine without
usable CUDA must still LINK (and say so), the default kernel arch is the
building machine's GPU, `NO_CUDA` forces the stub even where the toolkit
exists, and kernels compile in parallel with progress.

libs/video_flow is new here: classical optical flow estimation and the `mkfl`
motion-field payload — a flow field measured from a clip without a model,
which is what drives free-rate bounce-looping playback and the uprez/tween
enhance pipe.
2026-08-23 01:34:35 +02:00

251 lines
5.5 KiB
TOML

[package]
name = "makepad-diffusion"
version = "0.1.0"
edition = "2021"
description = "Diffusion pipeline scaffolding for Makepad ggml backends"
license = "MIT"
[dependencies]
# Bake ggml-metal.metallib at build time (same as llama/tts). Without this
# the first Metal dispatch compiles the shader source at runtime.
makepad-ai-llm = { path = "../ai/llm" }
# Safetensors reader moved out of mlx (lane T2, /aiarch.md §1): mlx's other
# ~89k LOC (chat/KV, qwen35moe, ...) has no consumers here. mlx itself stays
# in the tree unbuilt until lane T3 deletes it.
makepad-ai-loader = { path = "../ai/loader" }
# DiffusionError/Result + the plain sharded-safetensors reader moved out to
# the ai model workspace (lane T6a, /aiarch.md §1) so the family crates that
# split out of this one later can share them without depending on all of
# diffusion.
makepad-ai-common = { path = "../ai/models/common" }
makepad-ai-h3 = { path = "../ai/models/h3" }
makepad-ai-flux = { path = "../ai/models/flux" }
makepad-ai-vision = { path = "../ai/models/vision" }
makepad-ai-rig = { path = "../ai/models/rig" }
makepad-ai-motion = { path = "../ai/models/motion" }
makepad-ai-sfx = { path = "../ai/models/sfx" }
makepad-ai-music = { path = "../ai/models/music" }
makepad-ai-speech = { path = "../ai/models/speech" }
makepad-ai-trellis = { path = "../ai/models/trellis" }
makepad-gltf = { path = "../gltf" }
makepad-micro-serde = { path = "../micro_serde" }
makepad-zune-core = { path = "../zune/zune-core" }
makepad-zune-png = { path = "../zune/zune-png" }
[workspace]
[[bin]]
name = "flux-smoke"
path = "src/bin/flux_smoke.rs"
[[bin]]
name = "flux-tokenize"
path = "src/bin/flux_tokenize.rs"
[[bin]]
name = "flux-clip-smoke"
path = "src/bin/flux_clip_smoke.rs"
[[bin]]
name = "flux-t5-smoke"
path = "src/bin/flux_t5_smoke.rs"
[[bin]]
name = "flux-text-smoke"
path = "src/bin/flux_text_smoke.rs"
[[bin]]
name = "flux-transformer-smoke"
path = "src/bin/flux_transformer_smoke.rs"
[[bin]]
name = "flux-generate"
path = "src/bin/flux_generate.rs"
[[bin]]
name = "flux-warm-bench"
path = "src/bin/flux_warm_bench.rs"
[[bin]]
name = "flux-t5-stage-compare"
path = "src/bin/flux_t5_stage_compare.rs"
[[bin]]
name = "safetensors-query"
path = "src/bin/safetensors_query.rs"
[[bin]]
name = "h3-validate"
path = "src/bin/h3_validate.rs"
[[bin]]
name = "h3-vae-validate"
path = "src/bin/h3_vae_validate.rs"
[[bin]]
name = "h3-generate"
path = "src/bin/h3_generate.rs"
[[bin]]
name = "h3-tokenize"
path = "src/bin/h3_tokenize.rs"
[[bin]]
name = "h3-audio-validate"
path = "src/bin/h3_audio_validate.rs"
[[bin]]
name = "h3-vision-validate"
path = "src/bin/h3_vision_validate.rs"
[[bin]]
name = "h3-vae-encode-validate"
path = "src/bin/h3_vae_encode_validate.rs"
[[bin]]
name = "sa3-validate"
path = "src/bin/sa3_validate.rs"
[[bin]]
name = "moss-validate"
path = "src/bin/moss_validate.rs"
[[bin]]
name = "moss-generate"
path = "src/bin/moss_generate.rs"
[[bin]]
name = "trellis-validate"
path = "src/bin/trellis_validate.rs"
[[bin]]
name = "sa3-generate"
path = "src/bin/sa3_generate.rs"
[[bin]]
name = "trellis-generate"
path = "src/bin/trellis_generate.rs"
[[bin]]
name = "woosh-validate"
path = "src/bin/woosh_validate.rs"
[[bin]]
name = "woosh-generate"
path = "src/bin/woosh_generate.rs"
[[bin]]
name = "indextts-w2v-validate"
path = "src/bin/indextts_w2v_validate.rs"
[[bin]]
name = "indextts-gpt-validate"
path = "src/bin/indextts_gpt_validate.rs"
[[bin]]
name = "indextts-s2mel-validate"
path = "src/bin/indextts_s2mel_validate.rs"
[[bin]]
name = "indextts-bigvgan-validate"
path = "src/bin/indextts_bigvgan_validate.rs"
[[bin]]
name = "hy-motion-checkpoint"
path = "src/bin/hy_motion_checkpoint.rs"
[[bin]]
name = "hy-motion-validate"
path = "src/bin/hy_motion_validate.rs"
[[bin]]
name = "hy-motion-text-validate"
path = "src/bin/hy_motion_text_validate.rs"
[[bin]]
name = "hy-motion-clip-validate"
path = "src/bin/hy_motion_clip_validate.rs"
[[bin]]
name = "hy-motion-decode-validate"
path = "src/bin/hy_motion_decode_validate.rs"
[[bin]]
name = "hy-motion-pipeline-validate"
path = "src/bin/hy_motion_pipeline_validate.rs"
[[bin]]
name = "skin-tokens-validate"
path = "src/bin/skin_tokens_validate.rs"
[[bin]]
name = "skin-tokens-qwen-validate"
path = "src/bin/skin_tokens_qwen_validate.rs"
[[bin]]
name = "skin-tokens-beam-ops-validate"
path = "src/bin/skin_tokens_beam_ops_validate.rs"
[[bin]]
name = "skin-tokens-output-validate"
path = "src/bin/skin_tokens_output_validate.rs"
[[bin]]
name = "birefnet-validate"
path = "src/bin/birefnet_validate.rs"
[[bin]]
name = "realesrgan-validate"
path = "src/bin/realesrgan_validate.rs"
[[bin]]
name = "da3-validate"
path = "src/bin/da3_validate.rs"
[[bin]]
name = "sam3-validate"
path = "src/bin/sam3_validate.rs"
[[bin]]
name = "flux2-check-te"
path = "src/bin/flux2_check_te.rs"
[[bin]]
name = "flux2-edit-validate"
path = "src/bin/flux2_edit_validate.rs"
[[bin]]
name = "flux2-dev-validate"
path = "src/bin/flux2_dev_validate.rs"
[[bin]]
name = "h3-gguf-validate"
path = "src/bin/h3_gguf_validate.rs"
[[bin]]
name = "flux-gguf-inspect"
path = "src/bin/flux_gguf_inspect.rs"
[[bin]]
name = "music3-validate"
path = "src/bin/music3_validate.rs"
[[bin]]
name = "music3-gguf-inspect"
path = "src/bin/music3_gguf_inspect.rs"
[[bin]]
name = "music3-gguf-generate"
path = "src/bin/music3_gguf_generate.rs"
[[bin]]
name = "music3-generate"
path = "src/bin/music3_generate.rs"
[[bin]]
name = "music3-native-bench"
path = "src/bin/music3_generate.rs"
[[bin]]
name = "ace-validate"
path = "src/bin/ace_validate.rs"