Skip to content

Update libmarv (Metal/SIMD backends, multi-tile) and port the GPU ungapped prefilter - #1168

Merged
martin-steinegger merged 9 commits into
masterfrom
libmarv-metal
Nov 8, 2026
Merged

martin-steinegger merged 9 commits into
masterfrom
libmarv-metal

Conversation

@martin-steinegger

@martin-steinegger martin-steinegger commented Nov 1, 2026 •

Copy link
Copy Markdown
Member

Updates lib/libmarv to 76fdd27 (Metal/SIMD backends, API rework, Metal multi-tile, CUDA 12.9 and libstdc++ 8 build fixes) and ports ungappedprefilter and gpuserver to the new API. Adds ENABLE_METAL (mode 3 and gpuserver not supported there yet; Metal build untested).

GPU scores only change where they were wrong before: int8 saturation at 250 on Blackwell, fp16 rounding above 2048 on half2 GPUs (L40S), and mode 3 end positions, which now match CPU SW. Mode 1 is otherwise byte-identical, and GB10 and L40S give identical scores.

GPU Set Mode 1 Mode 3
GB10 2M DB 9.3 s → 5.4 s 9.6 s → 7.8 s
L40S 2M DB 4.9 s → 4.3 s 5.3 s → 5.5 s
L40S examples — 3.3 s → 4.7 s

Builds with CUDA 12.9+ (int8 kernels need ≥ 13.2). Not tested: HIP, Metal, util/regression.

80564f82 Rework SIMD and Metal
e1da17fd Add SIMD
96ec40f1 Fix metal folder issue
204b06fc Add metal backend
4e90121e Delete old amd make aligner
ac0cb2a2 Update Readme
5feb4466 Stay below 64kb smem for masking kernels (AMD limitation)
e679ac56 Merge branch 'fixmultitiletempstorage'
bf308bdc Disable remaining stream-ordered allocations for AMD
65f2486d Disable stream-ordered memory allocation for AMD in thrust async allocator
66d45b5b Fix the #ifdefs in sequence_masking.cuh
524faa4f Compute correct amount of temp storage for multi-tile gapless kernels
71b9f81e remove old obsolete set of tuning configs
5e7fdcbb Merge pull request #8 from steineggerlab/tuningconfigsupdate
567338a2 fix for merging
598cd2b9 Merge branch 'main' into tuningconfigsupdate
4430da00 Don't compile small tile sizes for multi-tile alignments
086b513d Fix bogus sorting order of sm121 configs
2c37b6c1 Update the arch-dependend libmarv inline namespace to support AMD
1a51dc53 Rename MARV_HAVE_SM* to MARV_HAVE_NVIDIA_SM*
1ae4e1f2 Fix AMD compilation of per-arch objects
0948182b Merge pull request #7 from steineggerlab/reworkgaplessconfiguration
b1ab19cc materialize offset transform iterator for faster masking compilation time
bd59a5bb fix sequence masking compilation errors for hip
16d8f793 fix
9dd5b181 update kernel configs for masking
ac7170da Integrate new masking  part2
0202bea0 Integrate new masking  part1
7f39c96a expose database scan batch id to searches
0ceccc54 Masking overhaul
7b4ea23c Merge branch 'reworkgaplessconfiguration' into masking2
6cb550ff Update cmake file
98147a9b fix
f919c18b fixes
36ef9db5 c&p some configs for untuned archs. update factory functions
324a9e03 fix compile errors nvidia
1fa5379e Add untuned 32bit implementations for missing nvidia archs and update factory function
a1019791 update tuning for gapless sm89
c78f8f61 update tuning for gapless gfx1150
9e7e825b update tuning for gapless sm80
5981dd6c update tuning for gapless sm120
999665ff update tuning for gapless sm90
1d965dbf Add tuning for gapless gfx942 and gfx1100
dc909013 update tuning for gapless sm86
ea522d63 Use the same kernel template for int8 score only and score endpos
98e02341 Cleanup includes
36197bd6 Update Readme
e2b7209d Do not compile the half2fmarelu fp8 variant for ROCm
6d530445 fix multi-tile tuning
210ad849 Fix Readme
0531521a Add tuning Readme
00bfc62c fix printing
84e862ce Disable uint8x4 endpos tuning
5fc029d2 update Makefile
9a62a2e2 Add score endpos tuning functions
7d7f0a79 Add int32 tuning functions
deb45835 Enable MathOps<int> for ROCm
79c6525f remove old tuning sources
3a20ca39 Refactor tuning, use aligner interfaces
a8309c01 Add cmake option to only build tuning program
f256bce8 Add virtual dtor to alignment interfaces
2fa09eae ROCm compilation fixes
d5560713 Add missing includes
dd0c9a55 Split header / implementation file for database and searches
c562539a Add missing sort in score_endpos_search
e82b7c9b Refactor fullscan batch streaming/processing in GPU database
3f05bcfc Properly resolve multi-gpu result issue. Inter-gpu stream dependencies were missing
43d7f261 save
4c3de5f4 save
a1928ef3 save
710dd2a3 save
c4791da4 Remove old main.cu
eaa862ef drive-by fix for 'unspecified launch failure' when combining multi-gpu results
09c55714 fix combining multi-gpu results
3e90c816 ensure correct buffer allocation for multi-gpu communication
8bc4a484 remove old file benchmarking.cuh
eaf32f8b remove old reference of cudasw4 from makedb.cpp
7553f43a Try out different masking kernels
cdadad86 Fix foldseek subset search thrust::merge
eda23b5e Pad allocations of sequence data
99830c53 Add MARV_HAVE_SM... flag to makefile
a3376f5b remove allDevicesAreBlackwell function
3be190b2 Include thrust/tuple.h
5eca9a44 Add granular per-architecture kernel selection
51c2c84c Fix Marv wrapper: endpos-overflow execute() call, const char* query API
e61cc77f Restore per-arch HIP Half2 gapless config, fix float overflow
c2b3f99a Build tuner via CMake and bound to query length 2048 and step-4
3eceafd6 Retune sm121 gapless and gapless-endpos configs on DGX Spark
7b335c1c Add fp16-overflow cascade to endpos rescore (Foldseek2 + Gapless_Endpos)
9b8648d1 Fix wrong overflow aligner span in ScoreEndposSearch overflow correction
af1a1c65 Cleanup, make unified mem work again, sm121 endpos and AMD aligner path
8c218f3d HIP compiles and runs again
5e3cd5cc Port HIP support onto new architecture
cd5979ed Merge reworkgaplessconfiguration into main
601c32aa Update marv.cu to use the new searches
aea84d86 Remove d_tempStorage from working set
ea691d7e improve directory structure
f526b9fb Merge branch 'masking' into foldseeksearch
98f713b8 Slight performance improvement for masking kernel 5. implement another masking kernel
d1a37686 more accurate gcups computation
3d8bfd09 Fix reading performance hints when constructing multialigner
52dcb26e Consider actual input size when querying suggested temp bytes for alignments
b76f9276 thrust::no_init in gpudatabase. fix gather size
fee6b729 remove old overflow computation
92f14673 fix temp storage race foldseek
f8be4c4b fix temp storage race
2e0dbdc5 save
332233cb rework overflow correction in foldseek search
90050ea9 fix aa12 pssm copy to gpu
bb69c9d6 Fix results when using batch of queries in foldseek
b215b1b2 Fix results when using batch of queries
442cdfb9 Add kernel to compute aa12 diagonal score
fedf69e3 save. also fixed consume output array for searches
3c071ea2 start implementing foldseek search. add sequene masking
4ffb1b7c make offsetiterator a thrust::transform iterator to correctly interface with other thrust functions
0cbe84ec Rework aligners factory functions to make bit-width explicit
720d56d3 Properly compute overflow threshold based on used data type
1a143bf8 implement processing subset of db. re-enable Gapless+SW_endpos scan type
9d216d29 Add offset_iterator.cuh. Add overflow settings. Pass sequence data to alignment kernels via struct
e3bf3fb9 refactor merging results during search
fffb1166 Fix sub-batching
5e9f5e47 Add basic score overflow correction
3dea5f3e unify pssms for gapless and sw
4a9183c2 main2 use allowInt8
6fd2de0e score endpos search
21c9e613 Can process a batch of queries with score only search
0e7dfeaf Add new classes to separate database streaming and search tasks
562b10df float tuning program
0d826e5f implement gapless float kernels
502fffa1 fix thrust::sequence input size
0cee5d41 save
39a3f1d9 Forgot to add gapless_common.cuh
62be4575 Centralize computation of pssm replication factor
0c06e9de Fix tuning program
6b46795d use blocksize parameter in launch_bounds
7f6a5461 gapless with endposition kernels
3730c6b6 add marv.o to Makefile
a17bf005 remove old sw instantiations and configs
f1ad7b82 make_aligner_endpos for all archs
d3351eeb Fix incorrect end positions in SW kernel
9b5c351d Add EndPos Interface + SW_EndPos implementation
004bba84 Enable SW score only scan
cf21e0b9 Add SW score only interface
fb973f44 rename interface to 'ScoreOnly' instead of 'Gapless'
315b4d5f rename arrays to 'kernelOutputArray'
cc30acc0 Remove usage of 'MaxReduceArray'
14ec30a8 numRegs % 4 == 0 no longer required
de7e5533 Half2 instead of Short2 in gapless config for defaultptx
8d4750d9 save
2dc5e33e Remove tileconfigsearch
4dbdbfd5 Delete old obsolete gapless configuration stuff
d8ecfc50 remove ancient kernel files
ab3f50a0 config performance hints
a45702f6 Refactor tuning
adc8337d More accurate estimation of longest sequence in db batch when processing multi-tile queries
79a74e33 re-tune sm120 int8
6f4f5757 make_aligner for each arch
40d3434e Remove blosum.cu. rework namespaces and call it libmarv instead of cudasw4
ac2f7239 Create a new aligner interface for simpler configuration
62be6cb9 Add a new tuning program for the gapless kernel
683fab4e Do not call exit when dynamic shared memory size cannot be set, throw exception instead.

git-subtree-dir: lib/libmarv
git-subtree-split: 80564f82bcd13d7bb15f6fc5a05411f5f3455d48
- Use Marv(dbEntries, alphabetSize) and search_scoreOnly /
  search_scoreOnly_then_scoreEndpos_for_tops via a shared marvSearch helper
  (gop/gex -11/-1, as the former GAPLESS_SMITH_WATERMAN mode used).
- ENABLE_METAL builds libmarv's Metal backend and reuses the HAVE_CUDA path;
  ungapped+gapped prefilter mode and gpuserver are rejected under HAVE_METAL.
- Size the result buffer with resize instead of writing past reserve().
6d07d5d1 Add Metal multi-tile gapless scan for long queries

git-subtree-dir: lib/libmarv
git-subtree-split: 6d07d5d199fa8d84dce4f539d8a0b99d1e493086
eb1f7de7 Fix CUDA < 13.1 build, OpenMP with clang as CUDA host, multi-tile test on CUDA

git-subtree-dir: lib/libmarv
git-subtree-split: eb1f7de7e931d6af23adb553048a43942e499e6f
76fdd272 Use C++14 numeric algorithms in searches for libstdc++ < 9

git-subtree-dir: lib/libmarv
git-subtree-split: 76fdd272ba6fe92e8c7edc69e243ac474c80e889
@martin-steinegger
martin-steinegger merged commit 0a0e39f into master Nov 8, 2026
14 checks passed
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