Skip to content

Commit

Permalink
Add support for I8, I16 and I32
Browse files Browse the repository at this point in the history
These types are allowed in the GGUF specification.
  • Loading branch information
certik committed Mar 13, 2024
1 parent b7e9d5c commit 2d85ba2
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions gguf-py/gguf/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -661,6 +661,10 @@ class GGMLQuantizationType(IntEnum):
IQ3_S = 21
IQ2_S = 22
IQ4_XS = 23
I8 = 24
I16 = 25
I32 = 26



class GGUFEndian(IntEnum):
Expand Down Expand Up @@ -727,6 +731,9 @@ def get_type(val: Any) -> GGUFValueType:
GGMLQuantizationType.IQ3_S: (256, 2 + QK_K // 4 + QK_K // 8 + QK_K // 32 + 4),
GGMLQuantizationType.IQ2_S: (256, 2 + QK_K // 4 + QK_K // 16),
GGMLQuantizationType.IQ4_XS: (256, 2 + 2 + QK_K // 2 + QK_K // 64),
GGMLQuantizationType.I8: (1, 1),
GGMLQuantizationType.I16: (1, 2),
GGMLQuantizationType.I32: (1, 4),
}


Expand Down

0 comments on commit 2d85ba2

Please sign in to comment.