Repository navigation
Remove the bare-RESULT path & fix sample with named measurements on QIR output logs - #5768
Merged
khalatepradnya merged 3 commits intoOct 30, 2026
Merged
Conversation
`RecordLogParser` collected RESULT records that arrive outside an ARRAY into an implicit array, sized by the `required_num_results` metadata. `qir-insert-array-record` pass, which declares an `array<i1 x N>` before the result records of every sampled entry point. Both QIR lowering pipelines now run the pass, and `quantinuum` is the only target that sends output logs to the parser, so the implicit array has no producer left. A RESULT record outside an ARRAY now throws. The parser reads no METADATA values anymore, so the `required_num_results` special case and the metadata map go too. The parser tests wrap their RESULT records in ARRAY records, as current logs do. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Pradnya Khalate <pkhalate@nvidia.com>
`sample` on a QIR output log threw "Duplicate container index" for a kernel with two named measurement registers, or with a named measurement next to an unnamed one. The parser read a result's index from its label: `r00003` gave 3 and `name%2` gave 2. But a label is a register name. `UpdateRegisterNames` restarts the `%` suffix for each register, and the `r` counter counts only unnamed results, so two results can claim the same index. Results arrive in the order the kernel measured them, which is the order codegen numbers them in, so a result's index is its position in its array. The parser no longer reads RESULT labels. Also from review of the previous commit: drop a stale comment on `ContainerStorage`, correct the RESULT-branch comment, and test a shot that carries more results than its array declares, which the old parser turned into an extra row. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Pradnya Khalate <pkhalate@nvidia.com>
khalatepradnya
force-pushed
the
fix/drop-bare-result-records
branch
from
October 29, 2026 18:37
ef3a5b4 to
0a44b7d
Compare
khalatepradnya
marked this pull request as ready for review
October 29, 2026 18:43
Signed-off-by: Pradnya Khalate <pkhalate@nvidia.com>
1tnguyen
approved these changes
Oct 29, 2026
1tnguyen
left a comment
Collaborator
There was a problem hiding this comment.
👍 Thanks @khalatepradnya!
khalatepradnya
enabled auto-merge
October 29, 2026 20:56
CI Summary (
|
| Job | Result |
|---|---|
binaries |
⏩ skipped |
build_and_test |
✅ success |
changes |
✅ success |
config_devdeps |
✅ success |
config_source_build |
⏩ skipped |
config_wheeldeps |
✅ success |
devdeps |
✅ success |
docker_image |
⏩ skipped |
documentation |
✅ success |
gen_code_coverage |
⏩ skipped |
metadata |
✅ success |
python_devel_wheel |
⏩ skipped |
python_metapackages |
⏩ skipped |
python_wheels |
⏩ skipped |
python_wheels_cu12_validation |
⏩ skipped |
python_wheels_cu13 |
⏩ skipped |
source_build |
⏩ skipped |
wheeldeps |
✅ success |
⏩ Skipped jobs (10) — intentionally skipped on PR builds; run on merge_group / workflow_dispatch
| Job |
|---|
binaries |
config_source_build |
docker_image |
gen_code_coverage |
python_devel_wheel |
python_metapackages |
python_wheels_cu12_validation |
python_wheels_cu13 |
python_wheels |
source_build |
All sub-jobs (47) — 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 |
| Check for stable CUDA-Q changes | ✅ success | view |
| Configure build (devdeps) | ✅ success | view |
| Configure build (source_build) | ⏩ skipped | view |
| Configure build (wheeldeps) | ✅ success | view |
| Create CUDA 12 Python wheels | ⏩ skipped | view |
| Create CUDA 13 Python wheels | ⏩ skipped | view |
| Create CUDA Quantum installer | ⏩ skipped | view |
| Create Docker images | ⏩ skipped | view |
| Create Python metapackages | ⏩ skipped | view |
| Create shared Python development wheel | ⏩ skipped | view |
| Documentation / Build and check docs | ✅ success | 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 |
| Validate CUDA 12 Python wheels | ⏩ skipped | view |
✅ Required checks (7/7) — 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 |
| Documentation / Build and check docs | ✅ success | view |
CI Summary (
|
| Job | Result |
|---|---|
binaries |
⏩ skipped |
build_and_test |
✅ success |
changes |
✅ success |
config_devdeps |
✅ success |
config_source_build |
⏩ skipped |
config_wheeldeps |
⏩ skipped |
devdeps |
✅ success |
docker_image |
⏩ skipped |
documentation |
⏩ skipped |
gen_code_coverage |
⏩ skipped |
metadata |
✅ success |
python_devel_wheel |
⏩ skipped |
python_metapackages |
⏩ skipped |
python_wheels |
⏩ skipped |
python_wheels_cu12_validation |
⏩ skipped |
python_wheels_cu13 |
⏩ skipped |
source_build |
⏩ skipped |
wheeldeps |
⏩ skipped |
⏩ Skipped jobs (13) — intentionally skipped on PR builds; run on merge_group / workflow_dispatch
| Job |
|---|
binaries |
config_source_build |
config_wheeldeps |
docker_image |
documentation |
gen_code_coverage |
python_devel_wheel |
python_metapackages |
python_wheels_cu12_validation |
python_wheels_cu13 |
python_wheels |
source_build |
wheeldeps |
All sub-jobs (28) — every matrix leg, with links
| Job | 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 |
| CI Summary | ❔ in_progress | view |
| Check for stable CUDA-Q changes | ✅ success | view |
| Configure build (devdeps) | ✅ success | view |
| Configure build (source_build) | ⏩ skipped | view |
| Configure build (wheeldeps) | ⏩ skipped | view |
| Create CUDA 12 Python wheels | ⏩ skipped | view |
| Create CUDA 13 Python wheels | ⏩ skipped | view |
| Create CUDA Quantum installer | ⏩ skipped | view |
| Create Docker images | ⏩ skipped | view |
| Create Python metapackages | ⏩ skipped | view |
| Create shared Python development wheel | ⏩ skipped | view |
| Documentation | ⏩ skipped | view |
| Gen code coverage | ⏩ skipped | 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, 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 | ⏩ skipped | view |
| Prepare cache clean-up | ❔ in_progress | view |
| Retrieve PR info | ✅ success | view |
| Validate CUDA 12 Python wheels | ⏩ skipped | view |
✅ Required checks (4/4) — declared in .github/required-checks.yml for merge_group_fast
| 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 |
anpaz
pushed a commit
to justinlietz/cuda-quantum
that referenced
this pull request
Oct 30, 2026
…IR output logs (NVIDIA#5768) ### Summary - Removes the `RecordLogParser` path that accepted `RESULT` records without an enclosing `ARRAY` record. Such a record is now an error, and the parser no longer reads `METADATA` values. - Indexes each `RESULT` record by its position in its array, which fixes those kernels. ### Motivation - NVIDIA#3553 added `qir-insert-array-record`, which declares an `array<i1 x N>` before the result records of every sampled entry point. It kept the bare-`RESULT` path as a temporary workaround "until all backends consistently use the new transformation pass". - That condition holds now: - Both QIR lowering pipelines schedule the pass (`addConvertToQIRAPIPipeline` and `addWiresetToProfileQIRPipeline`). - The pass counts every `result_record_output` call in the entry point, user-specified measurements included. It skips only `run` entry points, whose logs carry typed return-value records. - `quantinuum` is the only target that enables `output_log`, and `QuantinuumServerHelper` is the only caller of `createSampleResultFromQirOutput`. - Indices from labels: - The parser read a result's index from its label: `r00003` gave 3 and `name%2` gave 2. But a label is a register name. `UpdateRegisterNames` restarts the `%` suffix for each register, and the `r` counter counts only unnamed results. - Records arrive in the order the kernel measured them, which is the order codegen numbers results in (`ConvertToQIRAPI.cpp`). A result's index is its position in its array. - NVIDIA#3530 added the label parsing for a log whose records arrived out of order. No current producer reorders them (`qci` was removed) - Sub-registers: This path returns only the global register, as before. Sub-registers in `sample_result` are deprecated, as the runtime warns. --------- Signed-off-by: Pradnya Khalate <pkhalate@nvidia.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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.
Summary
RecordLogParserpath that acceptedRESULTrecords without an enclosingARRAYrecord. Such a record is now an error, and the parser no longer readsMETADATAvalues.RESULTrecord by its position in its array, which fixes those kernels.Motivation
qir-insert-array-record, which declares anarray<i1 x N>before the result records of every sampled entry point. It kept the bare-RESULTpath as a temporary workaround "until all backends consistently use the new transformation pass".addConvertToQIRAPIPipelineandaddWiresetToProfileQIRPipeline).result_record_outputcall in the entry point, user-specified measurements included. It skips onlyrunentry points, whose logs carry typed return-value records.quantinuumis the only target that enablesoutput_log, andQuantinuumServerHelperis the only caller ofcreateSampleResultFromQirOutput.r00003gave 3 andname%2gave 2. But a label is a register name.UpdateRegisterNamesrestarts the%suffix for each register, and thercounter counts only unnamed results.ConvertToQIRAPI.cpp). A result's index is its position in its array.qciwas removed)sample_resultare deprecated, as the runtime warns.