Enum Index.StorageDataType

java.lang.Object
java.lang.Enum<Index.StorageDataType>
com.spotify.voyager.jni.Index.StorageDataType
All Implemented Interfaces:
Serializable, Comparable<Index.StorageDataType>
Enclosing class:
Index

public static enum Index.StorageDataType extends Enum<Index.StorageDataType>
The datatype used to use when storing vectors on disk. Affects both precision and memory usage.
  • Enum Constant Details

    • Float8

      public static final Index.StorageDataType Float8
      An 8-bit floating point data type that expects all values to be on [-1, 1]. This data type provides adequate precision for many use cases, but cuts down memory usage bu a factor of 4x compared to Float32, while also increasing query speed.

      Float8 provides 8 bits of resolution; i.e.: the distance between successive values is 1/127, or 0.00787. For a variable-precision (i.e.: _actually_ floating point) representation, use E4M3.

    • Float32

      public static final Index.StorageDataType Float32
      A 32-bit floating point ("Float") data type. The default.
    • E4M3

      public static final Index.StorageDataType E4M3
      A custom 8-bit floating point data type with range [-448, 448] and variable precision. Use this data type to get 4x less memory usage compared to Float32, but when the values of vectors to be stored in an Index may exceed [-1, 1].

      E4M3 uses a 4-bit exponent and 3-bit mantissa field, and was inspired by the paper "FP8 Formats for Deep Learning" by Micikevicus et al (arXiv:2209.05433).

  • Method Details

    • values

      public static Index.StorageDataType[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static Index.StorageDataType valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null