Skip to content

MiniMax-M3: COLI_MSA=0 kill-switch, MSA banner/PROF, tool-call rendering - #1

Closed
corzogac wants to merge 0 commit into
steve-m:minimax-m3from
corzogac:minimax-m3-toolcalls
Closed

corzogac wants to merge 0 commit into
steve-m:minimax-m3from
corzogac:minimax-m3-toolcalls

Conversation

@corzogac

Copy link
Copy Markdown

Closes three of the WIP gaps listed in JustVugg#601 — the COLI_MSA kill-switch, the banner/PROF cosmetics, and (the big one) tool-call rendering for the MiniMax-M3 template.

What's in here

1. COLI_MSA=0 A/B kill-switch (colibri.c)
Forces full causal attention even when the MSA indexer weights are present, by zeroing c->msa + idx_type — the exact two lines the indexer-absent auto-detect fallback already uses, so it rides the tested full-attention path. Lets you measure MSA's long-context effect against a dense baseline without re-converting the container.

2. Banner + PROF cosmetics (colibri.c)
The startup banner ("GLM C engine (glm_moe_dsa)") and the PROF attention-bound verdict ("DSA …") now name MSA/M3. The banner peeks config.json model_type before model_init (cheap, capped read); the PROF verdict branches on m->c.arch.

3. Tool calls for the MiniMax-M3 template (openai_server.py)
The dispatcher no longer returns 400 for tools; render_chat_m3 now renders the ]<]minimax[>[<invoke name=…> XML dialect (developer <tools> declaration, assistant tool_calls, and ]~b]tool <response>… results) and parse_tool_calls dispatches to a new M3 parser that walks the recursive XML back into OpenAI tool_calls. Mirrors chat_template.jinja: to_xml recursion, nested objects/arrays, None omission, and schema type coercion via the existing _tool_param_types.

Verification

  • MSA oracle (tiny checkpoint) still 24/24 prefill + 20/20 decode with MSA on.
  • COLI_MSA=0 prints the kill-switch notice and diverges from the MSA oracle (full attention) as expected.
  • Tool-call render → parse round-trip passes: scalar + nested object/array args, string/int type coercion against the declared schema, multi-invoke, tool-result grouping.
  • GLM + Inkling paths unchanged (GLM tool-call parse/render regression-tested).
  • make test167/167 OK (13 skipped) on Apple Silicon (clang + libomp).

No reviews/commits in JustVugg#601 touch these spots, so this should be a clean cherry-pick/rebase onto your branch. Happy to adjust the render/parse to match any byte-exact template conventions you've been testing against.

steve-m pushed a commit that referenced this pull request Aug 15, 2026
Enable the DeepSeek V4 engine on aarch64 Linux + NEON rows16 kernels
@steve-m

steve-m commented Aug 15, 2026

Copy link
Copy Markdown
Owner

Merged — thank you! Your commit is in the minimax-m3 branch (and therefore in JustVugg#601) as e1fce8a, cherry-picked with your authorship onto the branch's rebase against upstream dev v1.6.1 — the old head 3ab405d you based on was rewritten by that rebase, which is why this PR now shows as outdated.

Two small adjustments on top, in 2f1e07b, both of the kind you offered to make yourself:

  • Byte-exactness: the template's jinja for-loops trim whitespace on both sides, so argument pairs and nested to_xml elements concatenate with no newlines (and none after <invoke name="...">). Verified byte-identical against a jinja2 render of the official chat_template.jinja, including the full two-invoke example block in the tools declaration. Your parser handled both layouts already, so it's untouched.
  • Streaming: upstream dev grew an arch-dispatched _tool_stream_markers() after your base; minimax now holds the visible stream at the ]<]minimax[>[<tool_call> opener so streamed replies don't leak the raw block token by token.

All three features re-validated on the rebased branch (oracle gates 24/24 + 20/20, kill-switch A/B diverges as it should, banner correct). Closing since the content lives in the branch now — much appreciated, and welcome back any time.

@steve-m steve-m closed this Aug 15, 2026
steve-m added a commit that referenced this pull request Aug 27, 2026
…arker

Three adjustments on top of the tool-call support from fork PR #1, all
measured against the official chat_template.jinja rendered via jinja2:

- invoke/to_xml rendering: the template's for-loops are whitespace-trimmed
  on both sides, so argument pairs and nested elements concatenate with NO
  newlines; dropped the extra \n after <invoke name="..."> and between
  argument pairs (the parser was already layout-agnostic).
- developer-block example: the template's full two-invoke example including
  the nested param-2 item block, byte-identical.
- _tool_stream_markers: minimax holds the visible stream at the
  ]<]minimax[>[<tool_call> opener. The arch-dispatched streaming scan
  landed on dev after this PR's base; without a marker a streamed reply
  would leak the raw tool-call block to the client token by token.

Validated against the jinja reference render: tools declaration, assistant
tool_call block, and tool-response run all byte-identical; parsing the
template-rendered block round-trips nested objects/arrays/bools with
schema type coercion.
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.

2 participants