Commit 6d191fa
committed
Wrap iOS18 quantization errors with ExecuTorch-specific hint
When the user lowers a model that was prepared with torchao's
`quantize_(...)` (e.g. blockwise int4) but does not pass an
iOS18+ `minimum_deployment_target` to the CoreML partitioner,
coremltools raises a generic ValueError pointing at coremltools
internals. The user has no obvious way to discover that the
target is set via `CoreMLBackend.generate_compile_specs` and
plumbed through `CoreMLPartitioner(compile_specs=...)`.
Catch the ValueError around the two coremltools utilities used
by our overridden `dequantize_affine` / `dequantize_codebook`
handlers and re-raise it with an ExecuTorch-flavored hint that
shows the exact partitioner call to make.
Fixes #13122.1 parent 31f0692 commit 6d191fa
2 files changed
Lines changed: 61 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
15 | 29 | | |
16 | 30 | | |
17 | 31 | | |
| |||
159 | 173 | | |
160 | 174 | | |
161 | 175 | | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
168 | 185 | | |
169 | 186 | | |
170 | 187 | | |
| |||
211 | 228 | | |
212 | 229 | | |
213 | 230 | | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
219 | 239 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
318 | 318 | | |
319 | 319 | | |
320 | 320 | | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
321 | 351 | | |
322 | 352 | | |
323 | 353 | | |
| |||
0 commit comments