Skip to content

ci(devkit): catalog ↔ dev-kit consistency check; compare replaced shipped kernels - #1087

Merged
zaneni6 merged 7 commits into
mainfrom
ci/devkit-catalog-consistency
Nov 20, 2026
Merged

zaneni6 merged 7 commits into
mainfrom
ci/devkit-catalog-consistency

Conversation

@zaneni6

@zaneni6 zaneni6 commented Nov 20, 2026

Copy link
Copy Markdown
Collaborator

Makes the dev kit the enforced source of what flm ships. Before this, a new model family added only under src/ (catalog entry, prebuilt libs, xclbins) passed every check.

Catalog rules (in devkit_check.py, run by devkit-static):

  • Every NPU (aie2p) model in src/model_list.json needs:
    • a kernel_assignment.json entry whose folder is its xclbin folder (a model that reuses another model's kernels names that folder in xclbin_folder instead);
    • exactly one engines.json engine listing it.
  • Every kernel_assignment entry is a catalog model, or is in served_elsewhere.
  • Every assigned slot exists under src/xclbins/, and every shipped .xclbin is assigned.
  • Every library in src/lib/{xrt,hrx} is built by an engines.json directory. Library names come from each Makefile TARGET / CMake add_library.
  • Each such library ships as .so, .dll and .lib for both runtimes.
  • Exceptions live in one allow-list (CATALOG_ALLOW), each with a reason. A stale entry is an error.

Data fixes: qwen3.8-dflash2:27b is now listed under qwen3_8mtp_npu, which serves it.

Allow-listed:

  • MiniCPM-OCR-1.0-NPU2/conv.xclbin: no engine loads it (the OCR engine uses conv8.xclbin).
  • libaiebu.a and aiebu_static.lib: the AIE assembler, not engine libraries.

Wiring:

  • A new devkit-catalog output from changes.py selects devkit-static when any of these change: src/model_list.json, src/xclbins/, src/lib/, or the dev-kit JSON files. It starts no builds.
  • Releases keep running devkit-static. Only the PR summary step acts on its result, so it cannot block a release.

Replaced shipped kernels: a PR that only replaces src/xclbins/<folder>/<slot>.xclbin now rebuilds the artifact assigned to that slot, and the existing report-only comparison covers it.

  • It costs one devkit-xclbins run.
  • The NPU overlay and the benches stay off, since the dev-kit sources did not change.

Docs: flm-dev-kit/AGENTS.md now describes the dev-kit CI jobs (static, engines, xclbins, the overlay tests, the benches) and the catalog rules.

Tests: unit tests for each rule (pass and fail), aliases, served_elsewhere, the allow-list and stale entries, library mapping, the wiring, and the replaced-kernel plan. I also simulated four changes on a throwaway branch:

Simulated change Result
New family added only under src/ Fails with 12 errors naming the dev-kit files to add
Same, with the dev-kit sources and entries added Passes
Only model_list.json edited The check is selected and passes
Only Llama-3.1-8B-NPU2/layer.xclbin replaced One generic_decoding_layer rebuild, compared with the shipped file

Merge note: this PR and #1086 both edit the _doc line of engines.json. Whichever merges second needs a one-line conflict fix.

🤖 Generated with Claude Code

zaneni6 and others added 6 commits November 20, 2026 12:05
devkit_check.py checks src/model_list.json, src/xclbins and src/lib/{xrt,hrx}
against kernel_assignment.json and engines.json: every NPU (aie2p) model has
an assignment (or reuses another model's folder through xclbin_folder) and
an engine; every assignment is a catalog model or served_elsewhere; folders
agree; every assigned slot ships and every shipped kernel is assigned; every
prebuilt library is built by an engine or shared dir (Makefile TARGET and
CMakeLists add_library) and each such library ships .so/.dll/.lib for both
runtimes. CATALOG_ALLOW lists the exceptions with reasons; a stale entry is
an error.

engines.json: qwen3_8mtp_npu serves qwen3.8-dflash2:27b, which runs
Qwen3.8-27B-NPU2's kernels through the same engine.

Co-Authored-By: Claude <noreply@anthropic.com>
…kernels

changes.py: a new devkit_catalog output, true when src/model_list.json,
src/xclbins/, src/lib/ or the dev-kit JSON change (or the files are
unknown); devkit-static runs on it as on devkit, and nothing else starts.
A replaced src/xclbins/<folder>/<slot>.xclbin selects the xclbin area
without the overlay: devkit_xclbin_plan.py (mode changed) builds the
artifact kernel_assignment.json puts in that slot for every model using the
folder, so devkit_xclbin_compare.py reports it.

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
…g-assignment error

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

github-actions Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Security scan found no critical or high findings on lines changed by this pull request

View the security scan run for complete reports.

“New” means the finding is located in a changed file on an added or modified line; it is not a base-versus-head findings delta.

…sistency

# Conflicts:
#	flm-dev-kit/FLM_DLL/engines.json
@zaneni6
zaneni6 merged commit 80d6b28 into main Nov 20, 2026
87 of 92 checks 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