Conversation
GPUNormalizedVCS (built via VCSCArrayNormalized/VCSRArrayNormalized.to_gpu()) mirrors _vcs_matmul's baseline+Delta decomposition with hand-written CuPy RawKernels instead of Numba, computing in float32. This is opt-in only: plain `@`/`__rmatmul__` on the CPU view are untouched and always use the existing float64 Numba path, so precision/behavior don't change based on whether CUDA happens to be available. Also fixes an import-order issue affecting any CUDA use in this process: zarr registers a pytest plugin and anndata's zarr backend both import cupy speculatively (zarr.core.buffer.gpu), and CuPy's NVRTC header discovery breaks for the rest of the process if cupy's first import happens that way rather than through vsparse. vsparse/__init__.py now imports _vcs_matmul_cuda (which configures CUDA_PATH before importing cupy) first; tests/conftest.py does the same for the test suite, and pyproject.toml disables zarr's pytest plugin autoload. Adds an optional `cuda` extra (cupy-cuda12x) and CUDA-vs-CPU parity tests, skipped when no working CUDA device/toolkit is available. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
resolve_recipe() (and the docstring) already accept a Recipe instance directly, but the signature only declared `view: str`, so passing a custom Recipe (e.g. a stock recipe with center=False for a non-negative consumer) failed type-checking despite working correctly at runtime. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
GPUNormalizedVCS, a device-resident copy of aVCSCArrayNormalized/VCSRArrayNormalizedview, built explicitly via a new.to_gpu()method. Its@/__rmatmul__mirror_vcs_matmul'sbaseline + Deltadecomposition using hand-written CuPyRawKernels instead of the CPU Numba kernels, computing in float32 for throughput on consumer/GeForce GPUs (return values are still float64, matching the CPU API).@/__rmatmul__are untouched and always use the existing float64 Numba path. A CUDA device being present never changes existing behavior/precision.cudadependency group (cupy-cuda12x).zarrregisters a pytest plugin, andanndata's zarr backend both speculatively importcupy(zarr.core.buffer.gpu); CuPy's NVRTC header discovery breaks for the rest of the process if CuPy's first import happens that way instead of throughvsparse.vsparse/__init__.pynow imports_vcs_matmul_cuda(which configuresCUDA_PATHbefore importingcupy) first;tests/conftest.pydoes the same for the test suite;pyproject.tomldisables zarr's pytest-plugin autoload during tests.VCSCArray/VCSRArray.Test plan
uv run pytest tests/— 1655 passed, 111 skipped (pre-existing all-zero/shape-too-small skips only) — includes real CUDA execution on 2 physical GPUs (RTX 4090, RTX 5080), verified against the CPU kernels.uv run ruff check .— cleanuv run ty check— clean (one benignunused-ignore-commentwarning, matching this repo's existing convention for optional-import lines)