Memory planning debug log (#2125)
Summary:
Calculate `num_reuse_pairs` only if debug is enabled
Reduces to_executorch latency.
thanks mergennachin for the finding!
Cprof before:
{F1459766592}
Cprof after:
{F1461507195}
Pull Request resolved: https://github.com/pytorch/executorch/pull/2125
Test Plan:
ci
Latency (s) for language llama fp32:
```
python -m examples.models.llama2.export_llama -c ../llama-models/language/very_new_checkpoint.pt -p ../llama-models/language/params.json --fairseq2 --dtype-override fp32 -prof /tmp/language-fp32-memop.html
```
||to_executorch|memory_planning_pass|
|before|58.7s|14.7s|
|after|42.4s| 0.466s|
Reviewed By: mergennachin
Differential Revision: D54214624
Pulled By: lucylq
fbshipit-source-id: 367862704176a514f09a3e5c41e85d9e2019c8e9 L
Lucy Qiu committed
e4a5c36940cf5720cb4d9d789374689aaeaac620
Parent: e09c29b
Committed by Facebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
on 2/27/2024, 1:23:51 AM