Skip to content

feat(core): move to ryzenai-corelib 0.33.1, run every corelib model behind one engine, prefer AMD Q4 GGUFs, rename rai to core - #774

Merged
tawei-amd merged 10 commits into
ROCm:mainfrom
chizamd:feature/dev01-update
Oct 16, 2026
Merged

tawei-amd merged 10 commits into
ROCm:mainfrom
chizamd:feature/dev01-update

Conversation

@chizamd

@chizamd chizamd commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Follow-up to #748. Moves the corelib backend from ryzenai-corelib 0.11 to 0.33.1, adds Qwen3.6-35B-A3B and Qwen3.5-4B, runs Gemma 4 at 16k and Qwen3.5 at 32k, has every corelib model (Phi-4, Qwen3, Qwen3.5, Qwen3.6, Gemma 4) run as corelib's own model behind one shared engine, makes flm pull prefer AMD's Q4 GGUFs with a public Q8_0 fallback, and renames the backend from rai to core.

Breaking rename (commit 6). The rai backend added in #748 becomes core, and the aie_next platform becomes dev04: tags move from *-rai:* to *-core:* (e.g. phi4-mini-it-rai:4b → phi4-mini-it-core:4b), FLM_ENABLE_RAI → FLM_ENABLE_CORE, the *-rai presets → *-core, FLM_RAI_* → FLM_CORE_*, home_install.sh --rai → --core, and --backend rai → --backend core. No old name is kept as an alias. ryzenai-corelib and RYZENAI_CORELIB_* name the external library and stay.

Commits:

  1. corelib 0.26, Qwen3.6, Gemma 4 at 16k on the existing per-op engines.
  2. One engine for corelib's models. Qwen3, Qwen3.5 and Gemma 4 stop driving corelib op by op and run as ryzenai_corelib_model_*, like Qwen3.6.
  3. corelib 0.28. Qwen3.5's KV cache is paged up to 32768, and a later turn's prefill chunks start on 4096-row page boundaries.
  4. corelib 0.29.2. No ABI change; corelib speeds up Gemma 4's per-layer-embedding projection and runs Qwen3.6's in-page prefill chunks on the NPU.
  5. corelib 0.29.4. No ABI change; corelib refuses a Qwen3.6 capacity past 131072, the most it has verified on the NPU, so Qwen3.6's limit drops from 262144 to 131072.
  6. Rename rai → core and aie_next → dev04, as above. Directories and files carrying either name move with them; no behaviour change.
  7. corelib 0.29.7. No ABI change. src/test/phi4_core's version-pin probe can fail again (it used to pass by failing on a missing include path).
  8. flm pull prefers AMD Q4 GGUFs for the core models and falls back to the public Q8_0 source. Adds qwen3.5-core:4b.
  9. Phi-4 on corelib's phi4mini model, Q8_0 or Q4_G128; the last per-op engine is removed. Also fixes the token history keeping an EOS the engine never ran.
  10. corelib 0.33.1. model_forward, forward_options and create_stream change shape.

Models

Every tag below runs as a corelib model through the shared engine.

Tag GGUF (preferred → fallback) Context Change
qwen3.6-moe-core:35b-a3b unsloth Q8_0 default 4096, up to 131072 New. Qwen3.6-35B-A3B, text only
gemma4-it-core:e2b gemma4-it-core:e4b AMD Q4_G32 → unsloth Q8_0 default and max 16384 Was 4096; E4B is offered again
qwen3-core:0.6b unsloth Q8_0 4096 Moved off the per-op engine
qwen3-core:1.7b 4b 8b AMD Q4_G128 → unsloth Q8_0 4096 Moved off the per-op engine
qwen3.5-core:9b AMD Q4_G128 → unsloth Q8_0 default 4096, up to 32768 Moved off the per-op engine; was capped at 4096
qwen3.5-core:4b AMD Q4_G128 → unsloth Q8_0 default 4096, up to 32768 New. A bare qwen3.5-core now resolves to 4b
phi4-mini-it-core:4b AMD Q4_G128 → unsloth Q8_0 4096 Moved off the per-op engine; reads Q8_0 or Q4_G128

What changes

corelib 0.33.1 (version pinned exactly)

  • 0.26: create_tensor_window takes strides, linear_attention_bf16 takes rows, and models are built with model_weights_create_path + model_create(name, weights, options).
  • 0.30: create_stream takes a priority list of PDIs per phase. OpenModelStream, which nothing calls any more, passes its two PDIs as one-element lists.
  • 0.31 / 0.33: model_forward takes images, options, out_token and the logits as arguments, and forward_options gains a leading size that corelib refuses when short. CorelibModel sets size and passes its logits buffer only when it wants logits.
  • 0.28, 0.29.x and the rest of 0.30–0.33 add nothing FastFlowLM has to meet. 0.31–0.33 add Qwen3.6 image input, which FastFlowLM does not pass.
  • docs/core-setup-linux.md: RYZENAI_CORELIB_FALLBACK_PROFILE is now RYZENAI_CORELIB_REPORT_FALLBACKS, and RYZENAI_CORELIB_TRACE_XRT is now RYZENAI_CORELIB_TRACE=xrt.

Packaging

  • corelib installs ryzenai_corelib plus one ryzenai_corelib_model_<name> library per model and loads them only from its own directory. A Windows core build copies them beside flm.exe; home_install.sh copies them beside corelib on Linux.
  • RYZENAI_CORELIB_DD_ROOT / RYZENAI_CORELIB_KERNELS_ROOT are no longer needed, and the installer stops staging DynamicDispatch.

One engine: flm::core::CorelibModel (include/core/corelib_model.hpp, common/core/corelib_model.cpp)

  • A causal_lm over a corelib model. Each model is a short ModelSpec naming what differs:
    • Continuation: where a multi-row pass may start past position 0 — anywhere (Qwen3.5, Qwen3.6), only at 0 (Qwen3 and Phi-4, so a later prompt re-runs the conversation), or at 0 / a 4096-row page boundary (Gemma 4).
    • Rewind: kSeek for attention-only models (every pass states its position; rewind just moves it), kSnapshot for Qwen3.6 (model_state_save/restore, reused only if its history is a prefix of the current one), kReplay for Qwen3.5 (reset and replay).
  • Token ids and the context limit are checked before corelib is called. A failed forward, restore or reset poisons the engine.
  • Logits are fetched only for the row that gets sampled.

One backend: flm::core::Factory(BackendSpec) (include/core/corelib_model_backend.hpp)

  • Refuses preemption and a context outside the model's rule, reads the package's BOS/EOS ids (tokenizer_config.json + config.json, e.g. Gemma 4 → {1, 106}; Phi-4 adds <|end|>, which the package does not name), and resolves the GGUF the catalog points at before the runtime or weights are touched. Image requests on core return HTTP 400.

Preferred AMD sources in flm pull (model_list.hpp, pull/)

  • A catalog entry may carry preferred_source, a JSON merge patch over the entry that sets its own url, files, size, quantization level and model_info_key. Each AMD source is pinned to a commit, and its GGUF to a sha256 in model_info.json (keyed <tag>@amd); the tokenizer and config files keep their existing pinned sources.
  • flm pull sends a HEAD request for the preferred GGUF and uses it on 2xx/3xx; otherwise it prints Falling back to: <url> and pulls the entry's own source. Files already on disk are kept without probing.
  • Outside a pull, an entry resolves to its preferred source exactly when every file only that source has is on disk, so run, serve, list and check follow whatever was pulled.
  • The AMD repos currently need a Hugging Face token (HF_TOKEN, HUGGING_FACE_HUB_TOKEN, HF_TOKEN_PATH, HF_HOME/token or ~/.cache/huggingface/token). It is sent only for a "use_hf_token": true source, only to https://huggingface.co/, with TLS verification on; public sources never get it. Without access, a pull falls back to the public Q8_0.

Page-aligned prefill chunks (AutoModel::_chunked_insert, model_backend.hpp)

  • New ModelBackend::aligns_prefill_chunks(), default false, so FastFlowLM's own engines are unaffected. The corelib-model backend returns true: a later turn's prompt is chunked on multiples of 4096 counted from position 0 instead of from the turn's start, so every chunk after the first starts on a page boundary and corelib runs it as whole pages on the NPU. Prompts carrying a multimodal payload keep the old chunking.

EOS in the token history (AutoModel::_shared_generate)

  • An EOS the engine never ran (sampled straight from the prefill, or ending a decode on a backend that declines the post-EOS forward, which every core backend does) is no longer appended to the token history. Before, the next turn's prefix match treated it as already held, so the engine never saw the end-of-turn token between the reply and the next user message. It is now prefilled with the next turn. A frontend test covers both cases on core and the unchanged behaviour on FastFlowLM's own engines.

Removed

  • Every per-op engine (Phi-4, Qwen3, Qwen3.5, Gemma 4) with its GGUF reader, shape plan, host math and packed-weight cache; rai/gguf_file, rai/weight_cache, core/kernel_grid.hpp, core/weight_source.hpp, the Q8/RMSNorm parts of the host ops, and the corelib entry points nothing calls.
  • No core model has a packed-weight cache any more: corelib packs weights on every load. Old *.rai-weights.bin/.json and phi4-*-weights.* files can be deleted.

Shared

  • Sampler::sampler_topk_apply selects top-k with a k-entry heap in one pass instead of partial_sorting a vocab-sized array each token. Same ranking and lowest-id tie rule; checked against the old code on 63 inputs (vocab 1..248320, k = 1/2/20/40, heavy ties).

Docs: src/common/models/README.md gains a section on models corelib runs whole; docs/core-setup-linux.md and the model pages cover the version, the AMD and public sources, and the dropped weight cache.

Results

All on a dev04 NPU, Windows.

Unit tests (fake corelib, 0.33.1 headers): core_model, phi4_core, gemma4_core and model_backend pass; test_model_downloader includes offline file:// tests for the preferred-source logic. test_real_corelib against the 0.33.1 library loads it, matches the version and resolves every entry point. flm.exe builds with FLM_ENABLE_CORE=ON against 0.33.1.

Shared engine vs the per-op engines (measured at commit 4, corelib 0.29.2) — "before" is the first commit's build on corelib 0.26: the per-op engines for Phi-4, Qwen3, Qwen3.5 and Gemma 4, and Qwen3.6 on corelib's model API. Both builds run interleaved, Gemma 4 twice each, with the NPU checked idle before and after every run. Long-prompt TTFT is the median of three ~1.1k-token prompts; decode is the median over three short prompts, 64 greedy tokens each.

Model Load, this PR vs before Long-prompt TTFT, this PR vs before Decode tok/s, this PR vs before Greedy text
gemma4-it-core:e2b 8.1–11.4 s vs 3.3–4.2 s 0.64–0.68 vs 0.80–0.82 s 34.2–36.2 vs 37.1–38.0 1 of 3 prompts differs (known near-tie token)
gemma4-it-core:e4b 11.2–16.4 s vs 3.4–3.6 s 1.02–1.06 vs 1.33–1.35 s 23.5–23.9 vs 23.6–24.2 identical
qwen3.6-moe-core:35b-a3b 83.2 vs 84.4 s 1.45 vs 14.18 s 19.1 vs 20.4 identical
qwen3.5-core:9b 22.5 vs 25.1 s 42.7 vs 49.3 s 19.0 vs 19.3 identical
qwen3-core:0.6b 3.2 vs 1.8 s 0.24 vs 0.25 s 116.4 vs 121.8 identical

Loads are slower because corelib packs the weights on every load and this path has no packed-weight cache.

Phi-4 on corelib's phi4mini vs its per-op engine (commit 9, corelib 0.29.7):

Run Load ~1.1k-token TTFT Decode tok/s Passkey at ~3k tokens
per-op, Q8_0, cache cold / warm 61.7 s / 2.0 s 0.61 s 40.8 / 44.4 correct
phi4mini, Q8_0 6.4–7.6 s 0.59–0.60 s 39.0–42.6 correct
phi4mini, AMD Q4_G128 2.0–2.6 s 0.60–0.61 s 39.8–42.6 correct

Q8_0 gives the same greedy text on both engines. A second turn, which the per-op engine refused (Phi-4 prefill must start at logical position zero), now works, and a two-turn passkey is recalled on Q8_0 and Q4_G128.

corelib 0.33.1 vs 0.29.7, and 0.29.7 vs 0.29.4 (each pair run interleaved): greedy text and TTFTs match on every model, Phi-4 on both its Q8_0 and Q4_G128 files. Decode and load differences followed run order rather than the build: rerun with the order swapped, the two builds match.

Two-turn continuation at --ctx-len 16384: turn 1 is ~6.8k tokens carrying a passkey; turn 2 resends it with the reply and adds ~6.9k tokens, chunked on page boundaries (1395 / 4096 / 1414).

Model Turn 1 TTFT Turn 2 TTFT Passkey
qwen3.6-moe-core:35b-a3b 6.4 s 7.5 s (14.3 s on corelib 0.28) correct
gemma4-it-core:e2b 6.7 s 17.5 s correct

The same chunks and TTFTs within 0.1 s on 0.29.7 and 0.33.1.

Qwen3.6 at --ctx-len 131072 (corelib 0.29.4, 0.29.7 and 0.33.1): turn 1 is 49,917 tokens with a passkey, turn 2 ends at 75,442 tokens; every build recalls the passkey with the same seven turn-2 chunks, turn-2 TTFT 60–65 s.

Measured on the second commit (corelib 0.26):

  • Switching e2b → qwen3 → qwen3.5 → e4b → phi4 → e2b in one flm serve process: every answer matches a fresh run, no errors.
  • Gemma 4 E2B at 16k: passkey recalled; a short prompt after a full paged cache matches a fresh run.

Long-context passkey recall (passkey at 45% depth, measured on the first commit):

Tag Context Prompt tokens Prefill Decode tok/s Answer
gemma4-it-core:e2b 16384 11,329 13.5 s (838 tok/s) 28.9 correct
gemma4-it-core:e4b 16384 11,329 13.4 s — correct
qwen3.6-moe-core:35b-a3b 32768 23,714 932 s (25 tok/s) 19.7 correct

Gemma 4 on corelib's built-in model. On corelib 0.26 it was slower than the per-op engine (prefill ~1.5–2×, decode 24–29% slower), because of corelib's host per-layer-embedding projection. corelib 0.29 fixes that projection: prefill is now faster than the per-op engine, and decode is equal on E4B and ~5–8% lower on E2B. Loads stay slower, as above.

Not done yet

  • Rebuild and rerun the unit tests on top of current main (merge was clean; the merged tree has not been built)
  • Linux build of flm_core and the home_install.sh --core smoke test
  • Qwen3.5 at 32k end to end
  • On-NPU runs of the AMD Q4 GGUFs other than Phi-4's

@chizamd chizamd changed the title feat(rai): move to ryzenai-corelib 0.26, add Qwen3.6-35B-A3B, run Gemma 4 at 16k feat(rai): move to ryzenai-corelib 0.29.2, add Qwen3.6-35B-A3B, run corelib's models behind one engine Oct 12, 2026
@chizamd
chizamd force-pushed the feature/dev01-update branch from 047076b to bb5fcc2 Compare October 14, 2026 10:38
@chizamd chizamd changed the title feat(rai): move to ryzenai-corelib 0.29.2, add Qwen3.6-35B-A3B, run corelib's models behind one engine feat(core): move to ryzenai-corelib 0.29.7, add Qwen3.6-35B-A3B, run corelib's models behind one engine, rename rai to core Oct 14, 2026
@chizamd
chizamd marked this pull request as ready for review October 14, 2026 11:12
@chizamd
chizamd force-pushed the feature/dev01-update branch from bb5fcc2 to b7d3829 Compare October 16, 2026 04:11
chizamd and others added 10 commits October 15, 2026 21:14
…ma 4 at 16k

Moves the `--rai` backend from ryzenai-corelib 0.11 to 0.26 and builds on
what the new corelib offers.

corelib 0.26 (pinned exactly):
- Follow the ABI changes: `create_tensor_window` takes strides,
  `linear_attention_bf16` takes rows, and models are built with
  `model_weights_create_path` + `model_create`.
- A 3-D matmul output that writes the KV cache is a strided window
  `[max_seq*head, head, 1]` (Phi-4, Qwen3, Qwen3.5 V writes; Gemma 4 E4B
  staging window).
- Per-op engines open their stream through `corelib::OpenModelStream`,
  which enables the model's kernel bundle before any kernel query.
- corelib's per-model libraries are copied beside `flm.exe` on Windows
  and beside corelib by `home_install.sh` on Linux. Nothing needs
  `RYZENAI_CORELIB_DD_ROOT` or `RYZENAI_CORELIB_KERNELS_ROOT` any more.

Qwen3.6-35B-A3B (new `qwen3.6-moe-rai:35b-a3b`, text only):
- Runs on corelib's model API; context up to 262144 in 4096-row pages,
  a prompt is a single `model_forward`, and checkpoint/restore use
  corelib state snapshots.
- Fetch logits only for the row that gets sampled.

Gemma 4:
- Context of 1..4096 on flat attention, or a multiple of 4096 up to 16384
  on corelib paged attention; the aie_next catalog entries default to
  16384. A paged continuation starts from its own page.
- `gemma4-it-rai:e4b` is offered again.

Shared:
- `Sampler::sampler_topk_apply` selects top-k with a k-entry heap in one
  pass (same ranking and tie rule).

Tests: new `src/test/qwen36_rai`, and the Gemma 4, Phi-4 and Qwen3 rai
tests and fake corelib follow the 0.26 ABI and the 16k paged context.

Co-authored-by: Cursor <cursoragent@cursor.com>
Qwen3, Qwen3.5 and Gemma 4 on the `rai` backend stop driving corelib op
by op and run as corelib's own models (`ryzenai_corelib_model_*`), the
way Qwen3.6 already does. All four share one engine and one backend; each
model is a short spec. Phi-4 is unchanged (corelib's `phi4mini` takes
ONNX only, and FastFlowLM ships a GGUF).

- `flm::rai::CorelibModel` (`rai/corelib_model`): a `causal_lm` over a
  corelib model, generalized from the Qwen3.6 engine. `ModelSpec` states
  where a multi-row pass may start (`Continuation`: anywhere, only at 0,
  or at 0 / a 4096-row page boundary) and how to rewind (`Rewind`: seek,
  state snapshot, or reset and replay). Token ids and the context limit
  are checked before corelib is called; a failed forward, restore or
  reset poisons the engine.
- `flm::rai::Factory(BackendSpec)` (`rai/corelib_model_backend`): refuses
  preemption and a context outside the model's rule, reads the package's
  BOS/EOS ids, and resolves the GGUF before the runtime or weights are
  touched.
- Removed: the per-op engines, GGUF readers, shape plans and host math of
  Qwen3, Qwen3.5 and Gemma 4; `rai/gguf_file`, `rai/weight_cache`, the
  Q8/RMSNorm parts of `rai/host_ops`, and 14 unused corelib entry points.
  corelib packs the weights on every load; old
  `<gguf stem>.rai-weights.bin/.json` files can be deleted.
- Tests: new `src/test/rai_model` (engine and backend against the fake
  corelib; the Qwen3.6 tests move here). Gemma 4's registry, catalog and
  server-gate tests move to `test_gemma4_registry.cpp`; the op-level
  Gemma 4 and Qwen3 suites are gone.

Gemma 4 is slower on corelib 0.26's built-in model than on the per-op
engine (prefill ~1.5-2x, decode 24-29% slower, slower loads). The cause
is in corelib's host per-layer-embedding projection and serial weight
packing; FastFlowLM picks up the fix with a corelib version bump.

Co-authored-by: Cursor <cursoragent@cursor.com>
…efill chunks to pages

corelib 0.28 pages Qwen3.5's KV cache up to 32768 and runs Qwen3.6's prefill past page 0 in whole-page passes. A later turn's prompt is now chunked on multiples of 4096 counted from position 0, so its chunks start on page boundaries.

Co-authored-by: Cursor <cursoragent@cursor.com>
No ABI change FastFlowLM meets. 0.29 speeds up Gemma 4's per-layer-embedding projection and runs Qwen3.6's prefill chunks inside a page on the NPU.

Co-authored-by: Cursor <cursoragent@cursor.com>
No ABI change. corelib now refuses a Qwen3.6 capacity past 131072 at model_create, the most it has verified on the NPU, so kRaiContextLimit drops from 262144 to 131072 and qwen.md's memory figures follow. Qwen3.5 and 3.6 refusing an explicit position other than 0 or their own does not reach FastFlowLM, which passes POSITION_CONTINUE to both and resets before a replay; nor does a model that refuses to continue after a failed forward, since the engine is poisoned there.

Co-authored-by: Cursor <cursoragent@cursor.com>
The backend id, the "-rai" tag suffix, the FLM_ENABLE_RAI option, the
presets, the FLM_RAI_* environment variables and home_install.sh's --rai flag
all move to "core"; the platform id and enum value move to "dev04". The
directories and files carrying either name move with them. No old name is
kept as an alias.

ryzenai-corelib and RYZENAI_CORELIB_* name the external library and stay.
llama3_results.md's "NPU (RAI)" is the Ryzen AI software baseline, not this
backend, and stays.

Co-authored-by: Cursor <cursoragent@cursor.com>
No ABI change: corelib.def is untouched and corelib.h only changes its
version and comments. The version pin and the four docs that name it move
to 0.29.7. 0.29.5 to 0.29.7 let Gemma 4 and Qwen3.6 also read Q4_G32
GGUFs; the unsloth Q8_0 files model_list.json names give the same logits
as on 0.29.4.

src/test/phi4_core's version-pin probe can fail again. Its include paths
went through CMAKE_CXX_FLAGS, which try_compile does not pass on, so the
probe failed on the missing header and that passed as a rejection; and it
only rewrote a patch version of 0. It now passes INCLUDE_DIRECTORIES,
compiles only, must first compile against the real header, and must then
fail on the pin's own #error against a header rewritten to patch 9999.

Co-authored-by: Cursor <cursoragent@cursor.com>
…ic Q8_0

`flm pull` tries the AMD Q4 GGUFs first for the core (dev04) models and
falls back to the existing public Q8_0 source when the AMD repo can't be
reached.

- phi4-mini-it-core:4b: amd/Phi-4-mini-instruct-Q4_G128-GGUF
- qwen3-core:1.7b / 4b / 8b: amd/Qwen3-*-Q4_G128-GGUF
- qwen3.5-core:4b (new, falls back to unsloth/Qwen3.5-4B-GGUF Q8_0) and
  qwen3.5-core:9b: amd/Qwen3.5-*-Q4_G128-GGUF
- gemma4-it-core:e2b / e4b: amd/gemma-4-E*-it-Q4_G32-GGUF

Each AMD source is pinned to a commit, and its GGUF to a sha256 in
model_info.json (keyed `<tag>@amd`). Only the GGUF comes from AMD; the
tokenizer and config files keep their pinned file_sources.

- Catalog: an entry may carry `preferred_source`, a JSON merge patch over
  the entry that sets its own url, files, size, quantization level and
  model_info_key.
- Pull: ModelDownloader::choose_pull_source sends a HEAD request for the
  preferred GGUF and uses the AMD source on 2xx/3xx; otherwise it prints
  `Falling back to: <url>` and uses the entry's own source. AMD files
  already on disk are kept without probing.
- Outside a pull: model_list::get_model_info resolves an entry to its
  preferred source exactly when every file only that source has is on
  disk, so run, serve, list and check follow whatever was pulled.
- Auth: the AMD repos currently need a Hugging Face token, read from
  HF_TOKEN, HUGGING_FACE_HUB_TOKEN, HF_TOKEN_PATH, HF_HOME/token or
  ~/.cache/huggingface/token. It is sent only for a `"use_hf_token": true`
  source, only to https://huggingface.co/, with TLS verification on.
  Public sources never get it, because the Hub answers 401 to an expired
  token even on a public repo.

A bare `qwen3.5-core` now resolves to 4b, the first key in sorted order.
Footprints for the AMD sources are scaled from each base entry by file
size, not measured. test_model_downloader gains offline file:// tests for
resolving by what is on disk, keeping a pulled preferred source, and
falling back when it is unreachable.
…4_G128

phi4-mini-it-core:4b now runs on corelib's own phi4mini model through the
shared core backend, like Qwen3, Qwen3.5, Qwen3.6 and Gemma 4. corelib's
phi4mini reads a phi3 GGUF in Q8_0 or Q4_G128, so the AMD Q4_G128 GGUF
that `flm pull` prefers now loads and runs; the per-op engine it replaces
took only Q8_0, under a fixed filename.

- phi4_core_backend.cpp is a spec for core::Factory: corelib model
  phi4mini, context 4096, multi-row passes only from position 0 (a later
  turn re-runs the conversation, as before), Rewind::kSeek, and stop
  tokens {200020, 199999} (`<|end|>` and `<|endoftext|>`; the package
  names only the second). The GGUF is the one the catalog resolves to.
- Removed: the per-op engine (its GGUF reader and contract check, host
  ops, shape plan and packed-weight cache), its tests, and
  core/kernel_grid.hpp and core/weight_source.hpp, which only it used.
- Added test/core_model/test_phi4_core_backend.cpp, which runs the real
  factory against the fake corelib.
- Docs: phi.md covers the AMD and unsloth sources and the absence of a
  weight cache; qwen.md lists Phi-4 among the models corelib runs whole;
  the contributor guide points to the last per-op engine in history.

fix(automodel): keep an EOS the engine never ran out of the token history

_shared_generate appended every sampled token to token_history, including
an EOS the engine never ran: one sampled straight from the prefill, and,
on a backend that declines the post-EOS forward (every core backend), the
EOS that ends a decode. The next turn's prefix match then treated it as
already held, so the engine never saw the end-of-turn token between the
reply and the next user message. That token is now left out of the
history and prefilled with the next turn. A new frontend test covers both
cases on core and the unchanged flm behaviour.
- The version pin moves to 0.33.1 (include/core/corelib_api.hpp), and the
  four docs that name it.
- model_forward takes images, options, out_token and the logits as
  arguments (corelib 0.31.0), and forward_options gains a leading `size`
  that corelib refuses when short (0.33.0). CorelibModel, which now runs
  every core model, sets `size` and passes its logits buffer only when it
  wants logits.
- create_stream takes a priority list of PDIs per phase (0.30.0).
  OpenModelStream, which nothing calls any more but which stays in the
  header, passes its two PDIs as one-element lists.
- The fake corelib follows both signatures, records a stream's PDI lists,
  and refuses short forward options as corelib does.
- core-setup-linux.md: RYZENAI_CORELIB_FALLBACK_PROFILE is now
  RYZENAI_CORELIB_REPORT_FALLBACKS, and RYZENAI_CORELIB_TRACE_XRT is gone
  in favour of RYZENAI_CORELIB_TRACE=xrt.

Every other function and struct FastFlowLM binds is unchanged, and
corelib.def only adds exports. corelib 0.31-0.33 also add Qwen3.6 image
input and rope_positions, which FastFlowLM does not pass (it runs Qwen3.6
text only; corelib reports text-only logits unchanged).
@chizamd
chizamd force-pushed the feature/dev01-update branch from b7d3829 to bb91d58 Compare October 16, 2026 04:15
@chizamd chizamd changed the title feat(core): move to ryzenai-corelib 0.29.7, add Qwen3.6-35B-A3B, run corelib's models behind one engine, rename rai to core feat(core): move to ryzenai-corelib 0.33.1, run every corelib model behind one engine, prefer AMD Q4 GGUFs, rename rai to core Oct 16, 2026
@tawei-amd
tawei-amd merged commit f032102 into ROCm:main Oct 16, 2026
26 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.

3 participants