Allow setting qpu mode in device - #92
Conversation
|
☂️ Code Coverage
Overall Coverage
New FilesNo new covered files... Modified Files
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Pull request overview
Adds support for explicitly setting a qpu_mode on Device (and downstream task/future objects) so callers can select a backend QPU mode without creating a separate qlam context per mode.
Changes:
- Introduces
qpu_mode: str | NoneonAuthMixin, making it available onDevice,TaskABC, andFuture. - Plumbs
qpu_modethrough task submission and future backend calls (create/get/cancel/results fetch). - Adds/updates tests and demo usage to validate and illustrate the new behavior.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
src/bloqade/core/device/mixins.py |
Adds qpu_mode field to the shared auth/context mixin. |
src/bloqade/core/device/device.py |
Passes qpu_mode from Device into all created task shapes. |
src/bloqade/core/device/task.py |
Includes qpu_mode when creating tasks and attaches it to returned futures. |
src/bloqade/core/device/future.py |
Passes qpu_mode through all backend API calls and preserves it in constructors/classmethods. |
test/device/fixtures/remote.py |
Updates fake API clients to accept/record optional qpu_mode. |
test/device/test_task.py |
Adds coverage that task submission forwards explicit qpu_mode. |
test/device/test_future.py |
Adds coverage that futures preserve/forward explicit qpu_mode on backend calls. |
test/device/test_device.py |
Adds coverage that Device propagates qpu_mode into all task builders. |
demo/qasm_single_task_simpler_serialization.py |
Demonstrates setting qpu_mode on a device. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
note here @david-pl / @tahoe-quera as i want to make sure this gets added in the right place. A qpu mode is not part of auth -- i see its added to "AuthMixin"? Auth is separate and unrelated to qpu mode. You authenticate first from the "context". Then you go to make a request to a qpu mode. You can make requests to any qpu mode on that machine with the same auth token, so the qpu_mode should be set somewhere on the request object i think. I am not sure if there is a separate type for that, but we may expose it already from qlam-core. I will have to check on this. |
|
@kylequera thanks for checking in! It's somewhat separate from authentication, |
Ok - follow up question. There may be a request from the aist team to allow ENV overrides of the configuration. We are planning to do something at the qlam-core layer, but i think we may need the ability to do that from bloqade as well to pass it down. We can follow up on this when looking into it. Just want to make sure we have the ability to pass different parts of the configuration through bloqade to qlam-core. |
|
I see. Well, right now there's just the options of setting qpu-mode and context name, since those are the APIs qlam-core offers to set things. I could split out a |
| that can be dry-run or submitted asynchronously. | ||
|
|
||
| Attributes: | ||
| qpu_mode (str | None): Explicit qlam QPU mode used by tasks created |
There was a problem hiding this comment.
instead of passing a single qpu_mode in here, would it make sense to pass the full ConfigMixin for future proofing passing config around?
Closes #91.
Can now do