Repository navigation
fix(cli): rebuild mlxcel list from the ModelType registry - #27
Conversation
Add a compile-time-enforced metadata table on `ModelType` so the registry becomes the single source of truth for user-facing surfaces like `mlxcel list` (issue #26). Three additions: - `ModelType::metadata(self) -> (&'static str, &'static str)` returning `(display_name, family)` via an exhaustive `match`. Adding a new variant without filling both fields is now a build error. - Convenience accessors `ModelType::display_name()` and `ModelType::family()` that defer to `metadata()` so callers do not need to destructure. - `pub const ALL_MODEL_TYPES: &[ModelType]` listing every variant in declaration order. This is the iteration source for `mlxcel list` and any future enumeration consumer. Family labels intentionally use sibling-family naming for VLMs (e.g. `"Qwen VLM"` alongside `"Qwen"`, `"Gemma VLM"` alongside `"Gemma"`) so the rendered list reads as parent-then-vision rather than collapsing every multimodal stack into a single bucket. Vision-language stacks that do not map cleanly to a single text-family parent (LLaVA, Molmo, Moondream, MiniCPM-O, Youtu) are grouped under `"Other VLM"`. Three unit tests under `metadata_tests` enforce drift safety: `all_model_types_covers_every_variant` (count floor + non-empty metadata walk), `metadata_round_trip_is_consistent` (display_name/family vs metadata tuple), and `all_model_types_has_no_duplicates`.
Replace the 40-line hand-written block in `print_supported_models()` with a renderer that walks `ALL_MODEL_TYPES` and groups variants by `ModelType::family()`. This eliminates four bugs in one pass: - Header now reads `Supported Model Architectures (92):` instead of the stale `"57+"`; the count is derived from `ALL_MODEL_TYPES.len()` at runtime. - Every registered ModelType is rendered. The old block omitted the entire VLM surface (~25 variants: Qwen2-VL, Qwen3-VL, Qwen3.5 VLM, LLaVA, Pixtral/Mistral3 VLM, Phi-4 MM, Gemma3 VLM, Molmo2, Moondream3, MiniCPM-O, Youtu-VL, Nemotron-H Nano Omni, etc.) and several text/hybrid families (Qwen3.5, MiniMax, Step3p5, KimiLinear, LongcatFlash, Mistral4, Glm4MoeLite, GlmMoeDsa, HunyuanMoe, SolarOpen). - The misleading "Llama family: Yi, TinyLlama, Vicuna" line is gone. Those names were HuggingFace compat tags resolved into `ModelType::Llama` by detection, not separate engines; presenting them next to `Llama 4` implied otherwise. - The trailing `For the full list, see: docs/model_implementations.md` line is removed. That file does not exist anywhere in the released artifact, so the pointer was dead. The new output is exhaustive, so no external pointer is needed. `print_supported_models()` is split into a thin `print!` wrapper plus `write_supported_models<W: fmt::Write>` so tests can capture the exact bytes the CLI would emit without spawning a subprocess. A `const FAMILY_ORDER: &[&str]` table controls section order; unknown families are appended alphabetically as a safety net (and flagged by `family_order_is_exhaustive`). Five unit tests in `main_tests.rs` lock the new contract: `supported_models_output_mentions_every_display_name`, `supported_models_header_uses_actual_count`, `supported_models_output_has_no_dead_doc_link`, `family_order_is_exhaustive`, and `family_order_has_no_orphans`. Combined with the three `metadata_tests` already added in the previous commit, the registry, the renderer, and the section-order table are all kept honest by CI. `mlxcel-server` (src/bin/mlx_server.rs) has no `list` subcommand — only `Download` — so no equivalent change is needed there.
Implementation Review SummaryIntentReplace the hand-written Verification
Cross-checks performed
FindingsNone at any severity. The implementation matches the issue's acceptance criteria precisely and the FAMILY_ORDER policy (silent graceful render at runtime + hard CI failure at test time) is correctly enforced by VerdictAPPROVE. |
Security + performance review (auto)Scope: changed files only ( Verification ran
Threat surface
FindingsNone at CRITICAL / HIGH / MEDIUM / LOW. No fixes delegated. Notable (informational only, not findings)
VerdictAPPROVE — no security or performance findings. Implementation lines up cleanly with the threat-surface assessment in the orchestrator brief. |
PR Finalization CompleteSummary
New commit
All checks passing. Ready for merge. |
Post-merge review and validationStatePR #27 was already merged when this review started, so there was no open PR branch to update with additional commits. I reviewed the merged Correctness review
Security reviewNo security findings. The changed runtime path only formats static metadata into stdout. It adds no new filesystem, network, subprocess, environment, credential, deserialization, or authorization surface, and no new Performance reviewNo performance findings. The renderer buckets 92 variants across 28 families in a one-shot CLI command; the small linear scan is negligible, deterministic, and avoids heavier map setup overhead for this output path. Validation run
Non-PR-scope noteA full VerdictPR #27 satisfies issue #26's intent and has no PR-scope correctness, security, or performance findings. No follow-up commit was pushed because the PR was already merged and no PR-scope fix was needed. |
This release focuses on Apple Silicon decode performance for VLM and linear-attention model families, plus a CLI fix for `mlxcel list`. Performance: - Gemma3n bf16 prefill path: gemma3n-e4b-bf16 decode 11.16 to 38.81 tok/s on M5 Max (#28). - Qwen3-VL text-only decode: QKV fusion + `forward_text_only` fast path. Qwen3-VL-30B-A3B-Instruct-4bit decode 56.00 to 146.29 tok/s (2.61x, 99% of mlx-lm parity); Qwen3-VL-32B-Instruct-4bit decode 18.79 to 27.33 tok/s (1.45x, 94% parity); image-in-prompt and DeepStack paths unchanged (#29). - GatedDeltaNet fast RMSNorm in Qwen3.5 / Qwen3-Next / KimiLinear: `mlx::fast::rms_norm` replaces the expanded square / mean / sqrt / divide graph for Q/K and gated output. qwen3.5-0.8b-4bit decode 425.16 to 535.43 tok/s on M5 Max (+25.9%, 96% parity); Qwen3.5 speculative-decoding verify pass updated alongside prefill / decode to preserve draft / verify dtype agreement (#30). Fixed: - Rewrite `mlxcel list` output to drive from the `ModelType` registry: fixes stale count, missing VLM family, missing ~30 model types, and removes a broken docs link (#27). Docs: - Refresh README performance snapshot and `docs/benchmarks.md` to match the latest M5 Max sweep.
* feat(models): add exhaustive ModelType metadata + ALL_MODEL_TYPES Add a compile-time-enforced metadata table on `ModelType` so the registry becomes the single source of truth for user-facing surfaces like `mlxcel list` (issue lablup#26). Three additions: - `ModelType::metadata(self) -> (&'static str, &'static str)` returning `(display_name, family)` via an exhaustive `match`. Adding a new variant without filling both fields is now a build error. - Convenience accessors `ModelType::display_name()` and `ModelType::family()` that defer to `metadata()` so callers do not need to destructure. - `pub const ALL_MODEL_TYPES: &[ModelType]` listing every variant in declaration order. This is the iteration source for `mlxcel list` and any future enumeration consumer. Family labels intentionally use sibling-family naming for VLMs (e.g. `"Qwen VLM"` alongside `"Qwen"`, `"Gemma VLM"` alongside `"Gemma"`) so the rendered list reads as parent-then-vision rather than collapsing every multimodal stack into a single bucket. Vision-language stacks that do not map cleanly to a single text-family parent (LLaVA, Molmo, Moondream, MiniCPM-O, Youtu) are grouped under `"Other VLM"`. Three unit tests under `metadata_tests` enforce drift safety: `all_model_types_covers_every_variant` (count floor + non-empty metadata walk), `metadata_round_trip_is_consistent` (display_name/family vs metadata tuple), and `all_model_types_has_no_duplicates`. * fix(cli): drive `mlxcel list` from ALL_MODEL_TYPES (closes lablup#26) Replace the 40-line hand-written block in `print_supported_models()` with a renderer that walks `ALL_MODEL_TYPES` and groups variants by `ModelType::family()`. This eliminates four bugs in one pass: - Header now reads `Supported Model Architectures (92):` instead of the stale `"57+"`; the count is derived from `ALL_MODEL_TYPES.len()` at runtime. - Every registered ModelType is rendered. The old block omitted the entire VLM surface (~25 variants: Qwen2-VL, Qwen3-VL, Qwen3.5 VLM, LLaVA, Pixtral/Mistral3 VLM, Phi-4 MM, Gemma3 VLM, Molmo2, Moondream3, MiniCPM-O, Youtu-VL, Nemotron-H Nano Omni, etc.) and several text/hybrid families (Qwen3.5, MiniMax, Step3p5, KimiLinear, LongcatFlash, Mistral4, Glm4MoeLite, GlmMoeDsa, HunyuanMoe, SolarOpen). - The misleading "Llama family: Yi, TinyLlama, Vicuna" line is gone. Those names were HuggingFace compat tags resolved into `ModelType::Llama` by detection, not separate engines; presenting them next to `Llama 4` implied otherwise. - The trailing `For the full list, see: docs/model_implementations.md` line is removed. That file does not exist anywhere in the released artifact, so the pointer was dead. The new output is exhaustive, so no external pointer is needed. `print_supported_models()` is split into a thin `print!` wrapper plus `write_supported_models<W: fmt::Write>` so tests can capture the exact bytes the CLI would emit without spawning a subprocess. A `const FAMILY_ORDER: &[&str]` table controls section order; unknown families are appended alphabetically as a safety net (and flagged by `family_order_is_exhaustive`). Five unit tests in `main_tests.rs` lock the new contract: `supported_models_output_mentions_every_display_name`, `supported_models_header_uses_actual_count`, `supported_models_output_has_no_dead_doc_link`, `family_order_is_exhaustive`, and `family_order_has_no_orphans`. Combined with the three `metadata_tests` already added in the previous commit, the registry, the renderer, and the section-order table are all kept honest by CI. `mlxcel-server` (src/bin/mlx_server.rs) has no `list` subcommand — only `Download` — so no equivalent change is needed there. * docs(changelog): add Unreleased entry for lablup#26 list registry rewrite
This release focuses on Apple Silicon decode performance for VLM and linear-attention model families, plus a CLI fix for `mlxcel list`. Performance: - Gemma3n bf16 prefill path: gemma3n-e4b-bf16 decode 11.16 to 38.81 tok/s on M5 Max (lablup#28). - Qwen3-VL text-only decode: QKV fusion + `forward_text_only` fast path. Qwen3-VL-30B-A3B-Instruct-4bit decode 56.00 to 146.29 tok/s (2.61x, 99% of mlx-lm parity); Qwen3-VL-32B-Instruct-4bit decode 18.79 to 27.33 tok/s (1.45x, 94% parity); image-in-prompt and DeepStack paths unchanged (lablup#29). - GatedDeltaNet fast RMSNorm in Qwen3.5 / Qwen3-Next / KimiLinear: `mlx::fast::rms_norm` replaces the expanded square / mean / sqrt / divide graph for Q/K and gated output. qwen3.5-0.8b-4bit decode 425.16 to 535.43 tok/s on M5 Max (+25.9%, 96% parity); Qwen3.5 speculative-decoding verify pass updated alongside prefill / decode to preserve draft / verify dtype agreement (lablup#30). Fixed: - Rewrite `mlxcel list` output to drive from the `ModelType` registry: fixes stale count, missing VLM family, missing ~30 model types, and removes a broken docs link (lablup#27). Docs: - Refresh README performance snapshot and `docs/benchmarks.md` to match the latest M5 Max sweep.
Summary
mlxcel listwas a 40-line hand-written block that had drifted badly from theModelTyperegistry: the header advertised "57+" while the enum holds 92 variants, the entire VLM surface was missing, ~10 text/hybrid families were unlisted, the "Llama family" line falsely promoted HF compat tags (Yi,TinyLlama,Vicuna) to first-class engines, and the trailing pointer atdocs/model_implementations.mdreferenced a file that does not exist in any released artifact.This PR makes the
ModelTypeenum the single source of truth and drives the CLI output from it. Adding a newModelTypevariant in the future is now a build error until the variant is wired into bothModelType::metadata()(exhaustivematch) andALL_MODEL_TYPES(compile-time slice + runtime test).What changed
src/models/mod.rspub const ALL_MODEL_TYPES: &[ModelType]listing every variant in declaration order (92 entries; verified againstsrc/model_metadata.rs).ModelType::metadata(self) -> (&'static str, &'static str), aconst fnwhose exhaustivematchprovides a(display_name, family)tuple per variant. Adding a future variant without metadata is now a compile error.ModelType::display_name()andModelType::family().metadata_tests:all_model_types_covers_every_variant,metadata_round_trip_is_consistent,all_model_types_has_no_duplicates.src/main.rsprint_supported_models()rewritten into a thinprint!wrapper plus a testablewrite_supported_models<W: fmt::Write>writer.const FAMILY_ORDER: &[&str]controls section ordering deterministically; unfamiliar families are appended alphabetically as a safety net.ALL_MODEL_TYPES.len()(currently 92) instead of the stale"57+".docs/model_implementations.mdreference removed — the new output is exhaustive.src/main_tests.rssupported_models_output_mentions_every_display_name,supported_models_header_uses_actual_count,supported_models_output_has_no_dead_doc_link,family_order_is_exhaustive,family_order_has_no_orphans.No new doc files were created (the acceptance criteria explicitly forbid creating
docs/model_implementations.mdto "fix" the dead link — the design is to drop the reference because the new output is self-contained).Scope:
mlxcel-serveris unaffectedsrc/bin/mlx_server.rsdefinesenum Commands { Download(DownloadArgs) }— nolistsubcommand exists on the server binary. Confirmed by reading the enum and the dispatch site. No equivalent change is needed there.New
mlxcel listoutput (sample)(28 family sections total; rendering each of the 92 variants exactly once.)
Test plan
cargo check --lib --tests— clean.cargo check --bin mlxcel --tests— clean.cargo test --lib models::metadata_tests::— 3/3 passing (count floor, round-trip, no-duplicates).cargo test --bin mlxcel tests::supported_models— 3/3 passing (mentions every display_name, header uses actual count, no dead doc link).cargo test --bin mlxcel tests::family_order— 2/2 passing (FAMILY_ORDER is exhaustive, no orphans).cargo test --bin mlxcel tests::generate_command— 3/3 still passing (regression check on existing CLI parse tests).cargo clippy --lib --tests -- -D warnings— clean.cargo clippy --bin mlxcel --tests -- -D warnings— clean.cargo fmt --check— clean../target/debug/mlxcel list— visually verified: header shows(92), nodocs/model_implementations.mdpointer, all 28 family sections rendered with members in declaration order.The release build (
cargo build --release) was deliberately skipped here to stay within the orchestrator's watchdog budget; the binary build is exercised post-handback in CI.Closes #26