|
Ran
|
Jobs
1
|
Files
1261
|
Run time
1min
|
Badge
README BADGES
|
push
github
Reuse VF2 scoring views for all scoring (#11115) (#11135) * Reuse VF2 scoring views for all scoring As part of the VF2Layout and VF2PostLayout passes when there are a large number of matches found we're spending an inordinate amount of time in scoring rebuilding the same views over and over again of the interaction graph for each scoring call. For example, in one test cProfile showed that with #11112 when running transpile() on a 65 Bernstein Vazirani circuit with a secret of all 1s for FakeSherbrooke with optimization_level=3 we were calling vf2_utils.score_layout() 161,761 times which took a culmulative time of 14.33 secs. Of that time though we spent 5.865 secs building the edge list view. These views are fixed for a given interaction graph which doesn't change during the duration of the run() method on these passes. To remove this inefficiency this commit moves the construction of the views to the beginning of the passes and just reuses them by reference for each scoring call, avoiding the reconstruction overhead. * Add EdgeList Rust pyclass to avoid repeated conversion This commit adds a new pyclass written in rust that wraps a rust Vec. Previously the scoring function also used an dict->IndexMap conversion, but the mapping structure wasn't necessary and added additional overhead, so it was converted to a list/Vec to speed up the execution even further. By using this new pyclass as the input to the rust scoring function we avoid converting the edge list from a list to an Vec on each call which will reduce the overhead even further. (cherry picked from commit a67fe87b4) Co-authored-by: Matthew Treinish <mtreinish@kortar.org>
37 of 37 new or added lines in 4 files covered. (100.0%)
73853 of 85027 relevant lines covered (86.86%)
91326.68 hits per line
| ID | Job ID | Ran | Files | Coverage | |
|---|---|---|---|---|---|
| 1 | 6672838606.1 | 0 |
86.86 |
GitHub Action Run |