Skip to content

Add GPU-accelerated TCRdist distance calculation - #754

Open
felixpetschko wants to merge 57 commits into
scverse:mainfrom
felixpetschko:feature/gpu-tcrdist
Open

felixpetschko wants to merge 57 commits into
scverse:mainfrom
felixpetschko:feature/gpu-tcrdist

Conversation

@felixpetschko

@felixpetschko felixpetschko commented Sep 30, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

This PR adds GPU support for the CDR3 TCRdist metric, following the general structure of the GPU Hamming implementation and matching the updated CPU TCRdist behavior. It substantially improves execution time on large datasets.

  • Adds metric="gpu_tcrdist" for GPU-accelerated CDR3 TCRdist calculations, supporting
    BLOSUM62 and TCRBLOSUM matrices.

  • Follows the GPU Hamming implementation with configurable row/column tiling, adaptive
    result buffers, symmetry-based tile skipping, ...

  • Supports fixed_gappos=True only; dynamic gap positioning is not yet implemented.

  • Matches the updated CPU defaults and trimming behavior: gap_penalty=12, cutoff=24, trim-
    aware fixed gap positioning, and exclusion of fully trimmed sequences. -> depends on PR Update CPU TCRdist defaults and fix trimming behavior #753.

  • Enables processing of the Omniscope COVID dataset with approximately 8 million cells in about ~5
    minutes on a single NVIDIA A30, compared with approximately ~2 hours with 64 CPU
    cores with the CPU implementation.

  • Updates API documentation, the large-datasets tutorial, and the changelog.

# Conflicts:
#	src/scirpy/tests/test_ir_dist_metrics.py
@felixpetschko

Copy link
Copy Markdown
Collaborator Author

@grst Could you please add the run-gpu-ci label? I don't have permission to set it myself.

@codecov

codecov Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 10.71429% with 175 lines in your changes missing coverage. Please review.
✅ Project coverage is 74.29%. Comparing base (998c66a) to head (b17b75b).

Files with missing lines Patch % Lines
src/scirpy/ir_dist/metrics.py 9.84% 174 Missing ⚠️
src/scirpy/ir_dist/__init__.py 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #754      +/-   ##
==========================================
- Coverage   76.78%   74.29%   -2.50%     
==========================================
  Files          52       52              
  Lines        4851     5045     +194     
==========================================
+ Hits         3725     3748      +23     
- Misses       1126     1297     +171     
Files with missing lines Coverage Δ
src/scirpy/ir_dist/_util.py 91.21% <100.00%> (ø)
src/scirpy/ir_dist/__init__.py 92.30% <50.00%> (-0.83%) ⬇️
src/scirpy/ir_dist/metrics.py 41.61% <9.84%> (-8.00%) ⬇️

... and 3 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@grst grst added the run-gpu-ci runs GPU CI label Sep 30, 2026
@grst

grst commented Sep 30, 2026

Copy link
Copy Markdown
Collaborator

added, also sent you an invitation to give you the permissions.

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

run-gpu-ci runs GPU CI

Projects

Status: In progress

Development

Successfully merging this pull request may close these issues.

2 participants