Enum Class GgmlType
- All Implemented Interfaces:
Serializable, Comparable<GgmlType>, Constable
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 ConstantsEnum ConstantDescriptionbfloat16.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 TypeMethodDescriptionintBytes per block.intValues per block (1 for the plain types).longbyteSize(long elements) Bytes taken byelementsvalues (elementsa multiple of the block size).dtype()The jitNN type this one loads as, ornullwhen jitNN has none.static GgmlTypefromId(int id) The type with ggml idid, ornullfor an id this reader does not know.intid()ggml's numeric id for this type, as stored in the file.static GgmlTypeReturns the enum constant of this class with the specified name.static GgmlType[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
F32
32-bit float. -
F16
IEEE 16-bit float. -
Q4_0
4-bit blocks of 32 values with an FP16 scale. -
Q4_1
4-bit blocks of 32 values with an FP16 scale and minimum. -
Q5_0
5-bit blocks of 32 values with an FP16 scale. -
Q5_1
5-bit blocks of 32 values with an FP16 scale and minimum. -
Q8_0
8-bit blocks of 32 values with an FP16 scale. -
Q8_1
8-bit blocks of 32 values with a scale and sum; raw bytes only. -
Q2_K
2-bit k-quant super-blocks of 256 values. -
Q3_K
3-bit k-quant super-blocks of 256 values. -
Q4_K
4-bit k-quant super-blocks of 256 values. -
Q5_K
5-bit k-quant super-blocks of 256 values. -
Q6_K
6-bit k-quant super-blocks of 256 values. -
Q8_K
8-bit k-quant super-blocks of 256 values (llama.cpp's intermediate type); raw bytes only. -
I8
8-bit signed integer; raw bytes only. -
I16
16-bit signed integer; raw bytes only. -
I32
32-bit signed integer. -
I64
64-bit signed integer; raw bytes only. -
F64
64-bit float; raw bytes only. -
BF16
bfloat16.
-
-
Method Details
-
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
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 nameNullPointerException- if the argument is null
-
fromId
The type with ggml idid, ornullfor 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
The jitNN type this one loads as, ornullwhen jitNN has none. -
byteSize
public long byteSize(long elements) Bytes taken byelementsvalues (elementsa multiple of the block size).
-