Skip to content

feat(qec): surface-code noise model upscaling for training (6e-3 target)#2

Merged
ivanbasov merged 2 commits into
NVIDIA:mainfrom
ivanbasov:feature/surface-code-noise-upscale-6e3
Mar 9, 2026
Merged

feat(qec): surface-code noise model upscaling for training (6e-3 target)#2
ivanbasov merged 2 commits into
NVIDIA:mainfrom
ivanbasov:feature/surface-code-noise-upscale-6e3

Conversation

@ivanbasov
Copy link
Copy Markdown
Member

@ivanbasov ivanbasov commented Mar 4, 2026

Summary

  • Replace the old 1e-3 "sparsity guard" in train.py with a proper noise-model upscaling module (get_training_upscaled_noise_model in noise_model.py) that scales all 25 noise-model parameters so max(grouped totals) = 6e-3 (just below surface-code threshold ~7.5e-3) for training data only. Evaluation uses the user-specified noise model as-is.
  • Add skip mechanism: skip_noise_upscaling: true in config or PREDECODER_SKIP_NOISE_UPSCALING=1 env var to bypass upscaling (useful for benchmarking/controlled experiments).
  • Add 10 unit tests covering upscale, downscale, skip, non-surface-code, zero-totals, and reference-preservation scenarios. All pass.
  • Update README with detailed documentation of the upscaling rules, grouped totals table, and how to disable upscaling.

Ported from internal GitLab MR !33 (feature/surface-code-noise-upscale-6e3).

Changed files

File Change
README.md Replace sparse "noise floor" paragraph with detailed upscaling docs
code/qec/noise_model.py Add get_grouped_totals, get_training_upscaled_noise_model, constants
code/tests/test_noise_model.py Add TestNoiseModelUpscaling class (10 tests)
code/training/train.py Replace inline sparsity guard with call to new upscaling module

Test plan

  • All 12 noise model tests pass (PYTHONPATH=code python -m unittest discover -s code/tests -p "test_noise_model.py")
  • CI pipeline passes (SPDX, unit tests, coverage, Python compat)
  • GPU smoke test passes

Made with Cursor

@ivanbasov ivanbasov requested a review from bmhowe23 March 4, 2026 19:00
@ivanbasov ivanbasov force-pushed the feature/surface-code-noise-upscale-6e3 branch from 4083926 to 3d72484 Compare March 6, 2026 01:35
@ivanbasov ivanbasov requested a review from jolle-ag March 6, 2026 01:35
Replace the old 1e-3 "sparsity guard" in train.py with a proper
noise-model upscaling module in noise_model.py that:
- Scales all 25 noise-model parameters so max(grouped totals) = 6e-3
  (just below surface-code threshold ~7.5e-3) for training data only.
- Skips upscaling for non-surface-code types.
- Provides skip_noise_upscaling config flag and
  PREDECODER_SKIP_NOISE_UPSCALING=1 env var to bypass upscaling.
- Emits clear warnings when noise is above target or downscale is skipped.

Adds 10 unit tests covering upscale, downscale, skip, non-surface-code,
zero-totals, and reference-preservation scenarios.

Updates README with detailed documentation of the upscaling rules and
how to disable them.

Ported from gitlab MR !33 (feature/surface-code-noise-upscale-6e3).

Made-with: Cursor
@ivanbasov ivanbasov force-pushed the feature/surface-code-noise-upscale-6e3 branch from 3d72484 to 0852a99 Compare March 6, 2026 23:37
@ivanbasov
Copy link
Copy Markdown
Member Author

pinging @bmhowe23 or @jolle-ag for signoff. this code was already approved in GitLab the last week.

@ivanbasov ivanbasov merged commit 1c62bc7 into NVIDIA:main Mar 9, 2026
9 checks passed
ivanbasov added a commit that referenced this pull request Apr 10, 2026
…et) (#2)

* feat(qec): surface-code noise model upscaling for training (6e-3 target)

Replace the old 1e-3 "sparsity guard" in train.py with a proper
noise-model upscaling module in noise_model.py that:
- Scales all 25 noise-model parameters so max(grouped totals) = 6e-3
  (just below surface-code threshold ~7.5e-3) for training data only.
- Skips upscaling for non-surface-code types.
- Provides skip_noise_upscaling config flag and
  PREDECODER_SKIP_NOISE_UPSCALING=1 env var to bypass upscaling.
- Emits clear warnings when noise is above target or downscale is skipped.

Adds 10 unit tests covering upscale, downscale, skip, non-surface-code,
zero-totals, and reference-preservation scenarios.

Updates README with detailed documentation of the upscaling rules and
how to disable them.

Ported from gitlab MR !33 (feature/surface-code-noise-upscale-6e3).

Made-with: Cursor

* Apply yapf style to rebased branch

Made-with: Cursor
ivanbasov added a commit that referenced this pull request Apr 10, 2026
…et) (#2)

* feat(qec): surface-code noise model upscaling for training (6e-3 target)

Replace the old 1e-3 "sparsity guard" in train.py with a proper
noise-model upscaling module in noise_model.py that:
- Scales all 25 noise-model parameters so max(grouped totals) = 6e-3
  (just below surface-code threshold ~7.5e-3) for training data only.
- Skips upscaling for non-surface-code types.
- Provides skip_noise_upscaling config flag and
  PREDECODER_SKIP_NOISE_UPSCALING=1 env var to bypass upscaling.
- Emits clear warnings when noise is above target or downscale is skipped.

Adds 10 unit tests covering upscale, downscale, skip, non-surface-code,
zero-totals, and reference-preservation scenarios.

Updates README with detailed documentation of the upscaling rules and
how to disable them.

Ported from gitlab MR !33 (feature/surface-code-noise-upscale-6e3).

Made-with: Cursor

* Apply yapf style to rebased branch

Made-with: Cursor
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