Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Distribute docs build over number of CPUs. #2235

Open
wants to merge 75 commits into
base: main
Choose a base branch
from

Conversation

cosenal
Copy link
Contributor

@cosenal cosenal commented Mar 18, 2024

Description

An attempt to speed up docs build (related to #2083, but not the same as that's about RTD).
It looks like the bottleneck is the notebook execution. MyST-NB is parallel-friendly, hence this attempt.

Some data points from testing this on my local machine (Apple M2 Pro):

Build time make docs-clean
Serial 962.92s user 424.57s system 193% cpu 11:57.48 total
Parallel 1052.97s user 250.09s system 443% cpu 4:53.88 total

License

  • I license this contribution under the terms of the GNU GPL, version 3 and grant Unitary Fund the right to provide additional permissions as described in section 7 of the GNU GPL, version 3.

Before opening the PR, please ensure you have completed the following where appropriate.

N/A - [ ] I added unit tests for new code.
N/A - [ ] I used type hints in function signatures.
N/A - [ ] I used Google-style docstrings for functions.
N/A - [ ] I updated the documentation where relevant.

  • Added myself / the copyright holder to the AUTHORS file

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Hello @cosenal, thank you for submitting a PR to Mitiq! We will respond as soon as possible, and if you have any questions in the meantime, you can ask us on the Unitary Fund Discord.

@nathanshammah
Copy link
Member

Nice! It's failing here, not sure why.

@cosenal
Copy link
Contributor Author

cosenal commented Mar 18, 2024

@nathanshammah Yes, I cancelled the workflow, because I saw it failing on the docs build, which I am investigating. I am leaving it as a Draft PR until the build is fixed.

Copy link

codecov bot commented Mar 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.32%. Comparing base (80cf118) to head (ce1b7b0).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2235   +/-   ##
=======================================
  Coverage   98.32%   98.32%           
=======================================
  Files          87       87           
  Lines        4048     4048           
=======================================
  Hits         3980     3980           
  Misses         68       68           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@nathanshammah
Copy link
Member

Is this blocked by the PyData Sphinx theme action?

@cosenal
Copy link
Contributor Author

cosenal commented Mar 28, 2024

@nathanshammah indeed – I have just dropped a comment there

@cosenal cosenal added documentation Improvements or additions to documentation monitor-for-external-solution Tracking issues caused by external packages labels Apr 1, 2024
natestemen and others added 19 commits June 26, 2024 21:40
* Fix examples link in README.md

It is currently pointing to our docs homepage rather than the examples section.

* Update AUTHORS

* Update link to unitaryHACK in CHANGELOG.md (#2243)

The link in like 1305 of the CHANGELOG ([unitaryHACK](https://unitaryfund.github.io/unitaryhack/)!) failed to resolve in the docs build (https://github.com/unitaryfund/mitiq/actions/runs/8425856701/job/23072890372#step:6:1040). Link has now been updated to reflect the new domain for the 2021 unitaryhack website.

* Update link to 2021 unitaryHACK in CHANGELOG.md (#2246)

* Update unitaryhack link in Changelog to 2021 website
Bumps [pytest-cov](https://github.com/pytest-dev/pytest-cov) from 4.0.0 to 5.0.0.
- [Changelog](https://github.com/pytest-dev/pytest-cov/blob/master/CHANGELOG.rst)
- [Commits](pytest-dev/pytest-cov@v4.0.0...v5.0.0)

---
updated-dependencies:
- dependency-name: pytest-cov
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [stimcirq](https://github.com/quantumlib/stim) from 1.12.1 to 1.13.0.
- [Release notes](https://github.com/quantumlib/stim/releases)
- [Commits](quantumlib/Stim@v1.12.1...v1.13.0)

---
updated-dependencies:
- dependency-name: stimcirq
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [stim](https://github.com/quantumlib/stim) from 1.12.1 to 1.13.0.
- [Release notes](https://github.com/quantumlib/stim/releases)
- [Commits](quantumlib/Stim@v1.12.1...v1.13.0)

---
updated-dependencies:
- dependency-name: stim
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* added rotated rb circuits in calibrator

* added tests for rotated rb circuits in calibration

* missing numpy import

* fixed formatting issue

* fix format issue

* added a new variable p for probality of measuring 0 and an extra test for rotated rb circuits
* Exit early when circuit type is not supported

* Remove unused import
* add release notes for 0.35

* try new intersphinx link for scipy

* wordsmithing

* update qiskit link for interphinx; remove qutip
* add reminder to merge changelog/version prior to release

* bump version
* Changed master to main for all instances of mitiq repo mentions and for cirq (since they have also updated their primary branch to main). Excluded qibo, as they still use only master in README

* Updated pull_request_template and release instructions for mitiq to replace master with main. Also updated link to cirq library to reflect this in randomized_benchmarking.py

* Grabbing recent master changes (#2261)

* Indicate master is under development (#2258)

* add reminder to merge changelog/version prior to release

* bump version

* Remove redundant word in release title (#2260)

---------

Co-authored-by: nate stemen <[email protected]>
Co-authored-by: Alessandro Cosentino <[email protected]>

* replace master with main in build CICD

* replace master with main in Contribution guide

* replace master with main in release guide

---------

Co-authored-by: jordandsullivan <[email protected]>
Co-authored-by: nate stemen <[email protected]>
Co-authored-by: Alessandro Cosentino <[email protected]>
Bumps [qibo](https://github.com/qiboteam/qibo) from 0.2.4 to 0.2.7.
- [Release notes](https://github.com/qiboteam/qibo/releases)
- [Commits](qiboteam/qibo@v0.2.4...v0.2.7)

---
updated-dependencies:
- dependency-name: qibo
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Update scipy requirement from <=1.11.4,>=1.5.0 to >=1.5.0,<=1.13.0

Updates the requirements on [scipy](https://github.com/scipy/scipy) to permit the latest version.
- [Release notes](https://github.com/scipy/scipy/releases)
- [Commits](scipy/scipy@v1.5.0...v1.13.0)

---
updated-dependencies:
- dependency-name: scipy
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>

* ignore data file generated by pyscf

* bump bqskit

* bump oldest supported scipy

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: nate stemen <[email protected]>
Fairly certain this is just a typo. I believe the intention is for git to ignore changes to jupyter notebooks (*.ipynb).
purva-thakre and others added 27 commits June 26, 2024 21:41
* add pt, shadows, qse

* Update docs/source/guide/glossary.md

* Update docs/source/guide/glossary.md

* Add abbreiviations

* Update docs/source/guide/glossary.md
* First draft tutorial DDD + ZNE

* Ammended error model to be time-correlated to allow DDD to be useful. Currently combining DDD + ZNE is failing due to a return type incompatbility

* Add measurements. Still return type incompatibility

* Switched from using ddd.mitigate_executor to inserting ddd sequences into the circuit itself and passing that to zne. Now functional

* Adding markdown version of tutorial

* Updated docstring for generate_mirror_circuits to reflect accurate return types

* Identified error model and qubit idle regime in which the techniques work better together

* Added new md notebook to examples toctree

* Change format to myst so that cells execute in docs build

* Adding formats: md:myst to display notebook correctly

* Rephrase final sentence

* Correct execute call to be `noisy-exec`, add clarity.

* Remove unnecessary new executor instantiation.

* correct typo
* mirror circuits

* randomized benchmarking

* clifford t + ruff
Updates the requirements on [qiskit](https://github.com/Qiskit/qiskit) to permit the latest version.
- [Release notes](https://github.com/Qiskit/qiskit/releases)
- [Changelog](https://github.com/Qiskit/qiskit/blob/main/docs/release_notes.rst)
- [Commits](Qiskit/qiskit@1.0.2...1.1.0)

---
updated-dependencies:
- dependency-name: qiskit
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [qibo](https://github.com/qiboteam/qibo) from 0.2.7 to 0.2.8.
- [Release notes](https://github.com/qiboteam/qibo/releases)
- [Commits](qiboteam/qibo@v0.2.7...v0.2.8)

---
updated-dependencies:
- dependency-name: qibo
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…2380)

Updates the requirements on [scipy](https://github.com/scipy/scipy) to permit the latest version.
- [Release notes](https://github.com/scipy/scipy/releases)
- [Commits](scipy/scipy@v1.10.1...v1.13.1)

---
updated-dependencies:
- dependency-name: scipy
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
updated-dependencies:
- dependency-name: qiskit-aer
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [pyscf](https://github.com/pyscf/pyscf) from 2.5.0 to 2.6.0.
- [Release notes](https://github.com/pyscf/pyscf/releases)
- [Changelog](https://github.com/pyscf/pyscf/blob/master/CHANGELOG)
- [Commits](pyscf/pyscf@v2.5.0...v2.6.0)

---
updated-dependencies:
- dependency-name: pyscf
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Prep for 0.37.0 release

* Update CHANGELOG.md

Co-authored-by: nate stemen <[email protected]>

---------

Co-authored-by: nate stemen <[email protected]>
* add noise_op to pauli_twirl to include noise on CNOT and CZ gates

* update add_noise_to_two_qubit_gates docstring

* implement singledispatch to add noise to two qubit gates

* add pennylane test to twirl with noise

* fix mypy issues with kwargs
* Fixed issue #2354 where a fallback was addded to conversions.py to decompose a qiskit circuit to native gates if an error occured. A test with zne was added to test for this with the QFT gate.

* added myself to the bottom of the authors file

* Adjusted code to follow the comments that cosenal placed with previous pull request.
Moved the exception catch from the from_qiskit() to the from_qasm() function as that function is
more general and is called by from_qiskit().
Used a QasmException catch instead of Exception to make it more clear that Qasm has trouble converting
Adjusted code to follow the comments that cosenal placed with previous pull request.
Moved the exception catch from the from_qiskit() to the from_qasm() function as that function is
more general and is called by from_qiskit().
Used a QasmException catch instead of Exception to make it more clear that Qasm has trouble converting
different gates. Removed choosing a basis for the transpile and let qiskit decide what gates to use.
Added an additional test case to test the from_qasm() function.

* resolving second round of changes reviewed by cosenal! moved the exception catch to the from_qiskit() function from the from_qasm() function as from_qasm() can handle non-qiskit circuits. Switched the test case to test the from_qiskit() function in doing so. Also only decomposed rather than transpiling and decomposing as transpiling doesn't do anything.

* renaming and added updated docstrings according to cosenal suggestions
* update both guides

* forgot readme

* move things around

* inline link cleanup

* Nate's review - corrected typos

Co-authored-by: nate stemen <[email protected]>

* Apply suggestions from code review

Co-authored-by: nate stemen <[email protected]>

---------

Co-authored-by: nate stemen <[email protected]>
Bumps [pyscf](https://github.com/pyscf/pyscf) from 2.6.0 to 2.6.2.
- [Release notes](https://github.com/pyscf/pyscf/releases)
- [Changelog](https://github.com/pyscf/pyscf/blob/master/CHANGELOG)
- [Commits](pyscf/pyscf@v2.6.0...v2.6.2)

---
updated-dependencies:
- dependency-name: pyscf
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Updates the requirements on [qiskit](https://github.com/Qiskit/qiskit) to permit the latest version.
- [Release notes](https://github.com/Qiskit/qiskit/releases)
- [Changelog](https://github.com/Qiskit/qiskit/blob/main/docs/release_notes.rst)
- [Commits](Qiskit/qiskit@1.1.0...1.1.1)

---
updated-dependencies:
- dependency-name: qiskit
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Update README with Github discussion link

* Changed the wording to give more context

* Changed formatting to make it more readable

* Finalized wording
* add python 3.12 to CI

* use python 3.12 on RTD

* remove python 3.9 support/tests
@cosenal cosenal marked this pull request as ready for review June 26, 2024 21:45
@cosenal
Copy link
Contributor Author

cosenal commented Jun 27, 2024

Since v0.15.4, the Sphinx theme enabled parallel write. The next blocking factor is Jupyter-cache not supporting parallel execution, see executablebooks/jupyter-cache#37 and sphinx-doc/sphinx#12481.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation monitor-for-external-solution Tracking issues caused by external packages
Projects
None yet
Development

Successfully merging this pull request may close these issues.