Skip to content

Check the GGUF load marker on load_model through the AST - #15017

Merged
danielhanchen merged 1 commit into
mainfrom
ci-gguf-load-marker-ast
Oct 23, 2026
Merged

danielhanchen merged 1 commit into
mainfrom
ci-gguf-load-marker-ast

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

studio/backend/tests/test_gguf_load_cache_reuse.py::TestLoadHubDownloadExclusion::test_load_marker_precedes_hub_guard_which_precedes_the_gpu_handoff fails on main, for example in Backend CI (Python 3.13, a-k) on #15000 and #15001.

Cause

The test's last assertion is a literal source match: "@_with_gguf_load_marker\n def load_model(". #14546 added @holds_inference between that decorator and def load_model, so the string no longer appears. The load marker still wraps LlamaCppBackend.load_model, so the product is fine and the test was out of date.

Fix

The check now parses llama_cpp.py, finds LlamaCppBackend.load_model, and asserts that _with_gguf_load_marker is in its decorator list, in any position. The rest of the test, including the ordering in routes/inference.py, is unchanged.

Verification

  • studio/backend/tests/test_gguf_load_cache_reuse.py: 75 passed. On main this test failed when run alone.
  • Sabotage check: removing @_with_gguf_load_marker from load_model fails the test.

#14546 added @holds_inference between @_with_gguf_load_marker and def load_model, so the literal source match in test_load_marker_precedes_hub_guard_which_precedes_the_gpu_handoff stopped finding it although the marker still wraps the load. Read LlamaCppBackend.load_model's decorator list instead.
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-23T18:26:35.582456Z 633aab6 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🚀

Reviewed commit: 633aab6edd

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@danielhanchen
danielhanchen merged commit 8373f09 into main Oct 23, 2026
3 of 37 checks passed
@danielhanchen
danielhanchen deleted the ci-gguf-load-marker-ast branch October 23, 2026 18:36
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