Skip to content

refactor: move YOLO out of core, keep the reusable detection pieces - #1437

Merged
michalharakal merged 3 commits into
developfrom
refactor/yolo-out-of-core
Oct 21, 2026
Merged

michalharakal merged 3 commits into
developfrom
refactor/yolo-out-of-core

Conversation

@michalharakal

Copy link
Copy Markdown
Contributor

Model-specific detector code leaves core; the reusable detection pieces stay. Two commits, rebased onto
develop (0.62.0-dev), touched-module jvmTest + repo-wide apiCheck green.

What moves out

skainet-model-yolo (graph, config, decoder, preprocess) is removed; it lives on in its cartridge
blueprint — detection-yolov8-iree in SKaiNET-cartridge-blueprints — which owns the model end to end
(ADR-015). The 0.58.0–0.60.0 artifacts stay on Maven Central. ModelArchitecture.YOLO is deprecated,
the yolo.* GGUF keys are no longer read, tests/docs reworded.

What stays, generalized (skainet-data-media, now published)

  • Letterbox: aspect-preserving fit into a square canvas without a platform image —
    fit(width, height, targetSize), fillNchw(rgb888, padValue = 114) (bilinear, [0,1], NCHW),
    toSource(box) back-mapping, clamped.
  • BoundingBox / ScoredBox / nonMaxSuppression: pixel boxes with iou and fromCenter, greedy
    class-aware NMS with maxDetections.
  • The module gets the publish plugin (it was unpublished; the blueprint depends on it).

Fixes riding along (skainet-compile-hlo)

  • softmax lowering honoured parameters["axis"] but the tape records dim, so every exported
    softmax(t, dim) reduced over the last axis. Reads dim now (axis still accepted).
  • logSoftmax (recorded as softmax(log = true)) exported as a plain softmax; now lowers to
    x - max - log(sum(exp(x - max))).

Verification

  • compile-hlo 259 tests; data-media 13 tests on the new pieces; jvmTest of every touched module +
    apiCheck green after the rebase.
  • Downstream proof: the blueprint's YOLOv8n export built with these pieces matches ONNX Runtime on the
    host (eager and IREE llvm-cpu, head rtol/atol 1e-2, identical post-NMS detections) and passes the
    golden run on a Pixel 8a (CPU and Vulkan packs, identical scores).

🤖 Generated with Claude Code

michalharakal and others added 2 commits October 21, 2026 18:37
The tape records TensorOps.softmax(t, dim) with parameters["dim"], but the
StableHLO converter read parameters["axis"] and fell back to the last axis,
so every exported softmax over a non-last dimension reduced over the wrong
one (found exporting a YOLOv8 DFL head: softmax over 16 bins ran over the
8400 anchors). logSoftmax, recorded as softmax with log = true, was exported
as a plain softmax; it now lowers to x - max - log(sum(exp(x - max))).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The YOLOv8 graph, config and decoder leave core for their cartridge
blueprint (detection-yolov8-iree), which owns the model end to end.

- skainet-data-media: Letterbox (fit / fillNchw / toSource) and
  BoundingBox, ScoredBox, nonMaxSuppression, with tests; the module gets
  the publish plugin (it was never on Maven Central).
- skainet-model-yolo removed with its wiring (settings, dokka,
  tensor-tools).
- ModelArchitecture.YOLO deprecated; yolo.* GGUF key aliases dropped.
- YOLO wording out of comments, tests (MultiScaleHeadGraphDslTest) and
  docs; CHANGELOG [Unreleased].

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

📖 Documentation Preview

The documentation has been built successfully for this PR.

Generated Files:

  • Operator documentation: docs/modules/operators/_generated_/
  • JSON schema output: operators.json

Artifacts:

  • Download the documentation-preview-1437 artifact to view the complete documentation locally.

This comment will be updated automatically when the PR is updated.

@github-actions

Copy link
Copy Markdown

📖 Documentation Preview

The documentation has been built successfully for this PR.

Generated Files:

  • Operator documentation: docs/modules/operators/_generated_/
  • JSON schema output: operators.json

Artifacts:

  • Download the documentation-preview-1437 artifact to view the complete documentation locally.

This comment will be updated automatically when the PR is updated.

@michalharakal
michalharakal merged commit a8da601 into develop Oct 21, 2026
21 of 22 checks passed
@michalharakal
michalharakal deleted the refactor/yolo-out-of-core branch October 21, 2026 18:29
michalharakal added a commit that referenced this pull request Oct 21, 2026
CHANGELOG [0.62.1] - 2026-10-21 over everything develop holds since
0.62.0: the FFM Q8_0/Q4_0/Q5_0/Q5_1 binding fix (#1436) as the headline,
the YOLO move-out (#1437), the StableHLO softmax axis and logSoftmax fixes,
the compile-flexibility explanation (#1432) and the SKEEP-008 draft (#1434).
VERSION_NAME, CITATION, Antora version, README bom coordinate, What's New
and contributors, Android tutorial coordinates; regenerated operator and
kernel-support matrices.
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