Commit 26cd2a5
committed
feat(lumen-model): smoke probe in EmbeddingModel::load — catch loader corruption at load time
Runs a single embed forward over a tiny multilingual probe ("hello 안녕")
at the end of `EmbeddingModel::load()` and verifies every output
component is finite + L2 norm ≈ 1.0. Catches silent NaN-class loader
bugs (the v0.4.2 BF16-as-F16 scales dtype mismatch that made
Qwen3-Embedding-4B-4bit-DWQ emit all-NaN embeddings) BEFORE the model
is exposed to user requests.
Failure path: load() returns Err → EmbeddingService::load propagates →
main.rs in lumen-server logs the diagnostic + sets /v1/embeddings to
503; chat endpoint untouched.
Overhead: ~50ms on 0.6B-8bit, ~150ms on 4B-DWQ. Cheap relative to
load (~1-4s) so always-on with no opt-out.1 parent f9f8e1b commit 26cd2a5
1 file changed
Lines changed: 53 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
167 | 167 | | |
168 | 168 | | |
169 | 169 | | |
170 | | - | |
| 170 | + | |
171 | 171 | | |
172 | 172 | | |
173 | 173 | | |
174 | 174 | | |
175 | 175 | | |
176 | 176 | | |
177 | | - | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
178 | 229 | | |
179 | 230 | | |
180 | 231 | | |
| |||
0 commit comments