Move non-target options from CompileTarget to CompileOptions - #5015
Open
lmondada wants to merge 1 commit into
Open
Move non-target options from CompileTarget to CompileOptions#5015lmondada wants to merge 1 commit into
lmondada wants to merge 1 commit into
Conversation
lmondada
force-pushed
the
lm/add-compile-options
branch
2 times, most recently
from
July 29, 2026 11:55
6c81f0d to
756137f
Compare
CI Summary (
|
| Job | Result |
|---|---|
binaries |
⏩ skipped |
build_and_test |
✅ success |
config_devdeps |
✅ success |
config_source_build |
⏩ skipped |
config_wheeldeps |
✅ success |
devdeps |
✅ success |
docker_image |
⏩ skipped |
gen_code_coverage |
⏩ skipped |
metadata |
✅ success |
python_metapackages |
⏩ skipped |
python_wheels |
⏩ skipped |
source_build |
⏩ skipped |
wheeldeps |
✅ success |
⏩ Skipped jobs (7) — intentionally skipped on PR builds; run on merge_group / workflow_dispatch
| Job |
|---|
binaries |
config_source_build |
docker_image |
gen_code_coverage |
python_metapackages |
python_wheels |
source_build |
All sub-jobs (42) — every matrix leg, with links
| Job | Status | Link |
|---|---|---|
| Build and test (amd64, gcc12, openmpi) / Dev environment (Debug) | ✅ success | view |
| Build and test (amd64, gcc12, openmpi) / Dev environment (Python) | ✅ success | view |
| Build and test (amd64, llvm, openmpi) / Dev environment (Debug) | ✅ success | view |
| Build and test (amd64, llvm, openmpi) / Dev environment (Python) | ✅ success | view |
| Build and test (arm64, llvm, openmpi) / Dev environment (Debug) | ✅ success | view |
| Build and test (arm64, llvm, openmpi) / Dev environment (Python) | ✅ success | view |
| CI Summary | ❔ in_progress | view |
| Configure build (devdeps) | ✅ success | view |
| Configure build (source_build) | ⏩ skipped | view |
| Configure build (wheeldeps) | ✅ success | view |
| Create CUDA Quantum installer | ⏩ skipped | view |
| Create Docker images | ⏩ skipped | view |
| Create Python metapackages | ⏩ skipped | view |
| Create Python wheels | ⏩ skipped | view |
| Gen code coverage | ⏩ skipped | view |
| Load dependencies (amd64, gcc12) / Caching | ✅ success | view |
| Load dependencies (amd64, gcc12) / Finalize | ✅ success | view |
| Load dependencies (amd64, gcc12) / Metadata | ✅ success | view |
| Load dependencies (amd64, llvm) / Caching | ✅ success | view |
| Load dependencies (amd64, llvm) / Finalize | ✅ success | view |
| Load dependencies (amd64, llvm) / Metadata | ✅ success | view |
| Load dependencies (arm64, gcc12) / Caching | ✅ success | view |
| Load dependencies (arm64, gcc12) / Finalize | ✅ success | view |
| Load dependencies (arm64, gcc12) / Metadata | ✅ success | view |
| Load dependencies (arm64, llvm) / Caching | ✅ success | view |
| Load dependencies (arm64, llvm) / Finalize | ✅ success | view |
| Load dependencies (arm64, llvm) / Metadata | ✅ success | view |
| Load source build cache | ⏩ skipped | view |
| Load wheel dependencies (amd64, 12.6) / Caching | ✅ success | view |
| Load wheel dependencies (amd64, 12.6) / Finalize | ✅ success | view |
| Load wheel dependencies (amd64, 12.6) / Metadata | ✅ success | view |
| Load wheel dependencies (amd64, 13.0) / Caching | ✅ success | view |
| Load wheel dependencies (amd64, 13.0) / Finalize | ✅ success | view |
| Load wheel dependencies (amd64, 13.0) / Metadata | ✅ success | view |
| Load wheel dependencies (arm64, 12.6) / Caching | ✅ success | view |
| Load wheel dependencies (arm64, 12.6) / Finalize | ✅ success | view |
| Load wheel dependencies (arm64, 12.6) / Metadata | ✅ success | view |
| Load wheel dependencies (arm64, 13.0) / Caching | ✅ success | view |
| Load wheel dependencies (arm64, 13.0) / Finalize | ✅ success | view |
| Load wheel dependencies (arm64, 13.0) / Metadata | ✅ success | view |
| Prepare cache clean-up | ❔ in_progress | view |
| Retrieve PR info | ✅ success | view |
✅ Required checks (6/6) — declared in .github/required-checks.yml for push
| Required check | Status | Link |
|---|---|---|
| Build and test (amd64, llvm, openmpi) / Dev environment (Debug) | ✅ success | view |
| Build and test (amd64, llvm, openmpi) / Dev environment (Python) | ✅ success | view |
| Build and test (arm64, llvm, openmpi) / Dev environment (Debug) | ✅ success | view |
| Build and test (arm64, llvm, openmpi) / Dev environment (Python) | ✅ success | view |
| Build and test (amd64, gcc12, openmpi) / Dev environment (Debug) | ✅ success | view |
| Build and test (amd64, gcc12, openmpi) / Dev environment (Python) | ✅ success | view |
lmondada
force-pushed
the
lm/add-compile-options
branch
7 times, most recently
from
July 30, 2026 09:49
c4c28b9 to
bfe18b5
Compare
lmondada
force-pushed
the
lm/add-compile-options
branch
2 times, most recently
from
July 30, 2026 16:52
3ed85dd to
43a695f
Compare
Signed-off-by: Luca Mondada <luca@mondada.net>
lmondada
force-pushed
the
lm/add-compile-options
branch
from
July 31, 2026 12:50
43a695f to
9cbadac
Compare
lmondada
marked this pull request as ready for review
July 31, 2026 16:57
Renaud-K
reviewed
Jul 31, 2026
| namespace cudaq { | ||
|
|
||
| /// Combine \p val into an existing hash \p seed (boost-style). | ||
| template <typename T> |
Collaborator
There was a problem hiding this comment.
Can this be in the detail namespace.
Renaud-K
reviewed
Jul 31, 2026
|
|
||
| struct CompileOptions { | ||
| /// Issue a warning if named measurements are contained in the kernel. | ||
| default_false warnNamedMeasurements; |
Collaborator
There was a problem hiding this comment.
Does it buy us a lot over
bool val = <true|false>
?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR splits the options within
CompileTargetinto two structs:CompileTargetandCompileOptions. The target should focus on describing the target in a way that is agnostic of launch policy and execution details. The compile options on the other hand describe options that can apply to any target.I'm mirroring the ADL pattern of
finalize_execution_managerto keep the definitions of overloads ofget_compile_optionsfor each policy next to the policy definition.Motivation
The goal of this work is to render
QPU::getCompileTargetindependent of policy and QPU runtime configuration. The quantum platform should be able to query the compile target once and then store it. This separation is required to enable the compile-runtime split that #5005 introduces.Illustration of the
CompileTarget-CompileOptionssplitTo illustrate this, some of the flags that
CompileTargetcontains are:supportConditionalsOnMeasureResults: whether the target supports conditionalssupportDeviceCalls: whether the target supports device callsCompileOptionson the other hand contains:emitJit,emitResourceCounts: whether the compilation should produce a jitEngine or resource countsaddMeasurements: whether to add measurements at the end of a kernel for samplingemulate: whether the compilation should be adjusted to target emulationRemaining work
Looking at all implementations of
QPU::getCompileTarget, the only blockers to unifying all overloads areCompileTargetis still parametrised on theemulateandisLocalSimulatorflags. We will be able to remove this once this flag can be queried from the runtime endpoint instead.BaseRemoteRESTQPU::getCompileTarget(observe_policy, ...)setstarget.pauliTermSplitObservablewhich informs the compiler whether the spin observable should be split at compilation time. The better solution would be to ONLY provide a custom implementation ofobservewhen no splitting is required. Once we have runtime endpoints, we will be able to check whether a custom observe implementation is provided and otherwise fall back to decomposing the spin into multiple sample calls without involving the QPU.BaseRemoteRESTQPU::getCompileTarget(dem_policy, ...)currently has an optimisation to bypass an unnecessary round-trip through theServerHelper(which may trigger an API call). We should re-evaluate once everything else is in place whether this optimisation is worth keeping with some custom logic. If that is too brittle, accepting the extra API call is a reasonable fallback option.