gliner25-base-litert / config.json
spybyscript's picture
Every trained head: explicit spans, relations and records; reference runtime; phone results
ff95cf8 verified
Raw History Blame Contribute Delete
15.8 kB
{
"source": "fastino/gliner2.5-base-v1@1a8bc24e00dc7300b9017c81d63e3dcdabb26596",
"variant": "wfp16",
"runtime": {
"litert": "2.2.0 (validated on the Mac with ai-edge-litert 2.2.0; com.google.ai.edge.litert:litert:2.2.0 on Android)",
"api": "CompiledModel",
"converter": {
"litert-torch": "0.9.4",
"ai-edge-litert": "2.2.0",
"ai-edge-quantizer": "0.9.0",
"litert-converter": "0.4.0",
"torch": "2.13.0",
"transformers": "4.57.6",
"gliner2": "2.0.0"
}
},
"graphs": [
{
"path": "gliner2_base_encoder_wfp16.tflite",
"role": "encoder",
"variant": "wfp16",
"shipped": true,
"about": "encoder FULLY_CONNECTED weights stored float16 behind DEQUANTIZE (ai-edge-quantizer FLOAT_CASTING); FP32 activations, position tables and norms; finite -1e4 mask; head and scorer FP32",
"bytes": 189419856,
"signatures": [
{
"key": "t128",
"inputs": [
{
"name": "attention_mask",
"dtype": "float32",
"shape": [
1,
128
]
},
{
"name": "inputs_embeds",
"dtype": "float32",
"shape": [
1,
128,
768
]
}
],
"outputs": [
{
"name": "hidden_states",
"dtype": "float32",
"shape": [
1,
128,
768
]
}
]
}
],
"use": "the CPU (XNNPACK weight cache), or the GPU at explicit FP32 precision"
},
{
"path": "gliner2_base_encoder_fp16hw.tflite",
"role": "encoder",
"variant": "fp16hw",
"shipped": false,
"about": "wfp16's storage over the FP16-hardware encoder: LayerNorm power-of-two pre-scale (x*2^-k, eps*4^-k, k from the corpus' FP32 ranges), first feed-forward FULLY_CONNECTED split in two halves; head and scorer FP32",
"bytes": 189416320,
"signatures": [
{
"key": "t128",
"inputs": [
{
"name": "attention_mask",
"dtype": "float32",
"shape": [
1,
128
]
},
{
"name": "inputs_embeds",
"dtype": "float32",
"shape": [
1,
128,
768
]
}
],
"outputs": [
{
"name": "hidden_states",
"dtype": "float32",
"shape": [
1,
128,
768
]
}
]
}
],
"use": "the GPU at FP16 precision (decisions as wfp16 at FP32)"
},
{
"path": "gliner2_base_head_fp32.tflite",
"role": "head",
"about": "the boundary head after the encoder (FluidInference's Core ML features graph without its encoder): FP32, CPU",
"bytes": 8517024,
"signatures": [
{
"key": "t128",
"inputs": [
{
"name": "cls_indices",
"dtype": "int32",
"shape": [
1,
8
]
},
{
"name": "cls_mask",
"dtype": "float32",
"shape": [
1,
8
]
},
{
"name": "hidden_states",
"dtype": "float32",
"shape": [
1,
128,
768
]
},
{
"name": "query_indices",
"dtype": "int32",
"shape": [
1,
8
]
},
{
"name": "query_mask",
"dtype": "float32",
"shape": [
1,
8
]
},
{
"name": "text_indices",
"dtype": "int32",
"shape": [
1,
64
]
},
{
"name": "text_mask",
"dtype": "float32",
"shape": [
1,
64
]
}
],
"outputs": [
{
"name": "boundary_mask",
"dtype": "float32",
"shape": [
1,
65
]
},
{
"name": "boundary_states",
"dtype": "float32",
"shape": [
1,
65,
128
]
},
{
"name": "classification_logits",
"dtype": "float32",
"shape": [
1,
8
]
},
{
"name": "count_log_rates",
"dtype": "float32",
"shape": [
1,
8
]
},
{
"name": "end_logits",
"dtype": "float32",
"shape": [
1,
8,
65
]
},
{
"name": "inside_prefix",
"dtype": "float32",
"shape": [
1,
8,
65
]
},
{
"name": "inside_prefix_mean",
"dtype": "float32",
"shape": [
1,
8,
1
]
},
{
"name": "null_logits",
"dtype": "float32",
"shape": [
1,
8
]
},
{
"name": "pool_end_projection",
"dtype": "float32",
"shape": [
1,
65,
128
]
},
{
"name": "pool_start_projection",
"dtype": "float32",
"shape": [
1,
65,
128
]
},
{
"name": "query_states",
"dtype": "float32",
"shape": [
1,
8,
768
]
},
{
"name": "start_logits",
"dtype": "float32",
"shape": [
1,
8,
65
]
},
{
"name": "text_states",
"dtype": "float32",
"shape": [
1,
64,
768
]
}
]
}
]
},
{
"path": "gliner2_base_scorer_fp32.tflite",
"role": "scorer",
"about": "the candidate scorer and the record candidate states (FluidInference's Core ML scorer): FP32, CPU",
"bytes": 2126928,
"signatures": [
{
"key": "p192",
"inputs": [
{
"name": "boundary_states",
"dtype": "float32",
"shape": [
1,
65,
128
]
},
{
"name": "candidate_compatibility",
"dtype": "float32",
"shape": [
1,
192
]
},
{
"name": "candidate_indices",
"dtype": "int32",
"shape": [
1,
192,
2
]
},
{
"name": "candidate_mask",
"dtype": "float32",
"shape": [
1,
192
]
},
{
"name": "end_logits",
"dtype": "float32",
"shape": [
1,
8,
65
]
},
{
"name": "inside_prefix",
"dtype": "float32",
"shape": [
1,
8,
65
]
},
{
"name": "inside_prefix_mean",
"dtype": "float32",
"shape": [
1,
8,
1
]
},
{
"name": "query_mask",
"dtype": "float32",
"shape": [
1,
8
]
},
{
"name": "query_states",
"dtype": "float32",
"shape": [
1,
8,
768
]
},
{
"name": "start_logits",
"dtype": "float32",
"shape": [
1,
8,
65
]
},
{
"name": "text_mask",
"dtype": "float32",
"shape": [
1,
64
]
},
{
"name": "text_states",
"dtype": "float32",
"shape": [
1,
64,
768
]
}
],
"outputs": [
{
"name": "candidate_states",
"dtype": "float32",
"shape": [
1,
192,
768
]
},
{
"name": "pair_logits",
"dtype": "float32",
"shape": [
1,
8,
192
]
}
]
}
]
},
{
"path": "gliner2_base_explicit_fp32.tflite",
"role": "explicit",
"about": "explicit-span scorer: the boundary proposer's prior and the pair scorer over up to 64 forced spans per query (attributes, choice fields); FP32, CPU",
"bytes": 2051844,
"signatures": [
{
"key": "w64_q8_s64",
"inputs": [
{
"name": "text_states",
"dtype": "float32",
"shape": [
1,
64,
768
]
},
{
"name": "text_mask",
"dtype": "float32",
"shape": [
1,
64
]
},
{
"name": "query_states",
"dtype": "float32",
"shape": [
1,
8,
768
]
},
{
"name": "query_mask",
"dtype": "float32",
"shape": [
1,
8
]
},
{
"name": "boundary_states",
"dtype": "float32",
"shape": [
1,
65,
128
]
},
{
"name": "start_logits",
"dtype": "float32",
"shape": [
1,
8,
65
]
},
{
"name": "end_logits",
"dtype": "float32",
"shape": [
1,
8,
65
]
},
{
"name": "inside_prefix",
"dtype": "float32",
"shape": [
1,
8,
65
]
},
{
"name": "inside_prefix_mean",
"dtype": "float32",
"shape": [
1,
8,
1
]
},
{
"name": "span_indices",
"dtype": "int32",
"shape": [
1,
8,
64,
2
]
},
{
"name": "span_mask",
"dtype": "float32",
"shape": [
1,
8,
64
]
}
],
"outputs": [
{
"name": "span_logits",
"dtype": "float32",
"shape": [
1,
8,
64
]
}
]
}
]
},
{
"path": "gliner2_base_relation_fp32.tflite",
"role": "relation",
"about": "relation scorer over up to 256 head/tail pairs of up to 4 relation types (pairs chosen by gliner2's typed pair generator); FP32, CPU",
"bytes": 23658524,
"signatures": [
{
"key": "w64_r4_p256",
"inputs": [
{
"name": "text_states",
"dtype": "float32",
"shape": [
1,
64,
768
]
},
{
"name": "text_length",
"dtype": "int32",
"shape": [
1
]
},
{
"name": "relation_states",
"dtype": "float32",
"shape": [
1,
4,
1536
]
},
{
"name": "batch_index",
"dtype": "int32",
"shape": [
256
]
},
{
"name": "relation_index",
"dtype": "int32",
"shape": [
256
]
},
{
"name": "head_start",
"dtype": "int32",
"shape": [
256
]
},
{
"name": "head_end",
"dtype": "int32",
"shape": [
256
]
},
{
"name": "tail_start",
"dtype": "int32",
"shape": [
256
]
},
{
"name": "tail_end",
"dtype": "int32",
"shape": [
256
]
},
{
"name": "pair_mask",
"dtype": "float32",
"shape": [
256
]
}
],
"outputs": [
{
"name": "relation_logits",
"dtype": "float32",
"shape": [
256
]
}
]
}
]
},
{
"path": "gliner2_base_record_assignment_fp32.tflite",
"role": "record_assignment",
"about": "record decoder: instance-to-field assignment over 8 fields with up to 192 candidates each, for up to 1536 instances, plus object and latent-seed scores; FP32, CPU",
"bytes": 1193288,
"signatures": [
{
"key": "f8_c192_i1536",
"inputs": [
{
"name": "instance_states",
"dtype": "float32",
"shape": [
1536,
768
]
},
{
"name": "field_queries",
"dtype": "float32",
"shape": [
8,
768
]
},
{
"name": "field_candidate_states",
"dtype": "float32",
"shape": [
8,
192,
768
]
}
],
"outputs": [
{
"name": "assignment_logits",
"dtype": "float32",
"shape": [
1536,
8,
193
]
},
{
"name": "object_logits",
"dtype": "float32",
"shape": [
1536
]
},
{
"name": "latent_seed_logits",
"dtype": "float32",
"shape": [
1536
]
}
]
}
]
},
{
"path": "gliner2_base_record_anchorless_fp32.tflite",
"role": "record_anchorless",
"about": "record decoder: its 32 learned instances attending over up to 1536 field candidates (anchorless records); FP32, CPU",
"bytes": 2875604,
"signatures": [
{
"key": "c1536",
"inputs": [
{
"name": "context_states",
"dtype": "float32",
"shape": [
1536,
768
]
},
{
"name": "context_mask",
"dtype": "float32",
"shape": [
1536
]
}
],
"outputs": [
{
"name": "instance_states",
"dtype": "float32",
"shape": [
32,
768
]
}
]
}
]
}
],
"table": {
"path": "gliner2_base_embeddings_f16.bin",
"dtype": "float16",
"byteOrder": "little-endian",
"shape": [
128011,
768
],
"layout": "row-major, no header: row `id` is bytes [id * 1536, id * 1536 + 1536), 768 float16 values",
"bytes": 196624896,
"sha256": "22c2e937cfc17e1ee9c8f3ec6f1449d44dc9230cfcbb8737c9bae8492628a3e8",
"use": "memory-map the file; for each of the 128 positions take the row of its zero-padded id (padding takes id 0's row) and upcast to float32 into inputs_embeds"
},
"bucket": {
"tokens": 128,
"words": 64,
"queries": 8,
"choices": 8,
"pool": 192,
"boundaries": 65,
"about": "the host pads to T=128 tokens, W=64 words, Q=8 queries, C=8 choices, P=192 candidates and refuses larger requests"
},
"host": {
"steps": "as the gliner2 library does: pack and pad the request, then encoder -> head -> the shared candidate pool on the host -> scorer -> thresholds, flat overlap resolution and spans; entities abstain when sigmoid(null_logits) > 0.5",
"changes": [
"input_ids no longer enter a graph: the host looks them up in the float16 table into inputs_embeds",
"attention_mask is float32 (1.0 / 0.0) instead of int32",
"FluidInference's features graph is two graphs: encoder (inputs_embeds, attention_mask -> hidden_states) and head (hidden_states plus the six other feature inputs -> the same thirteen outputs)",
"the scorer, explicit-span, relation and record graphs take FluidInference's inputs and return its outputs, FP32",
"bind inputs by name; signatures: encoder `t128`, head `t128`, scorer `p192`, explicit `w64_q8_s64`, relation `w64_r4_p256`, record assignment `f8_c192_i1536`, anchorless records `c1536`"
]
},
"accelerators": {
"cpu": "encoder on XNNPACK with the weight cache path set (2 threads in the validation); head and scorer on the CPU (1 thread each)",
"gpu": "encoder only (the head and scorer stay on the CPU): explicit precision (FP32 with wfp16, FP16 with fp16hw) and constant tensor sharing"
},
"tokenizer": {
"file": "tokenizer/tokenizer.json",
"specialTokens": {
"[PAD]": 0,
"[CLS]": 1,
"[SEP]": 2,
"[UNK]": 3,
"[MASK]": 128000,
"[SEP_STRUCT]": 128001,
"[SEP_TEXT]": 128002,
"[P]": 128003,
"[C]": 128004,
"[E]": 128005,
"[R]": 128006,
"[L]": 128007,
"[EXAMPLE]": 128008,
"[OUTPUT]": 128009,
"[DESCRIPTION]": 128010
}
},
"provenance": {
"graphs": "encoder graph code ported from litert-community/GLiNER2.5-Decide-LiteRT (Apache-2.0); head and scorer wrappers adapted from FluidInference/gliner2-5-base-coreml (Apache-2.0)"
},
"referenceRuntime": "runtime/litert_boundary_runtime.py (gliner2 2.0.0's BoundaryExtractor over these graphs)"
}