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

Add support for custom resets using the @Reset() attribute #1981

Merged
merged 9 commits into from
Oct 29, 2024

Conversation

orpuente-MS
Copy link
Contributor

@orpuente-MS orpuente-MS commented Oct 29, 2024

This PR adds support for custom resets using the @Reset attribute. It consists of the following changes:

  • Adding a @Reset attribute to the language.
  • Piping it down to FIR.
  • Using the attribute to generate the correct QIR, including the "irreversible" attribute.
  • Semantic validation passes in qsc_passes based on the @Reset attribute.
  • The right handling of reset operations during partial evaluation.
  • Unit tests.
  • Update previous tests to include the #1 irreversible attribute in QIR when calling the Reset operation.

Copy link

Change in memory usage detected by benchmark.

Memory Report for 44c05c2

Test This Branch On Main Difference
compile core + standard lib 17964197 bytes 17945380 bytes 18817 bytes

Copy link

Change in memory usage detected by benchmark.

Memory Report for 94bfb0f

Test This Branch On Main Difference
compile core + standard lib 17964197 bytes 17945380 bytes 18817 bytes

Copy link

Change in memory usage detected by benchmark.

Memory Report for cb50809

Test This Branch On Main Difference
compile core + standard lib 17964197 bytes 17945380 bytes 18817 bytes

Copy link

Change in memory usage detected by benchmark.

Memory Report for 23a28e2

Test This Branch On Main Difference
compile core + standard lib 17964197 bytes 17945380 bytes 18817 bytes

Co-authored-by: Stefan J. Wernli <swernli@microsoft.com>
Copy link

Change in memory usage detected by benchmark.

Memory Report for 37b3e22

Test This Branch On Main Difference
compile core + standard lib 17964197 bytes 17945380 bytes 18817 bytes

Copy link

Change in memory usage detected by benchmark.

Memory Report for 3a3498d

Test This Branch On Main Difference
compile core + standard lib 17964197 bytes 17945380 bytes 18817 bytes

Copy link

Change in memory usage detected by benchmark.

Memory Report for bf92955

Test This Branch On Main Difference
compile core + standard lib 17964197 bytes 17945380 bytes 18817 bytes

Copy link
Collaborator

@swernli swernli left a comment

Choose a reason for hiding this comment

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

Signed off with some minor comments, nothing that I think prevents merging (especially since we may follow up with unifying Measurement and Reset handling using this infrastructure after the release).

Co-authored-by: César Zaragoza Cortés <cesarzc@microsoft.com>
Copy link

Change in memory usage detected by benchmark.

Memory Report for 8e3f8d2

Test This Branch On Main Difference
compile core + standard lib 17964197 bytes 17945380 bytes 18817 bytes

Copy link
Contributor

@cesarzc cesarzc left a comment

Choose a reason for hiding this comment

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

Signing off, looking forward to the unification PR!

@orpuente-MS orpuente-MS enabled auto-merge October 29, 2024 21:53
@orpuente-MS orpuente-MS added this pull request to the merge queue Oct 29, 2024
Merged via the queue into main with commit dc2f1cf Oct 29, 2024
18 checks passed
@orpuente-MS orpuente-MS deleted the oscarpuente/custom-resets branch October 29, 2024 22:12
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.

3 participants