Repository navigation
Model arch fixes - #13960
Closed
danielhanchen wants to merge 6 commits into
Closed
Model arch fixes#13960danielhanchen wants to merge 6 commits into
danielhanchen wants to merge 6 commits into
Conversation
Studio support for llama.cpp arch beam GGUFs: Harmony sampling defaults, map reasoning_effort none to minimal, withhold tools whose XML call bodies llama-server cannot parse, and tests for split variant resolution, KV and offload layout.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Tools for the arch were withheld outright. Read the llama-server binary and its llama-common library for the XML parameter call parser instead, so builds that carry it get tools and older builds keep plain chat. Fails closed on an unknown or unreadable binary.
danielhanchen
added a commit
that referenced
this pull request
Oct 16, 2026
…ice (#13982) ## Summary `Repo tests (CPU, studio)` fails on every PR based on main since #13882 (for example #13960 and #13962): ``` tests/python/test_accelerator_skip_guards.py::test_no_skip_guard_reads_a_spoofable_accelerator_probe E AssertionError: these skip guards read a probe tests/_zoo_aggressive_cuda_spoof.py patches to True process-wide, ... E assert not ['test_optimizer_state_offload.py:139: torch.cuda.is_available()', ...] ``` #13882 added `tests/test_optimizer_state_offload.py` with seven `@pytest.mark.skipif(not torch.cuda.is_available(), ...)` guards. The CUDA spoof the zoo tests install patches `torch.cuda.is_available` to True for the whole process. When this file shares a session with them on a CPU runner, its CUDA cases un-skip and fail. The repo-wide guard caught this before it could flake. The product change is fine; the guards are what is wrong. ## Change Gate those seven cases on `has_real_cuda()` from `tests/_shared/real_accelerator.py`, the same probe the other CUDA-only tests use (#13936, #13937). It checks for a real device rather than the patchable `is_available`. The CPU cases in the file are unchanged. ## Testing - `tests/python/test_accelerator_skip_guards.py` + `tests/test_optimizer_state_offload.py` on CPU: 40 passed, 15 skipped. - With the original file restored, the guard test fails again (1 failed, 23 passed), naming the same seven lines.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds Studio support for GGUFs of llama.cpp architecture
beam: a large MoE with a Harmony-style chat template that calls tools with XML argument bodies. The GGUF repo ships twelve split quant folders (UD-IQ1_SthroughUD-Q6_K_XL,Q8_0,BF16, 50 GB shards) with no mmproj and no drafter.Changes
Sampling defaults (
inference_defaults.json)generation_config.jsonhas no sampling settings, so every id fell through todefault.yaml(temperature 0.7, top_p 0.95, min_p 0.01).beam-1: temperature 1.0, top_p 1.0, top_k disabled (-1, sent to llama-server as 0), min_p 0.0. These are the Harmony defaults the GGUFs were evaluated with.beam-1), so an unrelated name that only contains the word does not match it.Reasoning effort (
llama_cpp.py)minimal/low/medium/high/xhigh/max, and callsraise_exceptionon any other string. Studio forwarded the OpenAInonesentinel unchanged, so that request failed to render.nonenow maps tominimal, the smallest budget it was trained with. Every other level passes through unchanged.medium) and the API default (highwhen thinking is on,lowwhen off) still apply, and with no kwarg the template uses its own default (max).Tool calls (
llama_cpp.py)<|constrain|>xml). llama-server picks its gpt-oss parser for this template, and that parser rejects these calls with an HTTP 500 partway through the stream.supports_toolsandsupports_tool_passthroughnow report False:toolsgets an immediate 400 ("template does not advertise tools") instead of a 500 after generation._TOOL_CALLS_UNPARSED_ARCHSis the single switch. Remove the entry once llama.cpp ships a parser for this format.Verified unchanged, covered by tests
UD-Q4_K_XL.sliding_window_pattern(43 sliding-window layers with a 512-token window, plus 9 full layers) is read, so the KV estimate charges full context only to the full layers.-otspill pattern.layout_from_ggufand_read_gguf_metadata: archbeam, 256 experts / 8 used, 96.3 of 103.1 GB spillable.Tests
studio/backend/tests/test_harmony_xml_moe_gguf.py, 48 tests, all offline (the HF file listing is mocked):repo:QUANT, base, HF-cache and local-path ids. Neighbouring families are unchanged.enable_thinkingon and off, each rendered through the template's own effort block.Against base
main, 12 of these fail (the sampling,nonecoercion and tool-gating tests) and 36 pass (the verification-only ones). On this branch all 48 pass.