Skip to content

Use optimized HDF5 reader for resample_slc_v2 - #372

Merged
Tyler-g-hudson merged 1 commit into
isce-framework:developfrom
lijun99:resample-slc-v2-hdf5-reader
Sep 1, 2026
Merged

Tyler-g-hudson merged 1 commit into
isce-framework:developfrom
lijun99:resample-slc-v2-hdf5-reader

Conversation

@lijun99

@lijun99 lijun99 commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

resample_secondary_rslc_onto_reference() read the secondary RSLC via RSLC.getSlcDatasetAsNativeComplex(), which opens the file with h5py's default chunk cache instead of one sized for the dataset's own chunking. Open the secondary RSLC directly via HDF5OptimizedReader instead, matching the pattern already used in unwrap.py, crossmul.py, and other workflows. This cuts the resample step's SLC I/O read time by ~5-10x. Output is verified bit-for-bit identical to the original.

Moved from #358.

resample_secondary_rslc_onto_reference() read the secondary RSLC via
RSLC.getSlcDatasetAsNativeComplex(), which opens the file with h5py's
default chunk cache instead of one sized for the dataset's own chunking.
Open the secondary RSLC directly via HDF5OptimizedReader instead, matching
the pattern already used in unwrap.py, crossmul.py, and other workflows.

This cuts the resample step's SLC I/O read time by roughly 5x.
Comment on lines +223 to +224
if is_complex32(dataset):
dataset = ComplexFloat16Decoder(dataset)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's been a long time since we moved on from float 16 for RSLC. We have not produced any NISAR real data RSLC with float 16. I think we don't need this check. Do you agree @bhawkins ?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is any of our test data float16?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would recommend keeping the check for now, 1) the original call getSlcDatasetAsNativeCompl offers the same check and conversion, 2) it seems that there are some other places which do the same, such as calls to is_dataset_complex32, read_c4_dataset_as_c8. If we decide to drop complex32, it's better to handle them altogether.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fine with me. let's keep it.

@Tyler-g-hudson Tyler-g-hudson left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM pending the resolution of Heresh's concern regarding float16.

@hfattahi hfattahi added this to the R05.03.0 milestone Sep 1, 2026

@hfattahi hfattahi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thank you @lijun99 for the contribution.

@Tyler-g-hudson
Tyler-g-hudson merged commit f42cea7 into isce-framework:develop Sep 1, 2026
8 checks passed
@Tyler-g-hudson

Copy link
Copy Markdown
Contributor

Thanks @lijun99 for the contribution!

sharath-velishala added a commit to A-Science-Company/isce3 that referenced this pull request Sep 3, 2026
Brings in 5 upstream commits from isce-framework/isce3. None touch asc/, so
no conflict with our work.

  f42cea7  Use optimized HDF5 reader for resample_slc_v2 (isce-framework#372)
  23f9932  Solve CI failures (isce-framework#366)
  fc8112c  Update Soil Moisture SAS to v0.4.3 (isce-framework#349)
  0d1600d  Update STATIC workflow for new water mask spec (isce-framework#334)
  be7b3d9  Fix failing unit test test.cxx.isce3.io.raster.raster (isce-framework#348)

Note these change the FORK's source only. We run isce3 0.25.12 from
conda-forge and never build this tree, so none of them affect our runtime --
including isce-framework#372, which touches the resample_slc_v2 that Track R will use.
That optimisation lands for us only when conda-forge ships a release
containing it.
sharath-velishala added a commit to A-Science-Company/isce3 that referenced this pull request Sep 3, 2026
…fy.sh

tools/apply_patches.py overlays pure-Python upstream fixes onto the released
conda-forge package, so we get them without a source build. Building isce3
from source would cost hours, a full compiler toolchain, ~250 GB of scratch,
and leave us running an unreleased 0.26.0-dev we then own.

First patch: isce-framework#372 (f42cea7), a single Python file.
resample_secondary_rslc_onto_reference() opened the secondary RSLC via
getSlcDatasetAsNativeComplex(), which uses h5py's DEFAULT chunk cache rather
than one sized to the dataset's own chunking. Resampling reads the secondary
repeatedly, so an undersized cache re-reads the same chunks from disk. It
matters directly for Track R.

Three conditions are checked before anything is overlaid:
  - Python only, no compiled extension involved
  - every symbol the patched file imports already exists in the installed
    isce3 (verified: isce3.io.HDF5OptimizedReader and the isce3.core.types
    helpers are all present in 0.25.12)
  - the installed file is byte-identical to the pre-patch upstream version,
    so we know exactly what is being replaced
The original is kept as <name>.orig and restored by --revert.

verify.sh now reports patch status with --check; it never modifies the
environment itself.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.

3 participants