weiji14
cog3pio
BlogDocsChangelog

:sparkles: Python bindings for CudaCogReader

#58
Comparing
dlpack_to_cupy
(
c4ea0ef
) with
main
(
f8f4f64
)
CodSpeed Performance Gauge
0%
Untouched
5

Benchmarks

Passed

test_read_geotiff_multi_band
python/tests/test_io_geotiff.py
CodSpeed Performance Gauge
+1%
24.2 ms24.1 ms
test_xarray_backend_open_dataarray[cog3pio]
python/tests/test_xarray_backend.py
CodSpeed Performance Gauge
0%
45.8 ms45.7 ms
test_xarray_backend_open_dataarray[rasterio]
python/tests/test_xarray_backend.py
CodSpeed Performance Gauge
0%
15 ms15 ms
test_read_geotiff_remote
python/tests/test_io_geotiff.py
CodSpeed Performance Gauge
0%
8.5 ms8.5 ms
test_read_geotiff_local
python/tests/test_io_geotiff.py
CodSpeed Performance Gauge
-1%
232.6 µs234.8 µs

Commits

Click on a commit to change the comparison range
Base
main
f8f4f64
-0.03%
:bug: Better handle CudaCogReader import logic CudaCogReader might not be available on some platforms, so hide it behind some gates.
517f942
9 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
8 days ago
by weiji14
-0.24%
:twisted_rightwards_arrows: Merge branch 'main' into dlpack_to_cupy
79b6555
7 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
7 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
7 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
7 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
7 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
7 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
3 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
2 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
2 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
2 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
1 day 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
20 hours ago
by weiji14
© 2025 CodSpeed Technology
Home Terms Privacy Docs