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

Round durations in GenericBackendV2 (backport #11780) #12079

Merged
merged 1 commit into from
Mar 28, 2024

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Mar 25, 2024

Summary

This PR makes sure that the conversion of GenericBackendV2 instruction durations to dt is exact to avoid user warnings during scheduling of type:

UserWarning: Duration is rounded to 616 [dt] = 1.367520e-07 [s] from 1.366887e-07 [s]

Given that the durations are sampled randomly, and the rounded duration is the one used in the scheduling passes, we might as well make sure in advance that the conversion from seconds to dt will be exact and doesn't raise warnings.

Details and comments

I am not sure this qualifies as a bugfix but I think it improves the readability of the test logs. For example, for test_scheduling_backend_v2 in test/python/compiler/test_transpiler.py. Before:

/Users/ept/qiskit_workspace/qiskit/qiskit/circuit/duration.py:37: UserWarning: Duration is rounded to 986 [dt] = 2.188920e-07 [s] from 2.189841e-07 [s]
  warnings.warn(
/Users/ept/qiskit_workspace/qiskit/qiskit/circuit/duration.py:37: UserWarning: Duration is rounded to 2740 [dt] = 6.082800e-07 [s] from 6.083383e-07 [s]
  warnings.warn(
/Users/ept/qiskit_workspace/qiskit/qiskit/circuit/duration.py:37: UserWarning: Duration is rounded to 2697 [dt] = 5.987340e-07 [s] from 5.988312e-07 [s]
  warnings.warn(
/Users/ept/qiskit_workspace/qiskit/qiskit/circuit/duration.py:37: UserWarning: Duration is rounded to 178 [dt] = 3.951600e-08 [s] from 3.956636e-08 [s]
  warnings.warn(
.
----------------------------------------------------------------------
Ran 1 test in 0.548s

OK

After:

.
----------------------------------------------------------------------
Ran 1 test in 0.506s

OK

This is an automatic backport of pull request #11780 done by [Mergify](https://mergify.com).

* Round durations

* Update generic_backend_v2.py

* Clamp rounded durations

(cherry picked from commit 35a8e53)
@mergify mergify bot requested review from jyu00 and a team as code owners March 25, 2024 16:43
@qiskit-bot
Copy link
Collaborator

Thank you for opening a new pull request.

Before your PR can be merged it will first need to pass continuous integration tests and be reviewed. Sometimes the review process can be slow, so please be patient.

While you're waiting, please feel free to review other open PRs. While only a subset of people are authorized to approve pull requests for merging, everyone is encouraged to review open pull requests. Doing reviews helps reduce the burden on the core team and helps make the project's code better for everyone.

One or more of the the following people are requested to review this:

  • @Qiskit/terra-core

@github-actions github-actions bot added the Changelog: None Do not include in changelog label Mar 25, 2024
@github-actions github-actions bot added this to the 1.0.3 milestone Mar 25, 2024
@coveralls
Copy link

Pull Request Test Coverage Report for Build 8423731036

Details

  • 4 of 4 (100.0%) changed or added relevant lines in 1 file are covered.
  • 22 unchanged lines in 2 files lost coverage.
  • Overall coverage decreased (-0.03%) to 89.285%

Files with Coverage Reduction New Missed Lines %
crates/qasm2/src/lex.rs 4 91.6%
crates/qasm2/src/parse.rs 18 96.69%
Totals Coverage Status
Change from base Build 8421244435: -0.03%
Covered Lines: 58888
Relevant Lines: 65955

💛 - Coveralls

@1ucian0 1ucian0 added this pull request to the merge queue Mar 28, 2024
Merged via the queue into stable/1.0 with commit ab17095 Mar 28, 2024
14 checks passed
@mergify mergify bot deleted the mergify/bp/stable/1.0/pr-11780 branch March 28, 2024 22:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changelog: None Do not include in changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants