hash constant buffer to improve deduplication performance (#1185)
Summary: Stack from [ghstack](https://github.com/ezyang/ghstack) (oldest at bottom): * __->__ https://github.com/pytorch/executorch/issues/1185 Currently for each constant tensor we need to compare its buffer with all the emitted buffer before to see if there's a duplicate. This is bad especially if we have more than one ExecutionPlan in the program. This PR introduces a map from the hash value to buffer index and hopefully can largely reduce the deduplication time. Pull Request resolved: https://github.com/pytorch/executorch/pull/1185 Reviewed By: tarun292, JacobSzwejbka Differential Revision: D51182655 Pulled By: larryliu0820 fbshipit-source-id: df63bb800238c2021ae2355ad7d2e8cc13313067
M
Mengwei Liu committed
3e9993011132f3bb751b338eb9d1b7e9e355ca6e
Parent: 47900c9
Committed by Facebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
on 11/14/2023, 5:50:46 PM