@ondeinference / onde / commits / 0e92555

wip

keypair34 committed Apr 6, 2026 at 22:13 UTC 0e925559e35268f006a2818b08963f62359c3c90
4 files changed +54 -32
Cargo.lock
-16
@@ -3077,8 +3077,6 @@ dependencies = [
3077 [[package]]
3078 name = "mistralrs"
3079 version = "0.8.1"
3080 -source = "registry+https://github.com/rust-lang/crates.io-index"
3081 -checksum = "9bb0a83340b4492ebba9760ba6845364de369c7e10c1f91af8733d574c7405fa"
3080 dependencies = [
3081 "anyhow",
3082 "candle-core",
@@ -3105,8 +3103,6 @@ dependencies = [
3103 [[package]]
3104 name = "mistralrs-audio"
3105 version = "0.8.1"
3108 -source = "registry+https://github.com/rust-lang/crates.io-index"
3109 -checksum = "5ac5d36f634c7c20c45845bc995be3b6387ab01048410386a5b180cfeaf89c72"
3106 dependencies = [
3107 "anyhow",
3108 "apodize",
@@ -3117,8 +3113,6 @@ dependencies = [
3113 [[package]]
3114 name = "mistralrs-core"
3115 version = "0.8.1"
3120 -source = "registry+https://github.com/rust-lang/crates.io-index"
3121 -checksum = "a2b8b9e5c94491d9ceeded3a30291cb6af6ae74810a5776dd55e3bbb8b3429d4"
3116 dependencies = [
3117 "ahash",
3118 "akin",
@@ -3215,8 +3209,6 @@ dependencies = [
3209 [[package]]
3210 name = "mistralrs-macros"
3211 version = "0.8.1"
3218 -source = "registry+https://github.com/rust-lang/crates.io-index"
3219 -checksum = "5aa9b4794322d3f89fe61d21f33f67be494c16d5bd869604b111218f32544d32"
3212 dependencies = [
3213 "darling 0.23.0",
3214 "proc-macro2",
@@ -3227,8 +3219,6 @@ dependencies = [
3219 [[package]]
3220 name = "mistralrs-mcp"
3221 version = "0.8.1"
3230 -source = "registry+https://github.com/rust-lang/crates.io-index"
3231 -checksum = "4fa97d4e3189ed80ebbc730b7da5b2356df0ae004ab489066249340c33c089ab"
3222 dependencies = [
3223 "anyhow",
3224 "async-trait",
@@ -3248,8 +3238,6 @@ dependencies = [
3238 [[package]]
3239 name = "mistralrs-paged-attn"
3240 version = "0.8.1"
3251 -source = "registry+https://github.com/rust-lang/crates.io-index"
3252 -checksum = "6e53ddf1537426997b46abdadbe6ca8a7ce7668004ed2b7cf00115016558bae8"
3241 dependencies = [
3242 "anyhow",
3243 "candle-core",
@@ -3265,8 +3253,6 @@ dependencies = [
3253 [[package]]
3254 name = "mistralrs-quant"
3255 version = "0.8.1"
3268 -source = "registry+https://github.com/rust-lang/crates.io-index"
3269 -checksum = "980715493d252e9aaf0779c4c101576d67ef4dd9812bfd77a54987f6f17526f4"
3256 dependencies = [
3257 "byteorder",
3258 "candle-core",
@@ -3295,8 +3281,6 @@ dependencies = [
3281 [[package]]
3282 name = "mistralrs-vision"
3283 version = "0.8.1"
3298 -source = "registry+https://github.com/rust-lang/crates.io-index"
3299 -checksum = "10046a3da2de5b702d3e829b5ddef7aa829ad454819dcc4876dea481a6cb5456"
3284 dependencies = [
3285 "candle-core",
3286 "image",
Cargo.toml
+31
@@ -75,3 +75,34 @@ mistralrs = { version = "0.8.1" }
75 # For NVIDIA GPU builds, patch this to features = ["cuda"] in CI before building.
76 [target.'cfg(target_os = "linux")'.dependencies]
77 mistralrs = { version = "0.8.1" }
78 +
79 +# ── Local mistral.rs patch ────────────────────────────────────────────────────
80 +#
81 +# The crates.io 0.8.1 release has two Metal build-script bugs that produce
82 +# empty (~92-byte) .metallib files, causing "Error while loading function:
83 +# fused_glu_float" at runtime:
84 +#
85 +# 1. The air→metallib step (`xcrun metal -o ...`) was missing `--sdk` and
86 +# `-std=<metal_version>`. Without them, air-lld falls back to the Metal
87 +# version implied by MACOSX_DEPLOYMENT_TARGET (often 10.12 → Metal 2.0),
88 +# which silently rejects AIR 2.5/2.6 bytecode and emits an empty lib.
89 +#
90 +# 2. iOS/tvOS was compiled against Metal 3.1, but A15/A16 GPUs (iPhone 14,
91 +# 15, 16e; Apple TV 4K 3rd gen) only support Metal 3.0, so every kernel
92 +# failed to load on those devices.
93 +#
94 +# Additionally, mistralrs-core forces F32 on iOS to work around a candle
95 +# buf_size bug with 2-byte types (BF16/F16).
96 +#
97 +# These fixes live on the local `fix/all-platform-fixes` branch and have not
98 +# yet been merged upstream. Remove this section once the PR lands on
99 +# crates.io and bump the version constraints above.
100 +[patch.crates-io]
101 +mistralrs = { path = "../mistral.rs/mistralrs" }
102 +mistralrs-core = { path = "../mistral.rs/mistralrs-core" }
103 +mistralrs-quant = { path = "../mistral.rs/mistralrs-quant" }
104 +mistralrs-paged-attn = { path = "../mistral.rs/mistralrs-paged-attn" }
105 +mistralrs-vision = { path = "../mistral.rs/mistralrs-vision" }
106 +mistralrs-audio = { path = "../mistral.rs/mistralrs-audio" }
107 +mistralrs-mcp = { path = "../mistral.rs/mistralrs-mcp" }
108 +mistralrs-macros = { path = "../mistral.rs/mistralrs-macros" }
sdk/dart/rust/Cargo.lock
-16
@@ -3258,8 +3258,6 @@ dependencies = [
3258 [[package]]
3259 name = "mistralrs"
3260 version = "0.8.1"
3261 -source = "registry+https://github.com/rust-lang/crates.io-index"
3262 -checksum = "9bb0a83340b4492ebba9760ba6845364de369c7e10c1f91af8733d574c7405fa"
3261 dependencies = [
3262 "anyhow",
3263 "candle-core",
@@ -3286,8 +3284,6 @@ dependencies = [
3284 [[package]]
3285 name = "mistralrs-audio"
3286 version = "0.8.1"
3289 -source = "registry+https://github.com/rust-lang/crates.io-index"
3290 -checksum = "5ac5d36f634c7c20c45845bc995be3b6387ab01048410386a5b180cfeaf89c72"
3287 dependencies = [
3288 "anyhow",
3289 "apodize",
@@ -3298,8 +3294,6 @@ dependencies = [
3294 [[package]]
3295 name = "mistralrs-core"
3296 version = "0.8.1"
3301 -source = "registry+https://github.com/rust-lang/crates.io-index"
3302 -checksum = "a2b8b9e5c94491d9ceeded3a30291cb6af6ae74810a5776dd55e3bbb8b3429d4"
3297 dependencies = [
3298 "ahash",
3299 "akin",
@@ -3396,8 +3390,6 @@ dependencies = [
3390 [[package]]
3391 name = "mistralrs-macros"
3392 version = "0.8.1"
3399 -source = "registry+https://github.com/rust-lang/crates.io-index"
3400 -checksum = "5aa9b4794322d3f89fe61d21f33f67be494c16d5bd869604b111218f32544d32"
3393 dependencies = [
3394 "darling 0.23.0",
3395 "proc-macro2",
@@ -3408,8 +3400,6 @@ dependencies = [
3400 [[package]]
3401 name = "mistralrs-mcp"
3402 version = "0.8.1"
3411 -source = "registry+https://github.com/rust-lang/crates.io-index"
3412 -checksum = "4fa97d4e3189ed80ebbc730b7da5b2356df0ae004ab489066249340c33c089ab"
3403 dependencies = [
3404 "anyhow",
3405 "async-trait",
@@ -3429,8 +3419,6 @@ dependencies = [
3419 [[package]]
3420 name = "mistralrs-paged-attn"
3421 version = "0.8.1"
3432 -source = "registry+https://github.com/rust-lang/crates.io-index"
3433 -checksum = "6e53ddf1537426997b46abdadbe6ca8a7ce7668004ed2b7cf00115016558bae8"
3422 dependencies = [
3423 "anyhow",
3424 "candle-core",
@@ -3446,8 +3434,6 @@ dependencies = [
3434 [[package]]
3435 name = "mistralrs-quant"
3436 version = "0.8.1"
3449 -source = "registry+https://github.com/rust-lang/crates.io-index"
3450 -checksum = "980715493d252e9aaf0779c4c101576d67ef4dd9812bfd77a54987f6f17526f4"
3437 dependencies = [
3438 "byteorder",
3439 "candle-core",
@@ -3476,8 +3462,6 @@ dependencies = [
3462 [[package]]
3463 name = "mistralrs-vision"
3464 version = "0.8.1"
3479 -source = "registry+https://github.com/rust-lang/crates.io-index"
3480 -checksum = "10046a3da2de5b702d3e829b5ddef7aa829ad454819dcc4876dea481a6cb5456"
3465 dependencies = [
3466 "candle-core",
3467 "image",
sdk/dart/rust/Cargo.toml
+23
@@ -13,3 +13,26 @@ onde = { path = "../../../" }
13 tokio = { version = "1", features = ["rt-multi-thread", "macros"] }
14 thiserror = "2"
15 log = "0.4"
16 +
17 +# ── Local mistral.rs patch ────────────────────────────────────────────────────
18 +#
19 +# [patch.crates-io] is only honoured by the ROOT manifest being built.
20 +# The Flutter build script runs `cargo build` from this directory, so the
21 +# patch in onde/Cargo.toml is silently ignored — this crate resolves
22 +# mistralrs 0.8.1 directly from crates.io (the broken version).
23 +#
24 +# The fix in fix/metal-air-to-metallib-std-flag passes --sdk and -std= to
25 +# the air→metallib link step, which is the root cause of:
26 +# "Error while loading function: fused_glu_float"
27 +#
28 +# Remove this section once the PR lands on crates.io and the version
29 +# constraints in onde/Cargo.toml are bumped to the fixed release.
30 +[patch.crates-io]
31 +mistralrs = { path = "../../../../mistral.rs/mistralrs" }
32 +mistralrs-core = { path = "../../../../mistral.rs/mistralrs-core" }
33 +mistralrs-quant = { path = "../../../../mistral.rs/mistralrs-quant" }
34 +mistralrs-paged-attn = { path = "../../../../mistral.rs/mistralrs-paged-attn" }
35 +mistralrs-vision = { path = "../../../../mistral.rs/mistralrs-vision" }
36 +mistralrs-audio = { path = "../../../../mistral.rs/mistralrs-audio" }
37 +mistralrs-mcp = { path = "../../../../mistral.rs/mistralrs-mcp" }
38 +mistralrs-macros = { path = "../../../../mistral.rs/mistralrs-macros" }