Speeding up DeepLIFT/SHAP: packed-sequence dinucleotide shuffling avoids memory blowup

jmschreiber91 · x · 2026-10-20

While speeding up a DeepLIFT/SHAP implementation, the author hit a bottleneck: dinucleotide shuffling each input independently was slow, but shuffling all sequences together (expecting 100k+ sequences, 20x shuffles each) caused an insane memory blowup.

The fix is computing directly on packed sequences — tangermeme functions now support ersatz operations directly on packed data, so transforms like shuffling no longer require expanding into huge tensors.

Related event: tangermeme's PackedSequence: 2-bit packing cuts genomics sequence memory 16x(6 posts)→

Original post →

More from Research

Research channel →