Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/model/ModelTensorTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const ambiguousGgmlType = (id: number, candidates: string): GgmlType => [
},
];

/** Modern names/sizes: ggml da8e2a54 enum and block sizeof assertions.
/** Modern names/sizes: ggml 57e2c2ca (v0.29.0) enum and block sizeof assertions.
* Historical collisions: llama.cpp b1500/b1803/b1871/b2100/b2172/b2221/
* b2253/b2275/b2300. Their GGUF v3 / quantization v2 do not select a layout.
* A common row multiple is necessary, but need not be a known storage block.
Expand Down Expand Up @@ -77,6 +77,7 @@ const GGML_TYPES: Readonly<Record<number, GgmlType>> = {
40: ["NVFP4", 64, 36],
41: ["Q1_0", 128, 18],
42: ["Q2_0", 64, 18],
43: ["F8_E4M3", 1, 1],
};

export const ggmlType = (id: number): GgmlType | undefined => GGML_TYPES[id];
Expand Down
4 changes: 3 additions & 1 deletion tests/boundary/model/modelArtifact.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -667,6 +667,7 @@ it("retains established storage for stable GGUF types and zero-byte K declaratio
{ name: "integer", type: 26, shape: [3n], offset: 0n, bytes: 12 },
{ name: "empty-k", type: 10, shape: [64n, 0n], offset: 32n, bytes: 0 },
{ name: "quant", type: 2, shape: [32n], offset: 32n, bytes: 18 },
{ name: "fp8", type: 43, shape: [3n], offset: 64n, bytes: 3 },
],
});
const { provider, path } = await providerAt(fixture.bytes);
Expand All @@ -676,8 +677,9 @@ it("retains established storage for stable GGUF types and zero-byte K declaratio
{ type: "I32", byte_length: 12, storage_validation: "consistent" },
{ type: "Q2_K", byte_length: 0, storage_validation: "consistent" },
{ type: "Q4_0", byte_length: 18, storage_validation: "consistent" },
{ type: "F8_E4M3", byte_length: 3, storage_validation: "consistent" },
]);
expect(result.value.totals.tensor_bytes).toBe(30);
expect(result.value.totals.tensor_bytes).toBe(33);
expect(result.value.coverage).toMatchObject({
tensor_ranges: "complete",
storage_sizes: "complete",
Expand Down
Loading