Hybrid FlatMap: Group-Level Feature Projection in Nimble
Introduction
Machine learning training data often stores features in wide maps. A single map column can hold thousands of feature IDs per row, while each model reads only a sparse subset of them. Different models read different subsets, and those subsets overlap. A serving layer that streams this data to trainers has to project the requested features out of every batch it returns.
Nimble's FlatMap layout, called Full FlatMap in this post, makes that projection precise by giving every key its own streams, but thousands of small streams add encoding, framing, and schema overhead that can be a large share of a small batch. Hybrid FlatMap partitions a map's keys into disjoint groups of features that are usually read together. All keys in a group share one set of streams, and the server projects each group on its own by passing its encoded streams through unchanged.
This article explains the Hybrid FlatMap layout and its two-stage projection, then compares it with Full FlatMap and regular maps in the Presto Page format.









