FLASH-MAXSIM: IO-Aware Fused Kernels for Late-Interaction Scoring

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Pony, Roi, Goldfarb, Adi Raz, Friedman, Idan, Ezer, Daniel, Barzelay, Udi
Format: Preprint
Published: 2026
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866916058905968640
author Pony, Roi
Goldfarb, Adi Raz
Friedman, Idan
Ezer, Daniel
Barzelay, Udi
author_facet Pony, Roi
Goldfarb, Adi Raz
Friedman, Idan
Ezer, Daniel
Barzelay, Udi
contents Late-interaction retrieval (ColBERT, ColPali) scores a query against a document with the MaxSim operator: for every query token, the maximum similarity over the document tokens, summed over query tokens. The standard implementation materializes the full query-token x document-token similarity tensor in GPU memory; for visual ColPali at 10K documents this tensor alone is 21 GB in FP16, created only to be reduced to one score per document and discarded. It exhausts a 40 GB GPU and bounds the achievable batch size in both inference and training. We present Flash-MaxSim, an IO-aware fused GPU kernel that computes exactly the same scores without ever materializing the tensor, by streaming query and document tiles through on-chip SRAM and folding the row-maximum reduction into the same pass. We extend the IO-aware principle through the training backward pass, an inverse-grid CSR construction that reuses the forward argmax for an atomic-free, destination-owned gradient reduction, and through INT8xINT8 quantization and variable-length (padding-free) scoring. Flash-MaxSim is up to 3.9x faster on an A100 (4.7x on an H100) than naive PyTorch at matched precision, uses up to 16x less inference memory and ~28x less training memory, unlocks corpus and batch sizes that exhaust PyTorch entirely, preserves the exact ranking (100% top-20 agreement with an FP32 reference)
format Preprint
id arxiv_https___arxiv_org_abs_2605_29517
institution arXiv
publishDate 2026
record_format arxiv
spellingShingle FLASH-MAXSIM: IO-Aware Fused Kernels for Late-Interaction Scoring
Pony, Roi
Goldfarb, Adi Raz
Friedman, Idan
Ezer, Daniel
Barzelay, Udi
Information Retrieval
Late-interaction retrieval (ColBERT, ColPali) scores a query against a document with the MaxSim operator: for every query token, the maximum similarity over the document tokens, summed over query tokens. The standard implementation materializes the full query-token x document-token similarity tensor in GPU memory; for visual ColPali at 10K documents this tensor alone is 21 GB in FP16, created only to be reduced to one score per document and discarded. It exhausts a 40 GB GPU and bounds the achievable batch size in both inference and training. We present Flash-MaxSim, an IO-aware fused GPU kernel that computes exactly the same scores without ever materializing the tensor, by streaming query and document tiles through on-chip SRAM and folding the row-maximum reduction into the same pass. We extend the IO-aware principle through the training backward pass, an inverse-grid CSR construction that reuses the forward argmax for an atomic-free, destination-owned gradient reduction, and through INT8xINT8 quantization and variable-length (padding-free) scoring. Flash-MaxSim is up to 3.9x faster on an A100 (4.7x on an H100) than naive PyTorch at matched precision, uses up to 16x less inference memory and ~28x less training memory, unlocks corpus and batch sizes that exhaust PyTorch entirely, preserves the exact ranking (100% top-20 agreement with an FP32 reference)
title FLASH-MAXSIM: IO-Aware Fused Kernels for Late-Interaction Scoring
topic Information Retrieval
url https://arxiv.org/abs/2605.29517