Skip to content

[qBraid] Reject non-gate-model devices at target initialization#4737

Open
TheGupta2012 wants to merge 2 commits into
NVIDIA:mainfrom
qBraid:qbraid-device-filtering
Open

[qBraid] Reject non-gate-model devices at target initialization#4737
TheGupta2012 wants to merge 2 commits into
NVIDIA:mainfrom
qBraid:qbraid-device-filtering

Conversation

@TheGupta2012

@TheGupta2012 TheGupta2012 commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Summary

The qbraid target brokers gate-based, analog/AHS, and annealing devices under one device-ID namespace. Selecting a non-gate device (e.g.aws:quera:qpu:aquila) is currently accepted, then fails downstream as an opaque FAILED + 404 on /result. Unlike single-paradigm targets (braket, quera), the qBraid target can't rely on target separation, so it needs an explicit paradigm check.

What changes

QbraidServerHelper::initialize() now queries GET /devices/{device_qrn} and rejects any device whose paradigm is not gate_model, with an actionable error at target-configuration time:

qBraid device 'aws:quera:qpu:aquila' has paradigm 'analog', which cannot run
gate-based CUDA-Q kernels. The 'qbraid' target supports only gate-model devices.

The check is best-effort: emulation, missing API key, or network/lookup errors fall through to existing behavior. Both the Python and C++ paths run through initialize(), so one check covers both.

Testing

  • Python: test_qbraid_rejects_analog_device + test_qbraid_accepts_gate_model_device; mock gains a GET /devices endpoint (13/13 pass).
  • C++: checkAnalogDeviceRejected in QbraidTester (suite passes).

Verified against a from-source build (LLVM 22.1.4). Docs updated with the gate-model-only note.

Signed-off-by: TheGupta2012 <harshit.11235@gmail.com>
@copy-pr-bot

copy-pr-bot Bot commented Jun 15, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@mitchdz

mitchdz commented Jun 15, 2026

Copy link
Copy Markdown
Collaborator

/ok to test fa58493

Command Bot: Processing...

@mitchdz mitchdz temporarily deployed to ghcr-deployment June 15, 2026 16:37 — with GitHub Actions Inactive
@mitchdz mitchdz temporarily deployed to ghcr-deployment June 15, 2026 16:37 — with GitHub Actions Inactive
@mitchdz mitchdz temporarily deployed to ghcr-deployment June 15, 2026 16:37 — with GitHub Actions Inactive
@mitchdz mitchdz temporarily deployed to ghcr-deployment June 15, 2026 16:37 — with GitHub Actions Inactive
@mitchdz mitchdz temporarily deployed to ghcr-deployment June 15, 2026 16:37 — with GitHub Actions Inactive
@mitchdz mitchdz temporarily deployed to ghcr-deployment June 15, 2026 16:37 — with GitHub Actions Inactive
@mitchdz mitchdz temporarily deployed to ghcr-deployment June 15, 2026 16:37 — with GitHub Actions Inactive
@mitchdz mitchdz temporarily deployed to ghcr-deployment June 15, 2026 16:37 — with GitHub Actions Inactive
@mitchdz mitchdz temporarily deployed to ghcr-deployment June 15, 2026 16:37 — with GitHub Actions Inactive
@mitchdz mitchdz temporarily deployed to ghcr-deployment June 15, 2026 16:37 — with GitHub Actions Inactive
@mitchdz mitchdz temporarily deployed to ghcr-deployment June 15, 2026 16:37 — with GitHub Actions Inactive
@mitchdz mitchdz temporarily deployed to ghcr-deployment June 15, 2026 16:37 — with GitHub Actions Inactive
@mitchdz mitchdz temporarily deployed to ghcr-deployment June 15, 2026 16:37 — with GitHub Actions Inactive
@mitchdz mitchdz temporarily deployed to ghcr-deployment June 15, 2026 16:37 — with GitHub Actions Inactive
@mitchdz mitchdz temporarily deployed to ghcr-deployment June 15, 2026 16:37 — with GitHub Actions Inactive
@mitchdz mitchdz temporarily deployed to ghcr-deployment June 15, 2026 16:37 — with GitHub Actions Inactive
@mitchdz mitchdz temporarily deployed to ghcr-deployment June 15, 2026 16:37 — with GitHub Actions Inactive
@mitchdz mitchdz temporarily deployed to ghcr-deployment June 15, 2026 16:37 — with GitHub Actions Inactive
@mitchdz mitchdz temporarily deployed to ghcr-deployment June 15, 2026 16:37 — with GitHub Actions Inactive
@mitchdz mitchdz temporarily deployed to ghcr-deployment June 15, 2026 16:37 — with GitHub Actions Inactive
@mitchdz mitchdz temporarily deployed to ghcr-deployment June 15, 2026 16:37 — with GitHub Actions Inactive
@mitchdz mitchdz temporarily deployed to ghcr-deployment June 15, 2026 16:37 — with GitHub Actions Inactive
@mitchdz mitchdz temporarily deployed to ghcr-deployment June 15, 2026 16:37 — with GitHub Actions Inactive
@mitchdz mitchdz temporarily deployed to ghcr-deployment June 15, 2026 16:37 — with GitHub Actions Inactive
@mitchdz mitchdz temporarily deployed to ghcr-deployment June 15, 2026 16:37 — with GitHub Actions Inactive
@mitchdz mitchdz temporarily deployed to ghcr-deployment June 15, 2026 16:37 — with GitHub Actions Inactive
@mitchdz mitchdz temporarily deployed to ghcr-deployment June 15, 2026 16:37 — with GitHub Actions Inactive
@mitchdz mitchdz temporarily deployed to ghcr-deployment June 15, 2026 16:48 — with GitHub Actions Inactive
@mitchdz mitchdz temporarily deployed to ghcr-deployment June 15, 2026 16:48 — with GitHub Actions Inactive
@mitchdz mitchdz temporarily deployed to ghcr-deployment June 15, 2026 16:48 — with GitHub Actions Inactive
@mitchdz mitchdz temporarily deployed to ghcr-deployment June 15, 2026 16:48 — with GitHub Actions Inactive
@mitchdz mitchdz temporarily deployed to ghcr-deployment June 15, 2026 16:48 — with GitHub Actions Inactive
@mitchdz mitchdz temporarily deployed to ghcr-deployment June 15, 2026 16:48 — with GitHub Actions Inactive
@mitchdz mitchdz temporarily deployed to ghcr-deployment June 15, 2026 16:48 — with GitHub Actions Inactive
@mitchdz mitchdz temporarily deployed to ghcr-deployment June 15, 2026 16:48 — with GitHub Actions Inactive
@mitchdz mitchdz temporarily deployed to ghcr-deployment June 15, 2026 16:48 — with GitHub Actions Inactive
@mitchdz mitchdz temporarily deployed to ghcr-deployment June 15, 2026 16:48 — with GitHub Actions Inactive
@mitchdz mitchdz temporarily deployed to ghcr-deployment June 15, 2026 16:58 — with GitHub Actions Inactive
@mitchdz mitchdz temporarily deployed to ghcr-deployment June 15, 2026 16:58 — with GitHub Actions Inactive
@mitchdz mitchdz temporarily deployed to ghcr-deployment June 15, 2026 16:58 — with GitHub Actions Inactive
@mitchdz mitchdz temporarily deployed to ghcr-deployment June 15, 2026 16:58 — with GitHub Actions Inactive
@mitchdz mitchdz temporarily deployed to ghcr-deployment June 15, 2026 16:58 — with GitHub Actions Inactive
@mitchdz mitchdz temporarily deployed to ghcr-deployment June 15, 2026 16:58 — with GitHub Actions Inactive
@mitchdz mitchdz temporarily deployed to ghcr-deployment June 15, 2026 16:59 — with GitHub Actions Inactive
@mitchdz mitchdz temporarily deployed to ghcr-deployment June 15, 2026 16:59 — with GitHub Actions Inactive
@mitchdz mitchdz temporarily deployed to ghcr-deployment June 15, 2026 16:59 — with GitHub Actions Inactive
@mitchdz mitchdz temporarily deployed to ghcr-deployment June 15, 2026 16:59 — with GitHub Actions Inactive
@mitchdz mitchdz temporarily deployed to ghcr-deployment June 15, 2026 16:59 — with GitHub Actions Inactive
@mitchdz mitchdz temporarily deployed to ghcr-deployment June 15, 2026 16:59 — with GitHub Actions Inactive
@mitchdz

mitchdz commented Jun 15, 2026

Copy link
Copy Markdown
Collaborator

Thanks for this @TheGupta2012, I triggered a deployments from your branch so we can properly test the nightly integration suite. Once done I can run the tests

@github-actions

Copy link
Copy Markdown

CI Summary (push) — ✅ passed

Run #27561255271 · ✅ 6 · ⏩ 7 · ❌ 0 · ⛔ 0

Top-level jobs (13)
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 ❔ queued 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

@TheGupta2012

Copy link
Copy Markdown
Contributor Author

Thanks a lot @mitchdz for triggering a build for integration tests! While the CI seems to have succeeded, I think the integration test image build failed due to a 404 error. I don't think that this is related to my changes, could you give more clarity as to what could be the possible next steps for fixing this?

@mitchdz

mitchdz commented Jun 16, 2026

Copy link
Copy Markdown
Collaborator

That's unfortunately a transient error. Quite a few of our jobs yesterday were stuck due to that.

@mitchdz

mitchdz commented Jun 16, 2026

Copy link
Copy Markdown
Collaborator

I re-ran a new job to get an image generated again.

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