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

BasisTranslator causes transpiler performance regression #4632

Closed
mtreinish opened this issue Jun 30, 2020 · 0 comments · Fixed by #4636
Closed

BasisTranslator causes transpiler performance regression #4632

mtreinish opened this issue Jun 30, 2020 · 0 comments · Fixed by #4636
Assignees
Labels
bug Something isn't working priority: high status: pending PR It has one or more PRs pending to solve this issue
Milestone

Comments

@mtreinish
Copy link
Member

Information

  • Qiskit Terra version: Master
  • Python version: any
  • Operating system: any

What is the current behavior?

Since #4446 merged transpiler runtime performance has regressed, for example:

Steps to reproduce the problem

What is the expected behavior?

Suggested solutions

@mtreinish mtreinish added bug Something isn't working priority: high labels Jun 30, 2020
@mtreinish mtreinish added this to the 0.15 milestone Jun 30, 2020
kdk added a commit to kdk/qiskit-terra that referenced this issue Jul 1, 2020
When replacing source gates with their target implementations, the
BasisTranslator pass had been assigning parameters for every gate
replacement which is expensive (as it requires a deepcopy of the
target DAG) and in most cases unnecessary (unless the source gate
has parameters which need to be bound).

This commit checks that the source gate needs parameter assignment,
and uses the target implementation directly if not. (The round-trip
to circuit for cases where parameter assignment will be addressed in
a later PR.)

Resolves Qiskit#4632 .
@kdk kdk added the status: pending PR It has one or more PRs pending to solve this issue label Jul 1, 2020
@mergify mergify bot closed this as completed in #4636 Jul 8, 2020
mergify bot added a commit that referenced this issue Jul 8, 2020
…4636)

When replacing source gates with their target implementations, the
BasisTranslator pass had been assigning parameters for every gate
replacement which is expensive (as it requires a deepcopy of the
target DAG) and in most cases unnecessary (unless the source gate
has parameters which need to be bound).

This commit checks that the source gate needs parameter assignment,
and uses the target implementation directly if not. (The round-trip
to circuit for cases where parameter assignment will be addressed in
a later PR.)

Resolves #4632 .

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: Matthew Treinish <[email protected]>
faisaldebouni pushed a commit to faisaldebouni/qiskit-terra that referenced this issue Aug 5, 2020
…iskit#4636)

When replacing source gates with their target implementations, the
BasisTranslator pass had been assigning parameters for every gate
replacement which is expensive (as it requires a deepcopy of the
target DAG) and in most cases unnecessary (unless the source gate
has parameters which need to be bound).

This commit checks that the source gate needs parameter assignment,
and uses the target implementation directly if not. (The round-trip
to circuit for cases where parameter assignment will be addressed in
a later PR.)

Resolves Qiskit#4632 .

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: Matthew Treinish <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working priority: high status: pending PR It has one or more PRs pending to solve this issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants