Add benchmarks for missing passes#1346
Conversation
This commit adds runtime benchmarks to the passes and mapping_passes benchmark modules to measure additional transpiler passes in isolation that we didn't have coverage for previously. Primarily of importance here are the basis translator and the optimize 1q decomposition passes which are in the preset pass managers but didn't have standalone benchmark coverage. One pass excluded here is the TemplateOptimization pass which would have been good to add to the benchmark but it is exceedingly slow and took well more than 5 min per iteration.
|
I think we're going to have to cut back on the basis translator benchmark, it's too slow. It's been running for ~23min and still hasn't finished the first half (the cache warming unmeasured execution) |
|
Ok, I can just drop the non ibm basis from the benchmark for now to get this running nightly: But, that is a huge disparity because the timeout is set to 300 sec and all the failures are timeouts. @kdk can you think of some reason it would be so much slower for those basis sets? |
|
@georgios-ts suggested the issue with the timeouts might be because the those basis were missing I think this is a bug in the basis translator or the equivalence lib because it should be able to find an equivalent with the parameterized 1q gates for an id pretty easily. |
This commit adds a missing rules to the equivalence library for an identity gate. Without this the basis translator has difficulty finding a match if the basis does not include an id gate (see Qiskit#1346)
|
Qiskit/qiskit#7146 should fix the timeouts with the basis translator benchmarks |
jakelishman
left a comment
There was a problem hiding this comment.
This looks sensible to me.
| # pylint: disable=no-member,invalid-name,missing-docstring,no-name-in-module | ||
| # pylint: disable=attribute-defined-outside-init,unsubscriptable-object | ||
| # pylint: disable=unused-wildcard-import,wildcard-import | ||
| # pylint: disable=unused-wildcard-import,wildcard-import,undefined-variable |
There was a problem hiding this comment.
What's pylint complaining about that requires this? By name, at least, it sounds like something we shouldn't be ignoring.
There was a problem hiding this comment.
It's because pylint runs with the latest terra release and there are passes I'm adding benchmarks for here that are only on main. So pylint was complaining about an undefined variable for those passes.
Honestly I should just turn pylint off for the benchmarks and use flake8 and black only since it is serving a different use case than the other things being linted in this repo
There was a problem hiding this comment.
Ah, that makes sense. Yeah, given the huge number of exclusions here, stopping pylint on these files is probably a good idea.
Agree the timeouts are likely an instance of Qiskit/qiskit#5539 .
I think this is a little more complicated than it appears at first glance because IBM hardware has a non-standard (though deprecated) definition of I agree these are logically equivalences the library should have, but perhaps after
) |
Why does this matter for Qiskit/qiskit#7146 though? If IBMQ backends are using |
Co-authored-by: Jake Lishman <jake@binhbar.com>
I think this is exactly it. Following Qiskit/qiskit-ibmq-provider#976 (which currently warns on
Agree that this is weird and non-intuitive behavior, but it is not at the moment IBMQ provider specific. Qiskit defines |
Co-authored-by: Kevin Krsulich <kevin@krsulich.net>
* Add benchmarks for missing passes This commit adds runtime benchmarks to the passes and mapping_passes benchmark modules to measure additional transpiler passes in isolation that we didn't have coverage for previously. Primarily of importance here are the basis translator and the optimize 1q decomposition passes which are in the preset pass managers but didn't have standalone benchmark coverage. One pass excluded here is the TemplateOptimization pass which would have been good to add to the benchmark but it is exceedingly slow and took well more than 5 min per iteration. * Update test/benchmarks/mapping_passes.py * Add collect multi q block benchmark * Update test/benchmarks/passes.py Co-authored-by: Jake Lishman <jake@binhbar.com> * Update test/benchmarks/passes.py Co-authored-by: Kevin Krsulich <kevin@krsulich.net> Co-authored-by: Jake Lishman <jake@binhbar.com> Co-authored-by: Kevin Krsulich <kevin@krsulich.net>
* Add benchmarks for missing passes This commit adds runtime benchmarks to the passes and mapping_passes benchmark modules to measure additional transpiler passes in isolation that we didn't have coverage for previously. Primarily of importance here are the basis translator and the optimize 1q decomposition passes which are in the preset pass managers but didn't have standalone benchmark coverage. One pass excluded here is the TemplateOptimization pass which would have been good to add to the benchmark but it is exceedingly slow and took well more than 5 min per iteration. * Update test/benchmarks/mapping_passes.py * Add collect multi q block benchmark * Update test/benchmarks/passes.py Co-authored-by: Jake Lishman <jake@binhbar.com> * Update test/benchmarks/passes.py Co-authored-by: Kevin Krsulich <kevin@krsulich.net> Co-authored-by: Jake Lishman <jake@binhbar.com> Co-authored-by: Kevin Krsulich <kevin@krsulich.net>
Summary
This commit adds runtime benchmarks to the passes and mapping_passes
benchmark modules to measure additional transpiler passes in isolation
that we didn't have coverage for previously. Primarily of importance
here are the basis translator and the optimize 1q decomposition passes
which are in the preset pass managers but didn't have standalone
benchmark coverage. One pass excluded here is the TemplateOptimization
pass which would have been good to add to the benchmark but it is
exceedingly slow and took well more than 5 min per iteration.
Details and comments