Repository navigation
Bound xImage preprocessing transfers to the reconstruction region - #130
Conversation
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
ROI selection and bounded transfer src/cuphoton/ximage/backends/torch_gpu_preprocess.py, tests/ximage/test_torch_gpu_preprocess.py |
The preprocessing function validates PSFs and ROI bounds, slices spatial arrays before transfer, and uses coordinates relative to the transferred source for cutout selection and initialization. Metadata uses original bundle shapes. Tests cover expected outputs, transfer sizes, invalid bounds, lazy HDF5 inputs, and full-image expected values. |
GPU test execution and report validation .github/workflows/ci.yml |
The GPU workflow installs the xImage extra, runs xImage GPU tests, validates the JUnit report, and uploads it as an artifact. |
Possibly related PRs
- NVIDIA/cuPhoton#127: Adds the xImage reconstruction workflow and Torch preprocessing path modified here.
- NVIDIA/cuPhoton#125: Defines the
XImageBundle, lazy-array, artifact, and ROI contracts used by this preprocessing path.
Priority:
Unblocks: 1 PR
Merge Risk: 
Minimal · up to 096c9
-
No identified issue currently blocks merging the bounded-transfer change, subject to normal checks.
Pre-merge checks: 
2
Comment @coderabbitai help to get the list of available commands.
|
@coderabbitai full review |
✅ Action performed
|
|
Production measurements for a 256×256 region from 2048×2048 synthetic inputs:
Both versions use the same GPU solver. The paired baseline restores the preprocessor from Backend timing includes host/device transfers and excludes file I/O. File-backed timing covers configuration/input loading through buffered output writes, using the same input files and a warmed page cache, without fsync. It excludes PSF calibration, WCS alignment, detection, photometry, and metric evaluation. These are within-system comparisons; host and storage differences prevent a GPU-only ranking. Checked images and iteration/loss traces were bitwise identical in each of the three backend cases on every system and all paired file-backed runs. For the 2048→256 case, peak Torch-allocated device memory fell from 1,632 to 43 MiB on all three systems; this excludes allocator reservations and CUDA context memory. The 512×512 full-frame control was effectively unchanged: 13.32 → 13.49 ms, 49.89 → 49.96 ms, 50.64 → 50.57 ms (table order). Smaller regions are the intended benefit. The workstation used Subsequent CI-download and benchmark cache-release changes leave the measured preprocessing, reconstruction, and standalone metric implementations unchanged. |
|
@coderabbitai full review The updated head reuses the three-line, checksum-verified CFITSIO download fix from #129 to unblock native-wheel CI. The xImage implementation and measured performance source are unchanged. |
✅ Action performed
|
bb20a52 to
47b3a32
Compare
6286e07 to
d49f913
Compare
47b3a32 to
d3268d6
Compare
6a4768e to
bce3047
Compare
eaeb8ab to
aa3cefc
Compare
bce3047 to
104a3a4
Compare
melo-gonzo
left a comment
There was a problem hiding this comment.
The ROI slicing keeps the VALID-padding border and the original bundle coordinates, and the region tests in test_torch_gpu_preprocess.py pass on CPU. The CUDA timings in the PR comment were not reproduced. This PR moves the line where f is built, so the PSF fix requested in #127 will need a rebase here.
104a3a4 to
f10e34b
Compare
27c1b54 to
922b25b
Compare
melo-gonzo
left a comment
There was a problem hiding this comment.
The restack keeps the PSF fix, and the region tests in test_torch_gpu_preprocess.py pass on CPU.
922b25b to
9d28cc3
Compare
Slice image, variance and mask inputs before tensor conversion, retaining the source border required by VALID padding. Preserve bundle coordinates and raw-shape metadata while bounding preprocessing memory. Run xImage CUDA parity tests in the existing GPU CI job. Signed-off-by: Trent Nelson <trentn@nvidia.com>
f10e34b to
096c9dd
Compare
A small reconstruction region previously uploaded and preprocessed every input pixel. Slice images, variances and good-pixel masks before tensor conversion, retaining the source border required by VALID padding and preserving original bundle coordinates and shape metadata.
This bounds transfer and preprocessing memory to the requested region. GPU CI runs the xImage parity suite and rejects skipped cases. Coverage includes lazy mask slicing, optional masks/scales, asymmetric PSFs, odd/even regions, VALID boundaries, super-resolution and supplied PSFs.
Earlier production measurements cover backend and file-based reconstruction on three systems; those timings were not rerun for this integration.