Thanks Russ, the numbers help a lot. I’m +1 on leaving float16 / int8 out of v4 (option 1), and using separate vector element types later (option 3) if we want them in v5.
>From the Delta/Spark side: - I’d push back on option 2. If float16 is just a storage choice for vector(float, D), the actual encoding becomes a per-file writer choice. Every reader has to support all allowed encodings and only finds out which one it got when it opens the file. For ~2% size win, that feels like a lot of complexity. - I agree validation is the stronger reason to put the width in the type. Options 3 and 4 do that; option 2 doesn’t. - Spark and Delta don’t have a half-precision type today. Adding a real float16 type would mean changes across several type systems before we have a concrete need for it. Keeping it inside vector is much cheaper, and engines that don’t support float16 can still read through the parent type. - I've started drafting a Delta vector RFC, and the intent is to keep its physical mapping the same as Iceberg's: one physical element type for each E, and a field id only on the outer group. If v4 starts with int / long / float / double, the two formats can stay aligned from the start, and both can add element types later. One thing I’d like in the v4 wording: don’t close the set of element types in vector(E, D). That way adding a float16 / int8 element type later doesn’t require inventing a new vector type. Best, Andrei On Wed, Nov 18, 2026 at 4:56 AM Russell Spitzer <[email protected]> wrote: > *Background* > > The v4 vector type, vector(E, D), stores fixed-length numeric arrays such > as embeddings. > E is the element type and D is the dimension. A list can hold the same > values today, but > it gives no guarantees about them. A vector guarantees that every non-null > value has > exactly D elements, and that every element is non-null and finite. Writers > enforce these > rules, so readers and engines can rely on them. > > The proposed element types are int, long, float, and double. These are > existing Iceberg > primitives so the change is very straightforward. However, we've had > requests for new > types currently not represented in Iceberg, specifically float16 and int8. > We've had a lot of > discussion about the "how" we could add such types but not enough > discussion of "why" and "why now." > > > *My main focus now is finishing V4. If we can't reach consensus after this > much discussion, I think the only real option is to push this to V5.* > > I think there are basically 3 different answers to the "Why" for the new > types > > - Physical Storage > - Gain: Fewer bytes on disk and over the network > - Needs: An encoding that does not store 16 bits of padding per value > - Performance > - Gain: Less memory, faster scans, faster distance computation > - Needs: The width in the schema, and an engine with native float16 > memory and compute > - Validation > - Gain: A guarantee that every value fits in the type > - Needs: The width in the schema, and writers that enforce it > > > *Physical storage* > The storage question is this: if the data is already float16, how much > space do we lose when we store it as float? > > I measured this on five public embedding sets: OpenAI 1536d and 1024d, > Cohere Wikipedia 768d and 1024d, > and GloVe 200d (chart and data > <https://gist.github.com/RussellSpitzer/d571e3bd5db91b964f021cfcf94f2112>; > I got the datasets from Raincloud <https://github.com/spiraldb/raincloud>). > All values were float16 values. I stored each set as float and as FLOAT16. > > Storing float16-valued vectors as float32 doubles their size uncompressed > (32 vs 16 bits per value), > but with dictionary encoding and zstd the float32 column comes to about > 15.0 bits per value against 14.7–14.8 for FLOAT16, roughly 2% larger. > > With dictionary encoding, float loses almost nothing. The float16 data I > tested has only 25,000 to 35,000 distinct values, > so each value becomes a 15-bit dictionary ID. Even in the worst case, > there are only about 64,000 distinct float16 values, > which would need just 16-bit dictionary IDs. > > Peter Vary's synthetic benchmark agrees (results > <https://lists.apache.org/thread/p41hstcw9r702zo9k94qzn67foxbbnzk>). His > values were also float16, and dictionary encoding > gave about 15.1 bits per value for both float and FLOAT16. > > Allowing FLOAT16 as storage for vector(float, D) saves about 2% over a > dictionary-encoded float column. So there is really nothing to gain here. > INT8 is stored as Int32 physical type in Parquet, so there is no encoding > difference between Int8 and In32 data. > > *Performance* > > If the schema declares float16, a compatible engine can theoretically hold > each element in > 2 bytes instead of 4, although this too depends on the engine's memory > representation. We can imagine > engines that use different in-memory representations, or representations > with some kind of internal encoding. > > The engine must still know the width/shape before it reads data. > It sizes buffers and chooses compute kernels when it plans the query. So > the width must be available at planning time. > > An engine that decodes float16 to float32 gets none of this gain. An > engine that uses an alternative memory > layout may not benefit either. The gain is also specific to chip > architectures that support SIMD on half-width types. > From my research none of Iceberg's currently supported engines could take > advantage of this now but if someone > has other targets please let me know. > > In our discussions, we also heard that some cutting-edge work needs the > vector type presented to the engine > as a byte array (there are many possible non-list like layouts), in order > to use custom distance metric implementations and similar techniques. > This is basically out of scope for our discussion since that's basically > just Binary and not a well defined type in our system. > > *Validation* > > A float16 element type also restricts the values a vector can hold. Every > element must be exactly > representable as IEEE 754 binary16. That limits magnitude to 65,504 and > precision to about three decimal digits. > Writers would enforce this, as they enforce the dimension and finite > values today. > > A reader can narrow every value to float16 with no loss. A writer that > produces out-of-range values fails at write time, > not at read time. The vector type adds the same kind of guarantee for > length and finite values. > > > *Our Choices* > > Regarding the 'Why,' it definitely seems like both Performance and > Validation are honest concerns. The question of > "Why Now" seems to be on a bit weaker ground. The Performance argument > will rely on future work in downstream engines > and as I noted may not match the performance requirements of other layouts > or other usecases in the future. Validation > though seems to be a honest requirement for the moment. > > Secret Human Note: For all the human readers who got this far, I hope you > are having a wonderful day. > > > *Given this I think we have the following options:* > * - No float16 or int8 in v4* > - We currently lack sufficient information on engines which actually > want to take advantage of this data type. We may be putting the cart before > the horse here without relevant demand. Revisit in v5, when more engines > may have native float16 support. If we don't have consensus on any of the > other options we pick this by default. > > * - Float16 as an allowed storage type for Float* > - Allows for slightly more compact physical storage. Engines that > can take advantage of physical type awareness at read time can benefit. (I > don't know of any such engines so I would recommend we don't choose this.) > > * - Separate Vector Element Types* > - We treat vectors as essentially a set of specifically typed > collections. Their typing comes from an enum of well-defined element types > which exist independently from the Iceberg Type System. This avoids us > having to do any full type work now (and potentially ever if we never have > demand for full-fledged Int8 and float16 types). I prefer this because we > already have the annotations in Parquet and I think it matches the use case > of "function on a collection of values" better than demanding implementers > support "function on a single element". Engines that want to utilize the > narrower types can, and the logical fallback is just the Iceberg parent > type for the value. > > * - Full Types for Float16 and Int8* > - The type system expands, burdening all engines with the need to > add first-class support for the new types. We haven't seen a lot of demand > for full types here so I'm hesitant to go down this road when having a > separate vector element type covers basically everything folks have been > asking for with float16 and int8. > > > Everyone who is interested please chime in so we can either nail this down > or punt to V5. > > Thanks for your time, > Russ > > > Links > > - Issue: https://github.com/apache/iceberg/issues/18297 > - Vector spec PR: https://github.com/apache/iceberg/pull/18416 > - int8 and float16 primitive draft: > https://github.com/apache/iceberg/pull/18485 > - Java VectorType PR: https://github.com/apache/iceberg/pull/18676 > - Peter Vary's benchmarks: > https://lists.apache.org/thread/p41hstcw9r702zo9k94qzn67foxbbnzk > - Storage measurements on public embedding sets: > https://gist.github.com/RussellSpitzer/d571e3bd5db91b964f021cfcf94f2112 > - Proposal and sync notes: > https://docs.google.com/document/d/1zA8PskNDFKXXJpzWQr25CFoX_aIZHBNHbkxk0t3PteE > - Parquet vector proposal: > https://github.com/apache/parquet-format/pull/624 >
