Commit 6150522
Add deprecation warning for to_edge + to_backend workflow in CoreMLPa… (#17082)
Fixes #15960
This PR adds a deprecation warning in the CoreMLPartitioner to guide
users away from the deprecated [to_edge() +
to_backend()](cci:1://file:///c:/Users/moham/Documents/osc/executorch-contribution/backends/xnnpack/test/test_xnnpack_partitioner.py:62:4-88:61)
workflow and toward the recommended
[to_edge_transform_and_lower()](cci:1://file:///c:/Users/moham/Documents/osc/executorch-contribution/backends/xnnpack/test/test_xnnpack_partitioner.py:62:4-88:61)
flow.
## Changes
- Added
[_check_if_called_from_to_backend()](cci:1://file:///c:/Users/moham/Documents/osc/executorch-contribution/backends/apple/coreml/partition/coreml_partitioner.py:225:4-241:20)
method to detect deprecated workflow
- Modified
[partition()](cci:1://file:///c:/Users/moham/Documents/osc/executorch-contribution/backends/apple/coreml/partition/coreml_partitioner.py:243:4-292:9)
to log warning when deprecated flow is detected
- Added two unit tests to verify warning behavior
## Pattern
Following the same pattern as #13209 (XNNPACK).
## Related
This picks up the abandoned PR #15963.
cc @kimishpatel @YifanShenSZ @cymbalrush @metascroy
---------
Signed-off-by: mohammed-saalim <mohammed.saalim.k@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>1 parent e96ab14 commit 6150522
2 files changed
Lines changed: 123 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
222 | 223 | | |
223 | 224 | | |
224 | 225 | | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
225 | 244 | | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
226 | 258 | | |
227 | 259 | | |
228 | 260 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
| 7 | + | |
6 | 8 | | |
7 | 9 | | |
8 | 10 | | |
| |||
336 | 338 | | |
337 | 339 | | |
338 | 340 | | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
339 | 428 | | |
340 | 429 | | |
341 | 430 | | |
| |||
346 | 435 | | |
347 | 436 | | |
348 | 437 | | |
| 438 | + | |
| 439 | + | |
0 commit comments