Skip to content
This repository was archived by the owner on Aug 19, 2023. It is now read-only.

Conversation

itoko
Copy link
Contributor

@itoko itoko commented Feb 16, 2022

Summary

Add benchmarks to track the time performance of circuit scheduling

Details and comments

Add four tests, which benchmark TimeUnitConversion, ALAPSchedule, ASAPSchedule and DynamicalDecoupling passes. It would be a good time to start benchmarking those as rework on circuit scheduling passes is about to start.

@itoko
Copy link
Contributor Author

itoko commented Feb 16, 2022

Here is an example of the results of new benchmarks in my local env.

[ 66.67%] ··· ...Benchmarks.time_alap_schedule_pass                 ok
[ 66.67%] ··· ========== =========== ============
              --                  depth          
              ---------- ------------------------
               n_qubits      500         1000    
              ========== =========== ============
                  5       102±0.6ms    202±3ms   
                  10       278±7ms     605±10ms  
                  20       844±40ms   1.72±0.02s 
              ========== =========== ============

[ 83.33%] ··· ...Benchmarks.time_asap_schedule_pass                 ok
[ 83.33%] ··· ========== ========== ============
              --                  depth         
              ---------- -----------------------
               n_qubits     500         1000    
              ========== ========== ============
                  5       110±5ms     201±2ms   
                  10      306±2ms     604±7ms   
                  20      901±10ms   1.85±0.01s 
              ========== ========== ============

[100.00%] ··· ...rks.time_dynamical_decoupling_pass                 ok
[100.00%] ··· ========== ============ ============
              --                   depth          
              ---------- -------------------------
               n_qubits      500          1000    
              ========== ============ ============
                  5        118±3ms      233±7ms   
                  10       339±7ms      684±5ms   
                  20      1.06±0.01s   2.09±0.05s 
              ========== ============ ============

@itoko itoko changed the title Add benchmarks for circuit scheduling passes Add benchmarks for circuit scheduling Feb 16, 2022
@itoko
Copy link
Contributor Author

itoko commented Feb 16, 2022

[100.00%] ··· ...rks.time_time_unit_conversion_pass                 ok
[100.00%] ··· ========== ========== ==========
              --                 depth        
              ---------- ---------------------
               n_qubits     500        1000   
              ========== ========== ==========
                  5       51.3±2ms   110±6ms  
                  10      141±2ms    296±2ms  
                  20      414±3ms    837±10ms 
              ========== ========== ==========
[100.00%] ··· ...enchmarks.time_schedule_qv_14_x_14                 ok
[100.00%] ··· =============================== ============
               transpiler optimization level              
              ------------------------------- ------------
                             0                  628±10ms  
                             1                 1.40±0.03s 
                             2                 1.86±0.02s 
                             3                 3.63±0.05s 
              =============================== ============

@itoko
Copy link
Contributor Author

itoko commented Feb 18, 2022

@jakelishman I've updated according to your suggestions. Would you mind taking a second look?

@itoko itoko requested a review from jakelishman February 24, 2022 09:39
Copy link
Member

@jakelishman jakelishman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the update, and sorry for the delay in second review.

This looks fine from my perspective, but I don't know enough about the targets for the benchmark suite to give final approval. I'll ask @kdk (who's currently away) or @mtreinish to check, and particularly check if the suggestion I made in Qiskit/qiskit#1421 (comment) was appropriate - I should have made it clearer that that was a question rather than a concrete suggestion!

Copy link
Member

@mtreinish mtreinish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This LGTM, I think having a full path scheduling benchmark makes sense just to see what the overhead is in an end-to-end benchmark. The synthetic per pass benchmarks only take you so far. The 14x14 qv is a good choice for that because it's relatively quick. But @jakelishman is correct that we do have a time budget to worry about too. I haven't checked what our current time per commit is on the nightly runs I think we'd be ok adding a couple of optimization levels to the suite. If we added like optimization level 0 and 1 (as I think those are the likely place where people are doing scheduling) that would only add maybe 30sec-1min per commit (as each benchmark does at least 4 runs sometimes more). But I think we can do this in a follow up PR as it's easy enough to add more benchmarks

Comment on lines +46 to +53
self.cmap = [[0, 1], [1, 0], [1, 2], [1, 6], [2, 1], [2, 3], [3, 2],
[3, 4], [3, 8], [4, 3], [5, 6], [5, 10], [6, 1], [6, 5],
[6, 7], [7, 6], [7, 8], [7, 12], [8, 3], [8, 7], [8, 9],
[9, 8], [9, 14], [10, 5], [10, 11], [11, 10], [11, 12],
[11, 16], [12, 7], [12, 11], [12, 13], [13, 12], [13, 14],
[13, 18], [14, 9], [14, 13], [15, 16], [16, 11], [16, 15],
[16, 17], [17, 16], [17, 18], [18, 13], [18, 17],
[18, 19], [19, 18]]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm curious which coupling map is this? Too many edges for me to visualize it in my head.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be honest, I just copied it from PassBenchmarks(mapping_passes) to make the comparison with other benchmarks some sense, and I don't know where it comes from.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Heh, well I wrote those benchmarks but a long time ago. I think I would have used either the Tokyo or Singapore coupling maps there but it's just a vague memory.

@mtreinish mtreinish merged commit c84b641 into Qiskit:master Feb 25, 2022
@itoko itoko deleted the add-circuit-scheduling-bench branch March 4, 2022 08:19
mtreinish pushed a commit that referenced this pull request Mar 11, 2022
Add a benchmark to track the overall time performance of circuit
scheduling, which would be near to that end users actually
experience when scheduling.

Follow-up PR of #1421. As suggested in the original PR,
optimization level 0 and 1 are added so that it would not take so
much time while covering the places where people are doing
scheduling.

* Add overall transpilation time bench with scheduling

* Improve a bit
jakelishman pushed a commit to jakelishman/qiskit-terra that referenced this pull request Aug 1, 2023
Add benchmarks to track the time performance of circuit scheduling

Add four tests, which benchmark TimeUnitConversion, ALAPSchedule,
ASAPSchedule and DynamicalDecoupling passes. It would be a good
time to start benchmarking those as rework on circuit scheduling
passes is about to start.

* Add benchmarks for scheduling passes

* lint

* Add one more bench for circuit scheduling

* Add overall transpilation time bench with scheduling

* Revert "Add overall transpilation time bench with scheduling"

This reverts commit fdba349999548ecd1fb4cc9a1e1a67802ecd9008.

* Remove wild-card import
jakelishman pushed a commit to jakelishman/qiskit-terra that referenced this pull request Aug 1, 2023
…etapackage#1441)

Add a benchmark to track the overall time performance of circuit
scheduling, which would be near to that end users actually
experience when scheduling.

Follow-up PR of Qiskit/qiskit-metapackage#1421. As suggested in the original PR,
optimization level 0 and 1 are added so that it would not take so
much time while covering the places where people are doing
scheduling.

* Add overall transpilation time bench with scheduling

* Improve a bit
jakelishman pushed a commit to jakelishman/qiskit-terra that referenced this pull request Aug 11, 2023
Add benchmarks to track the time performance of circuit scheduling

Add four tests, which benchmark TimeUnitConversion, ALAPSchedule,
ASAPSchedule and DynamicalDecoupling passes. It would be a good
time to start benchmarking those as rework on circuit scheduling
passes is about to start.

* Add benchmarks for scheduling passes

* lint

* Add one more bench for circuit scheduling

* Add overall transpilation time bench with scheduling

* Revert "Add overall transpilation time bench with scheduling"

This reverts commit fdba349999548ecd1fb4cc9a1e1a67802ecd9008.

* Remove wild-card import
jakelishman pushed a commit to jakelishman/qiskit-terra that referenced this pull request Aug 11, 2023
…etapackage#1441)

Add a benchmark to track the overall time performance of circuit
scheduling, which would be near to that end users actually
experience when scheduling.

Follow-up PR of Qiskit/qiskit-metapackage#1421. As suggested in the original PR,
optimization level 0 and 1 are added so that it would not take so
much time while covering the places where people are doing
scheduling.

* Add overall transpilation time bench with scheduling

* Improve a bit
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants