-
Notifications
You must be signed in to change notification settings - Fork 632
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
dynamic_one_shot
uses tapes with shot-vectors and jitting takes advantage of it
#5617
Conversation
Co-authored-by: Christina Lee <christina@xanadu.ai>
Co-authored-by: Mudit Pandey <mudit.pandey@xanadu.ai>
…o feature/batched_tape
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changelog?
Co-authored-by: Christina Lee <christina@xanadu.ai>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be worth investigating if we can somehow use use multi-processing with this in the future.
Thanks for doing all this investigation!
That's actually the original idea behind having multiple tapes instead of shots. On the other hand, I think multi-processing might be better turned-on at the QNode level, or maybe with a decorator. I think any device with a batch of tapes could be executing them in parallel inside sub-processes. |
Why couldn't you parallelize with shots instead of tapes? |
The current multiprocessing logic live here. It is not a fundamental limitation, it's just our UI is not set up for it. |
Before submitting
Please complete the following checklist when submitting a PR:
All new features must include a unit test.
If you've fixed a bug or added code that should be tested, add a test to the
test directory!
All new functions and code must be clearly commented and documented.
If you do make documentation changes, make sure that the docs build and
render correctly by running
make docs
.Ensure that the test suite passes, by running
make test
.Add a new entry to the
doc/releases/changelog-dev.md
file, summarizing thechange, and including a link back to the PR.
The PennyLane source code conforms to
PEP8 standards.
We check all of our code against Pylint.
To lint modified files, simply
pip install pylint
, and thenrun
pylint pennylane/path/to/file.py
.When all the above are checked, delete everything above the dashed
line and fill in the pull request template.
Context:
dynamic_one_shot
creates n-shots tapes which is wasteful.Description of the Change:
Create a single tape with a shot-vector which indicates to the device how many times to repeat the tape execution.
Benefits:
For a tape like
The execution times are as follows (Latitude laptop):
Possible Drawbacks:
Related GitHub Issues:
[sc-62097]