Add a TRT+PyMatching decoder profile to the HSB FPGA decoding-server test#673
Open
cketcham2333 wants to merge 1 commit into
Open
Add a TRT+PyMatching decoder profile to the HSB FPGA decoding-server test#673cketcham2333 wants to merge 1 commit into
cketcham2333 wants to merge 1 commit into
Conversation
…-server test
Add a trt_decoder profile to hsb_fpga_decoding_server_test.sh: the TensorRT
predecoder + PyMatching global decoder combo running as one decoding_server
session, with the FPGA (or emulator) feeding syndromes through the unchanged
hololink_fpga_syndrome_playback tool. The profile rides the existing
pymatching plumbing end to end -- trt_decoder has no graph-dispatch support,
so it uses the same cpu_roce HOST_CALL transport, the same Bridge Ready
handshake, and the same decoder-agnostic wire format. The combo itself
comes from the generator: surface_code-4-yaml --decoder_type trt_decoder
--onnx_path X writes the config entry with global_decoder: pymatching and
its parameters automatically.
Script changes:
- --decoder trt_decoder profile + new --onnx PATH flag (default AUTO).
AUTO generates the tiny identity predecoder ONNX at run time (mirrors
app_examples/surface_code-4-yaml-test.sh): output row = [pre_L=0, input
syndrome untouched], so TRT preserves the syndrome, PyMatching performs
the actual correction, and expected corrections stay computable at
generation time with no trained model -- while still exercising ONNX
parse, TRT engine build, and per-shot inference. Requires the python3
'onnx' module (checked with a clear error).
- Config generation passes --onnx_path for the profile, and the generated
YAML is pinned to the combo (must contain a trt_decoder entry with
onnx_load_path). The syndromes run (--yaml) constructs the decoder
in-process and decodes, so the TRT plugin .so is required before
generation -- checked explicitly, because the decoder-plugin loader
silently skips missing/broken .so's.
- Build phase: -DCUDAQ_QEC_BUILD_TRT_DECODER flips from the hardwired OFF
to ON for the trt profile (ON hard-fails at configure when the TensorRT
dev packages are absent -- loud beats two layered silent skips) and OFF
otherwise, preserving existing behavior for other profiles; the
cudaq-qec-trt-decoder target is added to the profile's build set.
- New configuration-identity check for ALL profiles: after Bridge Ready,
the server log must name the constructed session ("decoder 0 type:
<decoder>"). This matters most for trt_decoder, where the identity ONNX
makes a silently-substituted plain-pymatching session pass the FPGA
corrections verification bit-identically; the check pins the session
identity, after which the plugin's no-fallback semantics mean matching
corrections in the FPGA capture RAM prove TRT inference ran per shot.
The pass criterion is unchanged: hololink_fpga_syndrome_playback --verify
(ILA-verified header + correction matching). No C++ changes anywhere; the
trt_decoder plugin, playback, server, and wire format are untouched.
Environment prerequisites (dev rig): TensorRT dev packages matching the
installed runtime (libnvinfer-dev, libnvinfer-plugin-dev,
libnvonnxparsers-dev = 10.15.1.29-1+cuda13.1) and the python3 onnx module.
Signed-off-by: Chuck Ketcham <cketcham@nvidia.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.
Description
Adds a
trt_decoderprofile tohsb_fpga_decoding_server_test.sh: the TensorRTpredecoder + PyMatching global decoder combo running as a single
decoding_serversession,with the FPGA feeding syndromes through the unchanged
hololink_fpga_syndrome_playbacktool.The profile rides the existing pymatching plumbing end to end —
trt_decoderhas nograph-dispatch support, so it uses the same cpu_roce HOST_CALL transport, the same
Bridge Readyhandshake, and the same decoder-agnostic wire format. The combo itself comesfrom the generator:
surface_code-4-yaml --decoder_type trt_decoder --onnx_path Xwrites theconfig entry with
global_decoder: pymatchingand its parameters automatically.Changes (one file:
libs/qec/unittests/utils/hsb_fpga_decoding_server_test.sh)--decoder trt_decoderprofile +--onnx PATHflag (defaultAUTO).AUTOgeneratesthe tiny identity predecoder ONNX at run time (mirrors the
app_examples/surface_code-4-yaml-test.shsnippet): output row =[pre_L=0, syndrome untouched], so TRT preserves the syndrome, PyMatching performs the actual correction, andexpected corrections stay computable at generation time with no trained model — while still
exercising ONNX parse, TRT engine build, and per-shot inference. Requires the python3
onnxmodule (checked with a clear error).--onnx_pathfor the profile and pins the generated YAML tothe combo (must contain a
trt_decoderentry withonnx_load_path). The syndromes run(
--yaml) constructs the decoder in-process and decodes, so the TRT plugin.soischecked explicitly before generation — the decoder-plugin loader silently skips
missing/broken
.sos.-DCUDAQ_QEC_BUILD_TRT_DECODERflips from the hardwiredOFFtoONforthe trt profile (hard configure failure when the TensorRT dev packages are absent — loud
beats two layered silent skips) and stays
OFFotherwise;cudaq-qec-trt-decoderjoinsthe profile's build targets.
Bridge Ready, the server log mustname the constructed session (
decoder 0 type: <decoder>). This matters most fortrt_decoder, where the identity ONNX makes a silently-substituted plain-pymatchingsession pass the FPGA corrections verification bit-identically; with the session identity
pinned, the plugin's no-fallback semantics mean matching corrections in the FPGA capture
RAM prove TRT inference ran on every shot.
Pass criterion unchanged:
hololink_fpga_syndrome_playback --verify(ILA-verified header +correction matching). No C++ changes — plugin, server, playback, and wire format
untouched.