ONNX export of fastino/gliner2.5-small-v1 (GLiNER 2.5
BoundaryExtractor) for onnxruntime-web / WebGPU. Revision 5 graphs plus
attrs.onnx (score_explicit_spans).
One encoder pass. JointIE beam, classification implies/excludes, record
assignment, and long-document chunking stay in JavaScript.
Host: Pastel-Org/gliner2.5-onnx-webgpu (live: gliner25-onnx-webgpu.pages.dev).
| File | Role | Size |
|---|---|---|
onnx/model.onnx | Encoder + entity pair path + classifier + text_states + candidate_states | 288.5 MB |
onnx/heads.onnx | SparseRelationScorer only (no encoder) | 5.9 MB |
onnx/records.onnx | RecordHead assignment (inst/field/cand projections + null column) | 0.60 MB |
onnx/attrs.onnx | score_explicit_spans (dynamo; pad 512/8/16) | 5.80 MB |
Dynamo export of head.score_explicit_spans. Traced at 512 words, 8 attribute
queries, 16 spans. The JS host crops a 512-word window around the mention; that
pad is not a document-length cap. ORT vs torch RMSE ~1e-6 (small) / ~2e-6
(base, multi). Overlay lookup is the fallback if this graph fails to load.
Attribute labels are packed with entity labels in one [E] block (sorted).
Single-label attributes use softmax. ONNX pair_valid is all-true; the host
drops start >= end slots before overlap.
Python max_len is 4096 words: classify_text / extract is one
forward pass over the whole document. That is what Fastino means by
long-context classification on CUDA/CPU.
This WebGPU export is not that:
| Call | Words in one GPU run | Measured here (M2 Max, onnxruntime-web) |
|---|---|---|
classify_text / extract | the whole string (cap 4096) | small finished 4096 words. base and multi died between 3500 and 3600 (createCommandEncoder / std::bad_alloc). |
classify_text_long / extract_entities_long | 384, overlap 64 | 4096-word docs: 13 windows. base 2.75 s, multi 4.3 s. Merge is max-confidence (classify) or span overlap (NER). |
A 4096-word classify_text_long never builds a 4096-word attention matrix.
Use the *_long APIs for contracts on base/multi in the browser.
Full Kleene classification AST is not ported; README implies / excludes
is a JS beam. Latent / anchorless records are not exported.
ONNX export of fastino/gliner2.5-small-v1 (GLiNER 2.5
BoundaryExtractor) for onnxruntime-web / WebGPU. Revision 5 graphs plus
attrs.onnx (score_explicit_spans).
One encoder pass. JointIE beam, classification implies/excludes, record
assignment, and long-document chunking stay in JavaScript.
Host: Pastel-Org/gliner2.5-onnx-webgpu (live: gliner25-onnx-webgpu.pages.dev).
| File | Role | Size |
|---|---|---|
onnx/model.onnx | Encoder + entity pair path + classifier + text_states + candidate_states | 288.5 MB |
onnx/heads.onnx | SparseRelationScorer only (no encoder) | 5.9 MB |
onnx/records.onnx | RecordHead assignment (inst/field/cand projections + null column) | 0.60 MB |
onnx/attrs.onnx | score_explicit_spans (dynamo; pad 512/8/16) | 5.80 MB |
Dynamo export of head.score_explicit_spans. Traced at 512 words, 8 attribute
queries, 16 spans. The JS host crops a 512-word window around the mention; that
pad is not a document-length cap. ORT vs torch RMSE ~1e-6 (small) / ~2e-6
(base, multi). Overlay lookup is the fallback if this graph fails to load.
Attribute labels are packed with entity labels in one [E] block (sorted).
Single-label attributes use softmax. ONNX pair_valid is all-true; the host
drops start >= end slots before overlap.
Python max_len is 4096 words: classify_text / extract is one
forward pass over the whole document. That is what Fastino means by
long-context classification on CUDA/CPU.
This WebGPU export is not that:
| Call | Words in one GPU run | Measured here (M2 Max, onnxruntime-web) |
|---|---|---|
classify_text / extract | the whole string (cap 4096) | small finished 4096 words. base and multi died between 3500 and 3600 (createCommandEncoder / std::bad_alloc). |
classify_text_long / extract_entities_long | 384, overlap 64 | 4096-word docs: 13 windows. base 2.75 s, multi 4.3 s. Merge is max-confidence (classify) or span overlap (NER). |
A 4096-word classify_text_long never builds a 4096-word attention matrix.
Use the *_long APIs for contracts on base/multi in the browser.
Full Kleene classification AST is not ported; README implies / excludes
is a JS beam. Latent / anchorless records are not exported.