Commit 375e4fe
authored
Update MemoryPlanning Verifier to only assume model has user input if it has at least one tensor input (#10617)
Fixes #10522
### Summary
MemoryPlanning verifier currently blows up if all the user inputs are
prims. #10522 suggested:
> We need to improve the logic of the _do_user_inputs_exist to probably
just return false if all the inputs are prims.
This PR implements this suggestion, with accompanying unit tests.
`_do_user_inputs_exist` now returns True if it has at least one tensor
input, and False otherwise.
### Test plan
Added unit tests to `test_memory_planning.py` and ran them with
```bash
pytest exir/tests/test_memory_planning.py::test_memory_planning.py
```
Please note you must comment out the line 69 from `/pytest.ini` for this
to work:
```
--ignore=exir/tests/test_memory_planning.py
```
On my machine, I also had to comment out line 60 from
`test_memory_planning.py` for the test to run without errors.
```
torch.ops.load_library("//executorch/kernels/portable:custom_ops_generated_lib")
```
[The tests I wrote aren't dependent on this library.]
Co-authored-by: jhels <[email protected]>1 parent 2e56274 commit 375e4fe
2 files changed
+72
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
29 | 33 | | |
30 | 34 | | |
31 | 35 | | |
| |||
338 | 342 | | |
339 | 343 | | |
340 | 344 | | |
341 | | - | |
342 | | - | |
343 | | - | |
344 | | - | |
345 | | - | |
346 | | - | |
347 | | - | |
348 | | - | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
349 | 349 | | |
350 | | - | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
351 | 362 | | |
352 | 363 | | |
353 | 364 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| |||
307 | 308 | | |
308 | 309 | | |
309 | 310 | | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 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 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
310 | 361 | | |
311 | 362 | | |
312 | 363 | | |
| |||
0 commit comments