Repository navigation
Tags
Tags
feat: cuda12/cuda13 extras that install CuPy and cuCIM with the CUDA … …runtime (#60) * feat: add cuda12/cuda13 extras that install CuPy and cuCIM pip and uv still cannot pick a CuPy build for the installed driver, so GPU users had to find the right cupy-cudaXXx and cucim-cuXX wheels and a matching CUDA Toolkit themselves. The extras pull both packages for one CUDA major version, with CuPy's [ctk] extra supplying the CUDA runtime and NVRTC from PyPI, so only the driver is needed. They are declared conflicting for uv and kept out of `all`. The README replaces the stale "CUDA>=11.x" requirement; CuPy 14 ships wheels for CUDA 12 and 13 only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011hEQ1TZJUbmhYKcC14RYHT * feat: name the cuda12/cuda13 extras in missing-CuPy/cuCIM messages The CPU-fallback warning gave no install hint, and the cuCIM ImportError pointed to "the GPU extras", which did not exist until now. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011hEQ1TZJUbmhYKcC14RYHT * docs: say that only uv enforces the cuda12/cuda13 exclusivity [tool.uv] conflicts is read by uv alone; pip installs both extras when asked. Also drops the closing CPU-fallback sentence, which repeated the [optional] marker in the dependency list. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011hEQ1TZJUbmhYKcC14RYHT * fix: require CuPy 14 in the CUDA extras, the first with a [ctk] extra Without a floor, an environment pinned to numpy<2 resolved cupy-cuda12x 13.6.0, which has no [ctk] extra: pip and uv only warn and install no CUDA libraries, so the first kernel compile fails. With the floor the resolution fails up front instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011hEQ1TZJUbmhYKcC14RYHT * refactor: share one GPU install hint across the missing-dependency messages The CPU-fallback warning and both cuCIM ImportErrors spelled out the extras separately; the earlier "GPU extras" wording went stale that way. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011hEQ1TZJUbmhYKcC14RYHT * fix: keep the import error in the CPU-fallback warning CuPy raises ImportError when it is installed but cannot load its CUDA libraries, and cuCIM when a dependency is missing, so "not installed" was wrong in those cases and the install hint useless. The warning now quotes the original error; the test forces a failed cupy import. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011hEQ1TZJUbmhYKcC14RYHT * docs: choose the CUDA extra by GPU architecture too, and note Linux only CUDA 13 dropped Maxwell, Pascal and Volta (compute capability < 7.5), so a V100 on a 580 driver reports CUDA 13 yet needs cuda12. cuCIM publishes Linux wheels only, and an existing cupy-cuda* package in the environment clashes with the one an extra installs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011hEQ1TZJUbmhYKcC14RYHT * docs: list the CUDA extras with the from-source extras `.[all]` was labelled "install everything" but leaves out the GPU extras, which cannot be combined. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011hEQ1TZJUbmhYKcC14RYHT --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
fix(spectral): hand the mask backend the resampled binomial halves Pre-splitting resamples only the metadata up front and defers the voxels to the repeat loop, because every repeat needs its own draw. The mask backend returns before that loop, so backend="mask" with split_type="binomial" and resample_isotropic=True analysed the original anisotropic array while spacing had already been rewritten to isotropic values: the requested resampling silently skipped and the frequency grid mislabelled. Produce the halves with _binomial_halves_resampled, as the hist backend does, and pass them as a pair so the array matches the grid and calculate_sectioned_fsc does not split a second time. MEASURED before this change: a (12, 48, 48) volume at spacing [0.3, 0.1, 0.1] reached the mask backend unsplit at its original shape while spacing read [0.1, 0.1, 0.1] -- the axial pitch understated three-fold. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DdA3u3z5WKyroEz1jpSPXk
chore: release version 0.9.0a2 Ships the MicroSSIM RI-factor fit memory fix (f4ca22a, #54) so the dynacell eval environment, pinned to 0.9.0a1, can pick it up. Still a pre-release: the single-image FRC/FSC questions from 0.9.0a1 are open. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011hEQ1TZJUbmhYKcC14RYHT
Support all Cellpose v4 models (SAM + DINO) in GPU-resident segmentat… …ion (#51) * feat(segmentation): support all Cellpose v4 models in GPU-resident path Rename the GPU-resident entry point to segment_cellpose and cover every Cellpose v4 model -- the SAM backbone (cpsam, cpsam_v2) and the DINOv3 backbones (cpdino, cpdino-vitb). The backbones differ only in the default tile size (256 for sam_vitl, 384 for dino_*) and share the (flow, style) forward contract, so the resident path needs only to expose bsize and thread it through _run_net_gpu, with cellpose's sam_vitl->256 guard. segment_cpsam is kept as a deprecated alias (warns, slated for removal after 0.8). Parity tests confirm resident masks match stock CellposeModel.eval (AP >= 0.95) for all four models in 2D and 3D. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * chore(deps): add cellpose-dino extra and require cellpose>=4.2.0 The DINO models (cpdino, cpdino-vitb) and cpsam_v2 first ship in cellpose 4.2.0, and the DINO backbones additionally need the dinov3 dependency from cellpose's `dino` extra. Bump the base cellpose extra to >=4.2.0 and add a cellpose-dino extra (cubic[cellpose] + cellpose[dino]>=4.2.0), documenting both install paths in the README. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * refactor(segmentation): centralize backbone tile-size resolution The default tile size (256 for SAM, 384 for DINO) and the SAM-pinned-to-256 guard were encoded separately in _run_net_gpu and segment_cellpose -- two sources of truth for the same backbone->tile-size rule. Extract _resolve_bsize to own both; segment_cellpose resolves bsize once and passes the concrete value down, so _run_net_gpu no longer needs the backbone argument. Replace the GPU-only bsize-guard test with a fast pure-function unit test that covers the full resolution matrix (defaults per backbone + the SAM guard), removing a heavyweight model load for a string-compare assertion. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * test(segmentation): share CellposeModel instances across tests The GPU parity tests each constructed their own CellposeModel, reloading the same weights repeatedly (cpsam alone was built ~8 times). Add a module-scoped factory fixture that caches one model per backbone and route every GPU test through it. eval/segment_cellpose are read-only inference, so a shared instance is safe; the fixture is lazy, so no-GPU/no-cellpose runs never construct a model and free VRAM on teardown. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * chore: bump version to 0.8.0a1 First alpha of the 0.8 cycle, which adds DINO-model support to the GPU-resident segmentation path and deprecates segment_cpsam. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * fix(segmentation): mention DINO in _require_cellpose error message The ImportError raised when cellpose is missing still said "(SAM)" only, while _check_gpu_precondition was already updated to "(SAM or DINO)". Align the message and point DINO users at the dinov3 install note in the README. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * chore(deps): drop unusable cellpose[dino] extra; document dinov3 install Published cellpose (4.2.1.1) does not expose a `dino` extra, and dinov3 is git-only (pip install git+https://github.com/facebookresearch/dinov3), so it cannot be declared as a dependency of a PyPI package. The cellpose-dino extra therefore pulled no dinov3 (uv warned the extra did not exist). Remove it and document the manual dinov3 install in the README for the DINO backbones. Regenerate uv.lock, which was stale against the cellpose>=4.2.0 bump (it still recorded >=4.0 and resolved cellpose 4.1.1, predating cpsam_v2/cpdino). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * fix(segmentation): reject non-positive bsize for DINO backbones bsize is now part of the public segment_cellpose API, but _resolve_bsize passed any explicit value straight through for DINO backbones, so bsize<=0 reached make_tiles/run_net_gpu and caused divide-by-zero / invalid tiling. Validate it as a positive integer and fail fast with a clear error. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> --------- Co-authored-by: Alexandr Kalinin <alxndrkalinin@users.noreply.github.com> Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
PreviousNext