Skip to content

Route every decoder device pin through one resolver and two wrappers - #698

Merged
melody-ren merged 4 commits into
NVIDIA:mainfrom
melody-ren:melodyr/single-source-of-truth-for-hw-pin
Jul 17, 2026
Merged

Route every decoder device pin through one resolver and two wrappers#698
melody-ren merged 4 commits into
NVIDIA:mainfrom
melody-ren:melodyr/single-source-of-truth-for-hw-pin

Conversation

@melody-ren

Copy link
Copy Markdown
Collaborator

Background

Each fix added a device pin to one more path via its own ad-hoc helper. The "which device" decision ended up duplicated across dispatch, capture, the worker, construction, and the gpu_roce transport. And that is the motivation for this PR.

What this PR does

Basically, every path should be following a single source of truth.

Consolidate all of it to: the decoder's cuda_device_id, resolved one way (decode_device_for) and applied through two sanctioned wrappers — pin_decode_device (dispatch/decode) and capture_graph_pinned (graph capture) — in hardware_guards.h. Every path now derives its device from that one field; none selects a device by any other means. Unpinned (< 0) keeps existing semantics: dispatch no-ops, capture defaults to device 0.

…d wrappers

Signed-off-by: Melody Ren <melodyr@nvidia.com>
…ce-of-truth-for-hw-pin

Signed-off-by: Melody Ren <melodyr@nvidia.com>

# Conflicts:
#	libs/qec/lib/realtime/decoding-server-cqr/DecodingSession.cpp
@melody-ren
melody-ren marked this pull request as ready for review July 17, 2026 21:20

@bmhowe23 bmhowe23 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@melody-ren
melody-ren merged commit efd7f69 into NVIDIA:main Jul 17, 2026
21 checks passed
@melody-ren
melody-ren deleted the melodyr/single-source-of-truth-for-hw-pin branch July 17, 2026 21:47
melody-ren added a commit to melody-ren/cudaqx that referenced this pull request Aug 5, 2026
Conflict resolutions, all in favor of upstream's post-NVIDIA#682/NVIDIA#750 realtime
structure with the inproc_rpc path kept out:

- qec_realtime_session.cpp: deleted (upstream's touch was to removed code).
- GpuRoceTransceiver.cpp: deleted; NVIDIA#754 renamed it to
  DeviceGraphTransceiver.cpp. The stale qec_realtime_session comment
  reference the branch scrubbed moved to DeviceGraphRingConsumer.cpp and is
  scrubbed there instead.
- realtime_decoding.cpp: reset_decoder takes NVIDIA#698's pin_decode_device(),
  dropping the rpc_producer dispatch branch.
- decoding_server.cpp: upstream's per-ring rewrite; its comments no longer
  reference qec_realtime_session, so the branch's scrub is subsumed.
- app_examples/CMakeLists.txt: upstream's add_surface_code_4_yaml_test
  signature (onnx_path folded into ARGN) with an empty test environment.
- surface_code-4-yaml-test.sh: keep the num_logical echo, drop the
  CUDAQ_QEC_REALTIME_MODE echo.
- realtime_relay_bp.rst: single Building subsection renamed Hololink -> HSB,
  target list on the NVIDIA#754 names, CI-unit-test section dropped (the test is
  removed) and the Surface Code Test section kept.

Upstream added no new inproc_rpc surface: DeviceGraphTransceiver,
DeviceGraphRingConsumer, surface_code-5-per-decoder-rings and
realtime_decoding_demo are all inproc-free.

Signed-off-by: Melody Ren <melodyr@nvidia.com>
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