Skip to content

Compare persistent pipeline and separate stage execution - #55

Merged
tpn merged 3 commits into
mainfrom
codex/pipeline-stage-benchmark
Sep 25, 2026
Merged

tpn merged 3 commits into
mainfrom
codex/pipeline-stage-benchmark

Conversation

@tpn

@tpn tpn commented Sep 24, 2026 •

Copy link
Copy Markdown
Collaborator

Running xPOIS, xFit and XScan as separate processes incurs startup, transfer and intermediate-file costs that the persistent device pipeline can amortize. cuphoton xscan benchmark-pipeline compares those workflows using identical numerical APIs, inputs, candidate batches and checkpoint. The staged baseline uses real process/file boundaries; it does not reproduce the stock component CLI chain, which changes some arithmetic paths.

Both routes retain attempted-round evidence and compare all 22 compact scientific arrays, candidate identities and predictions before reporting success. The staged route writes only arrays consumed downstream or required for parity. Raw timings retain all verification; the headline ratio subtracts measured intermediate hashing and repeated xFit/XScan input rechecks. The original-input hashes common to both routes remain included. This subtraction cannot undo verification's cache effects. Report provenance identifies the selected GPU, driver, CUDA runtime and CuPy distribution.

Validation: 54 CPU benchmark and CLI-contract tests passed after local executor integration, including fixture generation and both comparison orders through stage summaries and parity audits. Repository lint and all pre-commit checks passed. GPU qualification was performed on 5cf9945f, before executor integration. On one RTX PRO 6000 Blackwell (driver 610.57.04, CUDA runtime 13.2, CuPy 14.1.1), four 1024×1024 pairs with nine candidates each and 17×17 stamps passed exact parity in both launch orders using the same fixture. Each order retained one warmup and three measured rounds: 32 item-round checks and 704 array comparisons total. Warm pipeline medians were 0.884/0.901 seconds; raw fresh-stage medians were 8.211/8.407 seconds; fresh-stage medians with additional hashing excluded were 8.100/8.293 seconds. Setup and whole-invocation timings remain separately available in the reports. These measurements use the updated benchmark; earlier results with additional outputs are superseded. Integration preserves the benchmark code and the numerical functions it calls. It also inherits changes elsewhere in training.py, so the retained GPU source manifest does not describe the complete integrated revision; the GPU benchmark was not rerun after integration.

These are synthetic workflow timings with an untrained fusion model, not classifier accuracy, isolated kernel speedup or multi-GPU performance claims. This PR is rebased on the merged executor stack and uses the existing command/invariant framework.

@tpn tpn added the ai-review Request a focused CodeRabbit review label Sep 24, 2026
@coderabbitai

coderabbitai Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: NVIDIA/cuPhoton/.coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 9007d3d5-c77c-496c-b05d-f95e5d1865a7

📥 Commits

Reviewing files that changed from the base of the PR and between 5cf9945 and c808753.

📒 Files selected for processing (3)
  • docs/components/xscan.md
  • src/cuphoton/xscan/commands.py
  • tests/core/test_cli_contract.py
🚧 Files skipped from review as they are similar to previous changes (1)
  • docs/components/xscan.md

Included review availability: Your plan provides up to 12 included reviews per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The pull request adds an XScan benchmark that compares a persistent device pipeline with separately launched, file-mediated stages. It adds synthetic fixture generation, output parity checks, timing and provenance reports, a command-line interface, documentation, and tests.

Changes

Pipeline Stage Benchmark

Layer / File(s) Summary
Synthetic benchmark inputs
src/cuphoton/xscan/pipeline_benchmark/fixture.py, tests/xscan/test_pipeline_benchmark.py
Fixture generation validates settings and writes deterministic images, model and feature artifacts, configuration, and item manifests. Tests check fixture repeatability.
Stage execution and artifacts
src/cuphoton/xscan/pipeline_benchmark/stages.py, tests/xscan/test_pipeline_benchmark_stages.py
The xPOIS, xFit, and XScan stages validate inputs and linked artifacts, write hashed outputs and summaries, and load checked scientific arrays. Tests cover artifact contracts, stage setup, and timing.
Measurement, parity audit, and reporting
src/cuphoton/xscan/pipeline_benchmark/runner.py, tests/xscan/test_pipeline_benchmark.py, docs/components/pipeline-stage-benchmark.md
The runner measures both treatments, audits output identity and scientific-array parity, and writes timing and provenance reports. Tests cover execution order, failures, audit mismatches, and provenance.
Command interface and usage guidance
src/cuphoton/xscan/commands.py, tests/xscan/test_pipeline_benchmark_cli.py, tests/core/test_cli_contract.py, docs/components/xscan.md
The XScan command exposes benchmark settings and validates timeout, stage, launch order, and paired input paths. Documentation describes how to run and interpret the benchmark.

Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to c8087

No actionable issue is established in the supplied changes; the benchmark command is mergeable after normal checks.

🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Comment @coderabbitai help to get the list of available commands.

@tpn
tpn marked this pull request as ready for review September 24, 2026 04:52
@tpn
tpn requested a review from melo-gonzo as a code owner September 24, 2026 04:52

@melo-gonzo melo-gonzo 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.

Approving with three should-fix items on fairness; the design itself is sound and clearly labeled. Both arms run in real child processes, so the staged arm pays interpreter start, imports, CuPy and torch initialization, and model load per stage as a CLI chain would, while the pipeline arm initializes one DeviceWorkerContext and loops. Inputs, options, checkpoint hash, dtype, and variance policy are identical, warmup rounds are reported separately, device clocks are synchronized before stopping, and every round is checked for exact equality of 22 arrays plus candidate identity, diagnostics, feature names, and predictions before any timing is compared. This is the right shape for the question the Rubin perf audit raised, where GPU work was 15 to 25 s of a 377 s chain. Three things make the headline ratio overstate the staged penalty or limit how citeable the report is; inline notes at each. CPU tests cover comparison, child failure and timeout, round bookkeeping, tamper rejection, and CLI parsing; run_stage, audit, prepare_fixture, and an end-to-end compare are CPU-runnable and untested, and should be added. All four ci-required entries are green.

Comment thread src/cuphoton/xscan/pipeline_benchmark/stages.py
Comment thread src/cuphoton/xscan/pipeline_benchmark/stages.py Outdated
Comment thread src/cuphoton/xscan/pipeline_benchmark/runner.py Outdated
@tpn

tpn commented Sep 25, 2026

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

tpn added 3 commits September 24, 2026 18:30
Add a reproducible matched-API benchmark with explicit startup and warm
batch timing, file-mediated stage boundaries, and scientific parity
checks for every image and round.

Signed-off-by: Trent Nelson <trentn@nvidia.com>
Signed-off-by: Trent Nelson <trentn@nvidia.com>
Signed-off-by: Trent Nelson <trentn@nvidia.com>
@tpn

tpn commented Sep 25, 2026

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@tpn
tpn force-pushed the codex/pipeline-stage-benchmark branch from 5cf9945 to c808753 Compare September 25, 2026 01:30
@coderabbitai

coderabbitai Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@tpn

tpn commented Sep 25, 2026

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@tpn
tpn merged commit 52adfb4 into main Sep 25, 2026
12 checks passed
@tpn
tpn deleted the codex/pipeline-stage-benchmark branch September 25, 2026 05:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-review Request a focused CodeRabbit review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants