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

Unsupported native gates #1504

Merged
merged 2 commits into from
Nov 4, 2024
Merged

Unsupported native gates #1504

merged 2 commits into from
Nov 4, 2024

Conversation

csookim
Copy link
Member

@csookim csookim commented Oct 29, 2024

Unroller generates an error when initialized with unsupported gates.

https://github.com/qiboteam/qibolab/actions/runs/11569426877/job/32203123767?pr=1083#step:10:259

In this PR, when qibo receives native gates, unsupported gates will be ignored. Should we require backends to match qibo’s native gate set?

Checklist:

  • Reviewers confirm new code works as expected.
  • Tests are passing.
  • Coverage does not decrease.
  • Documentation is updated.

qiboteam/qibolab#1083

@csookim csookim added the bug Something isn't working label Oct 29, 2024
Copy link

codecov bot commented Oct 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.74%. Comparing base (a074d17) to head (23423a9).
Report is 24 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1504   +/-   ##
=======================================
  Coverage   99.74%   99.74%           
=======================================
  Files          80       80           
  Lines       11768    11772    +4     
=======================================
+ Hits        11738    11742    +4     
  Misses         30       30           
Flag Coverage Δ
unittests 99.74% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@alecandido
Copy link
Member

Ok, it should be fine to ignore the native gates which are unsupported, and restrict to the known ones. The alternative is just failing, but this is what it would happen anyhow if the restricted set of natives won't allow you to transpile (to save computation, we may introduce ahead of time checks, but if there is no way to tell it in advance, attempting and failing is just the best we could do).

I'm not sure which is the practical motivation in this case (I guess coming from Qibolab), which instead may be worth to address even in a separate way (though this is still fine to me).
@stavros11 do you see any major drawback in this approach?

@csookim csookim marked this pull request as ready for review October 29, 2024 12:54
@alecandido alecandido requested a review from stavros11 October 30, 2024 12:43
Copy link
Member

@stavros11 stavros11 left a comment

Choose a reason for hiding this comment

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

If I understand this correctly, the motivation is to avoid failure when the qibolab platform/compiler provides more native gates than the transpiler "knows". In that case, transpilation should still be possible using the intersection of gates supported by the transpiler and compiler/platform.

Other than the fact that it may be a bit suboptimal, as I would expect the gate limitation to come primarily from the hardware, not the transpiler, I do not see any major drawback so I am approving.

@csookim csookim added this pull request to the merge queue Nov 4, 2024
Merged via the queue into master with commit 05b57e9 Nov 4, 2024
27 checks passed
@csookim csookim deleted the bug/no_natives branch November 4, 2024 05:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants