Skip to content

Conversation

@mpharrigan
Copy link
Collaborator

@mpharrigan mpharrigan commented Oct 21, 2025

  • fixes performance regression introduced in SelectHubbard refactor #1732
  • After some experimentation, run on 8 processes with maxtasksperworker=1
  • Report 10 slowest notebooks

@mpharrigan
Copy link
Collaborator Author

Results from serial execution on the CI: 24 mins total

392.72s /home/runner/work/Qualtran/Qualtran/qualtran/bloqs/phase_estimation/phase_estimation_of_quantum_walk.ipynb
62.10s /home/runner/work/Qualtran/Qualtran/qualtran/bloqs/rotations/quantum_variable_rotation.ipynb
25.70s /home/runner/work/Qualtran/Qualtran/qualtran/bloqs/arithmetic/error_analysis_for_fxp_arithmetic.ipynb
22.08s /home/runner/work/Qualtran/Qualtran/qualtran/bloqs/phase_estimation/kaiser_window_state.ipynb
19.59s /home/runner/work/Qualtran/Qualtran/qualtran/Adjoint.ipynb
18.66s /home/runner/work/Qualtran/Qualtran/qualtran/bloqs/state_preparation/state_preparation_via_rotation_tutorial.ipynb
15.92s /home/runner/work/Qualtran/Qualtran/qualtran/bloqs/optimization/k_xor_sat/kikuchi_guiding_state_tutorial.ipynb
12.80s /home/runner/work/Qualtran/Qualtran/qualtran/bloqs/chemistry/resource_estimation.ipynb
 9.22s /home/runner/work/Qualtran/Qualtran/qualtran/bloqs/arithmetic/t_complexity_of_comparison_gates.ipynb
 7.81s /home/runner/work/Qualtran/Qualtran/qualtran/bloqs/multiplexers/apply_gate_to_lth_target.ipynb

@mpharrigan
Copy link
Collaborator Author

After 8370d88, 16 mins total and

50.65s /home/runner/work/Qualtran/Qualtran/qualtran/bloqs/rotations/quantum_variable_rotation.ipynb
46.49s /home/runner/work/Qualtran/Qualtran/qualtran/bloqs/phase_estimation/phase_estimation_of_quantum_walk.ipynb
21.28s /home/runner/work/Qualtran/Qualtran/qualtran/bloqs/arithmetic/error_analysis_for_fxp_arithmetic.ipynb
18.51s /home/runner/work/Qualtran/Qualtran/qualtran/bloqs/phase_estimation/kaiser_window_state.ipynb
16.40s /home/runner/work/Qualtran/Qualtran/qualtran/bloqs/state_preparation/state_preparation_via_rotation_tutorial.ipynb
14.69s /home/runner/work/Qualtran/Qualtran/qualtran/bloqs/optimization/k_xor_sat/kikuchi_guiding_state_tutorial.ipynb
13.98s /home/runner/work/Qualtran/Qualtran/qualtran/Adjoint.ipynb
11.07s /home/runner/work/Qualtran/Qualtran/qualtran/bloqs/chemistry/resource_estimation.ipynb
 8.55s /home/runner/work/Qualtran/Qualtran/qualtran/bloqs/arithmetic/t_complexity_of_comparison_gates.ipynb
 7.14s /home/runner/work/Qualtran/Qualtran/qualtran/cirq_interop/cirq_interop.ipynb

@mpharrigan
Copy link
Collaborator Author

with 8 workers, total time of the execution step is 6m17s

@mpharrigan
Copy link
Collaborator Author

without maxtasksperchild=1, the total time of the execution step is 6m22s and doesn't show any of the stdout until the very end. I'll keep that change in

@mpharrigan mpharrigan changed the title time notebooks Notebook CI Job -- report times and fix regression Oct 21, 2025
@mpharrigan mpharrigan marked this pull request as ready for review October 21, 2025 22:54
@mpharrigan mpharrigan requested a review from mhucka October 21, 2025 22:54
@mhucka mhucka self-assigned this Oct 22, 2025
only_out_of_date: Only re-execute and re-export notebooks whose output files
are out of date.
n_workers: If set to 1, do not use parallelization. Otherwise, use
`multiprocessing.Pool(n_workers)` to execute notebooks in parallel.
Copy link
Contributor

Choose a reason for hiding this comment

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

The way the argument parser is currently defined, if the user does not supply a value for --n-workers, the value will be None, which multiprocessing.Pool(…) will interpret as "use as many as there are CPU cores on the machine". Although it's true that the docstring above is technically correct, the reader would have to know about the behavior of multiprocessing.Pool(None) to deduce how many workers will be used. IMHO a sentence here would be helpful to explain the connection between not providing a value and the resulting number of processes used.

Copy link
Contributor

Choose a reason for hiding this comment

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

I still suggest a note in the docstring to mention the behavior, but it's up to you.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yep i'll add that

Copy link
Contributor

@mhucka mhucka left a comment

Choose a reason for hiding this comment

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

LGTM, with a suggestion about adding a sentence to the docstring.

@mpharrigan mpharrigan merged commit 3f5f954 into quantumlib:main Oct 27, 2025
14 of 15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants