Sparse-aware PCM utility migration#602
Draft
vedika-saravanan wants to merge 5 commits into
Draft
Conversation
Signed-off-by: vedika-saravanan <vsaravanan@nvidia.com>
a2e17d3 to
d37081d
Compare
Signed-off-by: vedika-saravanan <vsaravanan@nvidia.com>
d37081d to
7fdfbb8
Compare
Signed-off-by: vedika-saravanan <vsaravanan@nvidia.com>
ad4c59d to
785a2c1
Compare
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 sparse-aware paths for the round-agnostic PCM utilities:
reorder_pcm_columnsshuffle_pcm_columnspcm_to_sparse_vecpcm_to_sparse_stringThe C++ API now has
sparse_binary_matrixoverloads for those utilities. The Python bindings also accept scipy sparse inputs for the Python-exposed functions (reorder_pcm_columns,shuffle_pcm_columns, andpcm_to_sparse_vec) without materializing a densecudaqx::tensor.This intentionally avoids utilities that depend on a fixed scalar
num_syndromes_per_round, since those APIs are expected to change for variable syndrome counts per round.Related: #582
Runtime / performance impact
Avoids dense
cudaqx::tensor<uint8_t>allocation for the covered sparse utility paths when callers providesparse_binary_matrixin C++ or scipy sparse matrices in Python.Self-review checklist
Please confirm each item before requesting review. Check
[x]or strikethrough and explain.
Before requesting review
Local C++ tests not run:
cmakeis unavailable in this shell.Pending CI.
Pending CI.
Scope and size
(if so, an issue has been raised).
Tests
just when it is missing.
N/A: the new sparse utility paths are covered by positive/equivalence tests; no new expected exception paths are introduced for those sparse paths.
EXPECT_*/assertchecks areinsufficient for algorithmic correctness.
N/A: dense-vs-sparse equivalence and explicit expected sparse encodings are covered with direct checks.
Documentation
tracked.
Code style
snake_casevscamelCase) forthe area being modified.
Dependencies
OSRB tickets filed.