Skip to content

Use the standalone pycuampcor package for dense offsets and offsets product - #413

Open
lijun99 wants to merge 13 commits into
isce-framework:developfrom
lijun99:pycuampcor-external
Open

lijun99 wants to merge 13 commits into
isce-framework:developfrom
lijun99:pycuampcor-external

Conversation

@lijun99

@lijun99 lijun99 commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

This PR replaces isce3's internal copies of pycuampcor with the standalone pycuampcor package (https://github.com/earthdef/cuAmpcor, release 2.2.0): one code base with a CUDA backend (PyCuAmpcor) and a multi-threaded (OpenMP) CPU backend (PyCPUAmpcor). #410 fixes the internal copies, so that the switch can be checked bit for bit.

Changes

  • Internal pycuampcor removed: the sources and bindings under cxx/isce3/{,cuda/}matchtemplate/pycuampcor are removed. For compatibility, isce3.matchtemplate and isce3.cuda.matchtemplate re-export PyCPUAmpcor and PyCuAmpcor from the package.
  • dense_offsets and offsets_product use pycuampcor, and offsets_product can now also run on the CPU.
  • offsets_product processes its layers together (runAmpcorLayers): each image chunk is loaded once for all layers. With an older pycuampcor, the layers run one at a time as before.
  • The reference RSLC is read directly from HDF5 (HDF5:<file>:<dataset>), so the ENVI copy is no longer made. It is still made for complex32 data or an older pycuampcor without HDF5 support.
  • Automatic batch size: windows_batch_range/windows_batch_azimuth may be empty or 0 (now the default), meaning (SM/4) x 8 windows on the GPU (e.g., 20 x 8 on a V100, 27 x 8 on an A100) and 1 x 1 on the CPU.
  • New option cross_correlation_workflow (two_pass, the default, or one_pass) for dense_offsets and offsets_product.
  • Tests and environment: the ampcor tests use pycuampcor; environment.yml requires pycuampcor>=2.2.

Results

Dependency and CI

  • Temporary channel: pycuampcor is submitted to conda-forge (conda-forge/staged-recipes#34997) but not yet available there. Until then, environment.yml adds the anaconda.org channel lijun99. It holds the same recipe, built for the conda-forge variants by a GitHub Actions workflow in earthdef/cuAmpcor: cpu, and CUDA 12.9, 13.0 and 13.4, for linux-64/aarch64 and osx-64/arm64, Python 3.11-3.14. The channel can be removed once the package is on conda-forge.
  • Environments solve for every CI job: with this channel, the environment solves for each job: Linux latest, minimum Python, minimum C++ standard, macOS, and the GPU job with the CUDA toolkit from the nvidia channel. The GPU job gets a CUDA build of pycuampcor.
  • Build dependencies: pycuampcor needs HDF5 and zlib at build time, which isce3's environment already has.

Testing

The CI jobs were reproduced in fresh environments created from this branch's environment.yml, so pycuampcor was installed from the lijun99 channel. Each build was installed and the CI tests run serially, as in the workflows (ctest -E ".*(stage_dem|pybind\.unwrap\.phass)").

  • GPU job (RTX PRO 6000; the CUDA toolkit installed with conda install -c nvidia cuda, CUDA 13.3; WITH_CUDA, RelWithDebInfo): the environment gets the CUDA build of pycuampcor (cuda130).
  • CPU job (no GPU driver; CPU-only build, Debug): the environment gets the cpu build of pycuampcor.

With #411, all tests pass in both jobs.

This branch has not been deployed

No deployments
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.

1 participant