weiji14
cog3pio
BlogDocsChangelog

:sparkles: Python bindings for CudaCogReader

#58
Comparing
dlpack_to_cupy
(
186fed2
) with
main
(
f0ac195
)
CodSpeed Performance Gauge
0%
Untouched
7

Benchmarks

Passed

test_xarray_backend_open_dataarray[rasterio]
python/tests/test_xarray_backend.py
CodSpeed Performance Gauge
0%
15 ms15 ms
test_read_geotiff_local
python/tests/test_io_geotiff.py
CodSpeed Performance Gauge
0%
234.1 µs233.8 µs
1_gdal_CPU[Sentinel-2 TCI]
benches/read_cog.rs::benches::criterion_benchmark::read_cog
CodSpeed Performance Gauge
0%
6.3 s6.3 s
2_image-tiff_CPU[Sentinel-2 TCI]
benches/read_cog.rs::benches::criterion_benchmark::read_cog
CodSpeed Performance Gauge
0%
5.6 s5.6 s
test_read_geotiff_multi_band
python/tests/test_io_geotiff.py
CodSpeed Performance Gauge
0%
24.2 ms24.2 ms
test_read_geotiff_remote
python/tests/test_io_geotiff.py
CodSpeed Performance Gauge
0%
8.5 ms8.5 ms
test_xarray_backend_open_dataarray[cog3pio]
python/tests/test_xarray_backend.py
CodSpeed Performance Gauge
0%
45.7 ms45.8 ms

Commits

Click on a commit to change the comparison range
Base
main
f0ac195
-0.03%
:bug: Better handle CudaCogReader import logic CudaCogReader might not be available on some platforms, so hide it behind some gates.
517f942
30 days ago
by weiji14
+0.08%
:alembic: Debug cupy's cuda stream handling For some reason, calling CudaCogReader twice makes things work, i.e. the returned cupy.ndarray has the correct numbers. Thinking it might be some CUDA stream issue (https://docs.cupy.dev/en/v13.6.0/user_guide/basic.html#current-stream), but cupy should already be using the default null stream by default. Putting some print() and dbg!() statements here and there. Bumped cupy-cuda12x to cupy-cuda13x.
7b55bd5
29 days ago
by weiji14
-0.24%
:twisted_rightwards_arrows: Merge branch 'main' into dlpack_to_cupy
79b6555
28 days ago
by weiji14
-0.06%
:construction_worker: Install nvTIFF on Linux CI for python wheel builds Install nvTIFF binaries from nvidia repos following instructions on https://developer.nvidia.com/nvtiff-0-5-0-download-archive?target_os=Linux&target_arch=x86_64&Distribution=Ubuntu&target_version=24.04&target_type=deb_network. Could have tried to get it from PyPI following https://docs.nvidia.com/cuda/nvtiff/installation.html#pypi, but then would need to figure out the lib paths and stuff.
cb05982
28 days ago
by weiji14
-0.25%
:wrench: Modify cuda repo for aarch64 Xref https://developer.nvidia.com/nvtiff-0-5-0-download-archive?target_os=Linux&target_arch=arm64-sbsa&Compilation=Native&Distribution=Ubuntu&target_version=24.04&target_type=deb_network
bd1c8b0
28 days ago
by weiji14
+0.36%
:green_heart: Install clang-devel to compile nvtiff-sys Fix `Unable to find libclang: "couldn't find any valid shared libraries matching: ['libclang.so', 'libclang-*.so', 'libclang.so.*', 'libclang-*.so.*'], set the `LIBCLANG_PATH` environment variable to a path where one of these files can be found (invalid: [])"`. Need to install this inside the manylinux_2_28 docker container.
a409689
28 days ago
by weiji14
-0.16%
:beers: Install nvTIFF and clang-dev with either dnf or apt Depending on which manylinux_2_28 docker image is pulled for each target arch, the underlying distribution could either be AlmaLinux or Ubuntu based, so need to handle either way of installing nvTIFF and clang-dev.
4e2e0ab
28 days ago
by weiji14
+0.11%
:adhesive_bandage: Install cuda deps and patch nvtiff.h file Fix nvtiff-sys compilation errors by installing missing CUDA runtime dependencies (cuda-crt and cuda-cudart-devel) and patching the nvtiff.h file following https://docs.rs/nvtiff-sys/0.1.2/nvtiff_sys/#instructions
e75d171
28 days ago
by weiji14
-0.16%
:bug: Patch to build wheels with cuda and pyo3 feature flags Default `pyo3` flag set in pyproject.toml is overidden when passing `--features` flag to maturin build, so need to set `cuda,pyo3` instead. Also copy code from e75d17164669c37f43c94dadad213d53520eefb1 to free-threaded build section.
bdaaa9a
24 days ago
by weiji14
-0.05%
:necktie: Only build wheels with cuda flag on linux-x86_64 and aarch64 Too tricky to get nvTIFF working on armv7, s390x and ppc64le due to some linker error like `/usr/armv7-unknown-linux-gnueabihf/lib/gcc/armv7-unknown-linux-gnueabihf/7.5.0/../../../../armv7-unknown-linux-gnueabihf/bin/ld: cannot find -lnvtiff`, so disabling them on those platforms.
1144ae0
23 days ago
by weiji14
+0.04%
:memo: Add CudaCogReader class to API docs Need to include 'cuda' feature flag to maturin on ReadtheDocs, and get libnvtiff-dev from conda-forge. Added a warning to the docstring indicating that CudaCogReader is experimental, and only available on linux-x86_64 and linux-aarch64 builds.
b387902
23 days ago
by weiji14
0%
:beers: Pass include dir to LD_LIBRARY_PATH and BINDGEN_EXTRA_CLANG_ARGS Point to where the header files are located. nvtiff.h is in $CONDA_PREFIX/include. cuda_runtime.h and crt/host_config.h are in $CONDA_PREFIX/targets/x86_64-linux/include.
6cc193b
23 days ago
by weiji14
+0.09%
:rotating_light: Use pyclass(unsendable) instead of deriving Send/Sync Not sure if raw pointer in CudaCogReader is thread-safe enough to do `unsafe impl Send/Sync`, so using unsendable instead for now. Xref https://pyo3.rs/v0.27.1/migration.html#pyclass-structs-must-now-be-send-or-unsendable
6ed6ceb
22 days ago
by weiji14
+0.26%
:sparkles: Support stream and max_version kwargs to __dlpack__ method Check that stream and max_version arguments are valid. Currently only supporting stream=1 or None, and DLPack version 1.x (dlpark is using DLPack 1.1). Have added some docstrings for these parameters. Not implementing copy kwarg yet though.
c4ea0ef
22 days ago
by weiji14
-0.27%
:goal_net: Remove unwrap, use map_err instead Bump nvtiff-sys from 0.1.2 to 0.1.3 to get Error trait on NvtiffStatusError, and then we can cast to string and pass error message to PyValueError.
1564f82
21 days ago
by weiji14
+0.31%
:beers: Symlink nvtiff.h to targets/x86_64-linux/lib and set RUSTFLAGS Brute force symlinking to get nvtiff-sys to compile with conda-forge's libnvtiff that is under $CONDA_PREFIX/include/ instead of $CONDA_PREFIX/targets/x86_64-linux/include/ where most other header files are. One key part is to use RUSTFLAGS instead of LD_LIBRARY_PATH to actually get rustc to search the correct lib/ folder for the .so files.
186fed2
12 days ago
by weiji14
© 2025 CodSpeed Technology
Home Terms Privacy Docs