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

Fix BulkSetAmpl bug, Add more diff cuquantum unit tests #17

Merged
merged 9 commits into from
May 5, 2023

Conversation

jaeyoo
Copy link
Owner

@jaeyoo jaeyoo commented May 4, 2023

From this PR, other differentiators like ParameterShift(), LinearCombination and its subclasses can be accelerated with cuquantum expectation and sampled_expectation op.

@jaeyoo jaeyoo requested a review from Sinestro38 May 4, 2023 01:22
@jaeyoo
Copy link
Owner Author

jaeyoo commented May 4, 2023

I also fixed the random seeds at the end of each test in expectation_test and sampled_expectation_test because they are using internal keras layer with randomly initialized weights.

I also found and fixed that the two keras layers were using predefined initializer at the function argument default value position of __init__(). In python, this creates an object and cached it, and then re-use it whenever the new object is created. That doesn't make sense, so Keras team also guided to avoid the usage. After moving it into function body, we can see the errors from the same random initializer gone.

Also, I added initializers in each test in expectation_test and sampled_expectation_test to fix the random behavior in the test.

Now I confirmed that both ./scripts/test_all.sh gpu and ./scripts/test_all.sh passed.

@jaeyoo jaeyoo requested a review from Sinestro38 May 4, 2023 22:45
@jaeyoo jaeyoo merged commit 9949d25 into master May 5, 2023
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.

2 participants