Enum Class GgmlType

java.lang.Object
java.lang.Enum<GgmlType>
ai.beestream.jitnn.gguf.GgmlType
All Implemented Interfaces:
Serializable, Comparable<GgmlType>, Constable

public enum GgmlType extends Enum<GgmlType>
The tensor element types a GGUF file can hold (ggml's ggml_type), with their ids, block sizes and the jitNN DType each one loads as. Types without a jitNN counterpart can be listed and read as raw bytes (GgufFile.raw(String)), but not loaded as tensors.
  • Nested Class Summary

    Nested classes/interfaces inherited from class Enum

    Enum.EnumDesc<E>
  • Enum Constant Summary

    Enum Constants
    Enum Constant
    Description
    bfloat16.
    IEEE 16-bit float.
    32-bit float.
    64-bit float; raw bytes only.
    16-bit signed integer; raw bytes only.
    32-bit signed integer.
    64-bit signed integer; raw bytes only.
    8-bit signed integer; raw bytes only.
    2-bit k-quant super-blocks of 256 values.
    3-bit k-quant super-blocks of 256 values.
    4-bit blocks of 32 values with an FP16 scale.
    4-bit blocks of 32 values with an FP16 scale and minimum.
    4-bit k-quant super-blocks of 256 values.
    5-bit blocks of 32 values with an FP16 scale.
    5-bit blocks of 32 values with an FP16 scale and minimum.
    5-bit k-quant super-blocks of 256 values.
    6-bit k-quant super-blocks of 256 values.
    8-bit blocks of 32 values with an FP16 scale.
    8-bit blocks of 32 values with a scale and sum; raw bytes only.
    8-bit k-quant super-blocks of 256 values (llama.cpp's intermediate type); raw bytes only.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Bytes per block.
    int
    Values per block (1 for the plain types).
    long
    byteSize(long elements)
    Bytes taken by elements values (elements a multiple of the block size).
    The jitNN type this one loads as, or null when jitNN has none.
    static GgmlType
    fromId(int id)
    The type with ggml id id, or null for an id this reader does not know.
    int
    id()
    ggml's numeric id for this type, as stored in the file.
    static GgmlType
    Returns the enum constant of this class with the specified name.
    static GgmlType[]
    Returns an array containing the constants of this enum class, in the order they are declared.

    Methods inherited from class Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • F32

      public static final GgmlType F32
      32-bit float.
    • F16

      public static final GgmlType F16
      IEEE 16-bit float.
    • Q4_0

      public static final GgmlType Q4_0
      4-bit blocks of 32 values with an FP16 scale.
    • Q4_1

      public static final GgmlType Q4_1
      4-bit blocks of 32 values with an FP16 scale and minimum.
    • Q5_0

      public static final GgmlType Q5_0
      5-bit blocks of 32 values with an FP16 scale.
    • Q5_1

      public static final GgmlType Q5_1
      5-bit blocks of 32 values with an FP16 scale and minimum.
    • Q8_0

      public static final GgmlType Q8_0
      8-bit blocks of 32 values with an FP16 scale.
    • Q8_1

      public static final GgmlType Q8_1
      8-bit blocks of 32 values with a scale and sum; raw bytes only.
    • Q2_K

      public static final GgmlType Q2_K
      2-bit k-quant super-blocks of 256 values.
    • Q3_K

      public static final GgmlType Q3_K
      3-bit k-quant super-blocks of 256 values.
    • Q4_K

      public static final GgmlType Q4_K
      4-bit k-quant super-blocks of 256 values.
    • Q5_K

      public static final GgmlType Q5_K
      5-bit k-quant super-blocks of 256 values.
    • Q6_K

      public static final GgmlType Q6_K
      6-bit k-quant super-blocks of 256 values.
    • Q8_K

      public static final GgmlType Q8_K
      8-bit k-quant super-blocks of 256 values (llama.cpp's intermediate type); raw bytes only.
    • I8

      public static final GgmlType I8
      8-bit signed integer; raw bytes only.
    • I16

      public static final GgmlType I16
      16-bit signed integer; raw bytes only.
    • I32

      public static final GgmlType I32
      32-bit signed integer.
    • I64

      public static final GgmlType I64
      64-bit signed integer; raw bytes only.
    • F64

      public static final GgmlType F64
      64-bit float; raw bytes only.
    • BF16

      public static final GgmlType BF16
      bfloat16.
  • Method Details

    • values

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

      public static GgmlType valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified name
      NullPointerException - if the argument is null
    • fromId

      public static GgmlType fromId(int id)
      The type with ggml id id, or null for an id this reader does not know.
    • id

      public int id()
      ggml's numeric id for this type, as stored in the file.
    • blockValues

      public int blockValues()
      Values per block (1 for the plain types).
    • blockBytes

      public int blockBytes()
      Bytes per block.
    • dtype

      public DType dtype()
      The jitNN type this one loads as, or null when jitNN has none.
    • byteSize

      public long byteSize(long elements)
      Bytes taken by elements values (elements a multiple of the block size).