grit-datatype
v1.1.0
Published
Check what a quantized tensor actually means: GRIT descriptors carry the full numeric contract (element format, group sizes, scale formats, zero points, sparsity, rounding) as 64 bytes with a 64-bit id, verifiable against the bytes in O(1). Spec v1, zero
Maintainers
Readme
grit-datatype
TypeScript implementation of GRIT (Grouped Reduced-precision Interchange Type) — a 64-byte descriptor that states the full numeric contract of a block-scaled, sparse, reduced-precision tensor (element format, group sizes, scale formats, zero-point convention, sparsity, rounding rule) and is checkable against the actual bytes in O(1). Zero dependencies, strict TypeScript, branded types.
npm install grit-datatypeimport { descFor, descPack, gidOf, GRADE_MXFP4, crockford32 } from "grit-datatype";
const d = descFor("GRADE_MXFP4"); // one of the six reference grades
const g = gidOf(descPack(d), GRADE_MXFP4, [4096, 4096]);
console.log(crockford32(g)); // "2RG22AE7FTJAJBA6R42BA68EBY"
// bit-identical across the C, C++, Rust, Python and TypeScript implementations- Spec, conformance vectors, and the other four implementations: https://github.com/singhpratech/grit-datatype
- Conformance: 91/91 tests over the shared 68-entry vector suite; 96/96 cross-language fingerprint agreement.
- License: Apache-2.0 © 2026 singhpratech
