Skip to content

Add GLiNER2.5-Decide support and Sort Anything / Sort Decisions demos - #13

Merged
Alex-Wengg merged 2 commits into
mainfrom
feat/sort-anything-demo
Sep 25, 2026
Merged

Alex-Wengg merged 2 commits into
mainfrom
feat/sort-anything-demo

Conversation

@Alex-Wengg

Copy link
Copy Markdown
Member

Adds GLiNER2.5-Decide (Fastino, Apache-2.0) via the Core ML packages in FluidInference/gliner2-5-decide-coreml, plus two demos.

  • GLiNER2Variant.decide (128 tokens) and .decideLong (256 tokens): up to 4 heads × 32 labels per call, fp16 packages pinned by revision and checksum.
  • Multi-head schema sequences ([SEP_STRUCT] between heads) and GLiNER2Manager.classifyConcurrently(text:heads:), which uses Core ML's async prediction so several calls can run at once. Single-head sequences are unchanged; all saved base/multilingual fixtures still match.
  • SortAnythingDemo / SortAnythingCheck: 1,000 DBpedia-14 abstracts sorted into run-time categories.
  • SortDecisionsDemo / SortDecisionsCheck: Fastino's Fast Decisions dev split, every head of a document in one call.

Measured on an M5 Pro:

Core ML (fp16) gliner2 PyTorch, MPS, batch 32
1,000 DBpedia items ~5.9 s 22.8 s
Peak memory ~1 GB 5.7 GB
Accuracy 89.0% 89.0% (identical on all 1,000)

Fast Decisions (dev): 62.7% average, identical to the Python Core ML path.

Notes for review:

  • fp16 rather than W8: on the GPU the W8 packages peaked at 8.7 GB with about 8 s of extra load.
  • Datasets are fetched from Hugging Face at pinned revisions and cached; nothing is bundled.

🤖 Generated with Claude Code

GLiNER2Manager learns the Decide packages from
FluidInference/gliner2-5-decide-coreml: `.decide` (128 tokens) and
`.decideLong` (256 tokens), up to 4 heads x 32 labels per call. Adds a
multi-head schema sequence ([SEP_STRUCT] between heads, as GLiNER's
SchemaTransformer builds it) and classifyConcurrently(text:heads:),
which uses per-call inputs and Core ML's async prediction so several
calls can be in flight on one model. Single-head sequences are
unchanged (all saved base and multilingual fixtures still match).

The fp16 packages are pinned rather than W8: on the GPU the W8
packages trigger a load-time preparation that peaked at 8.7 GB and
added about 8 s of load, while fp16 peaks near 1 GB.

SortAnythingDemo sorts 1,000 DBpedia-14 test abstracts into
categories editable at run time (Show: paced flying cards; Turbo: 4
calls in flight). SortDecisionsDemo streams Fastino's Fast Decisions
dev split with every head of a document answered in one call. Both
fetch their data from Hugging Face at pinned revisions and cache it;
nothing is bundled. Headless checks on an M5 Pro: 1,000 DBpedia items
in about 5.9 s at 89.0%, identical to the gliner2 PyTorch release on
all 1,000; Fast Decisions 62.7% average, identical to the Python
Core ML path.
@Alex-Wengg
Alex-Wengg merged commit a054c68 into main Sep 25, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant