Skip to content

Add Apple GPU backend for count_overlaps#152

Open
mwiewior wants to merge 6 commits into
masterfrom
feature/gpu-count-overlaps-openspec
Open

Add Apple GPU backend for count_overlaps#152
mwiewior wants to merge 6 commits into
masterfrom
feature/gpu-count-overlaps-openspec

Conversation

@mwiewior
Copy link
Copy Markdown
Contributor

Summary

  • add optional apple-gpu feature using objc2-metal and bio.count_overlaps_backend = auto|cpu|apple_gpu
  • implement Apple Metal rank-based count_overlaps backend with CPU fallback, projection pushdown, right-side column pruning, and GPU batch coalescing
  • add count/projection/unit/integration coverage plus release benchmark timing breakdowns
  • document OpenSpec change for the Apple GPU backend and benchmarking/dispatch behavior

Benchmarks

8-7 dataset from /tmp/polars-bio-bench/databio (ex-rna vs ex-anno), release mode, Apple M3 Max, 1 thread:

  • CPU mean: 611.363 ms
  • final auto/GPU mean after optimizations: 402.442 ms
  • result: n_rows=1194285,total_overlaps=307298602

Timing breakdown after final optimization:

  • left collect: ~51-55 ms
  • CPU rank-index/backend build: ~282-303 ms
  • GPU batch execution: ~30-32 ms

Verification

  • cargo test -p datafusion-bio-function-ranges --features apple-gpu
  • cargo test -p datafusion-bio-function-ranges --features apple-gpu test_count_overlaps_apple_gpu_matches_cpu_fixtures -- --ignored --nocapture
  • cargo run -p datafusion-bio-function-ranges --release --features apple-gpu --example count_overlaps_bench -- --backend auto --threads 1 --repeats 5 --warmups 1 --timings --left /tmp/polars-bio-bench/databio/ex-rna --right /tmp/polars-bio-bench/databio/ex-anno

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant