Skip to content

MLX backend tests: stub zoo's new fused_drafter_ops - #15020

Merged
danielhanchen merged 1 commit into
mainfrom
ci-mlx-stub-drafter-ops
Oct 23, 2026
Merged

danielhanchen merged 1 commit into
mainfrom
ci-mlx-stub-drafter-ops

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

Two tests in studio/backend/tests/test_mlx_inference_backend.py fail against current unsloth_zoo main, for example in the MLX CI dispatch job on #15000:

test_the_stub_answers_every_helper_zoo_imports_from_inference
AssertionError: zoo imports ['fused_drafter_ops'] from mlx.inference and the stub cannot answer them
test_the_stub_accepts_every_call_zoo_makes_to_an_inference_helper
AttributeError: fused_drafter_ops

Cause

unsloth-zoo #2031 added from .inference import fused_drafter_ops to unsloth_zoo/mlx/speculative.py.

The stub module in this test answers unknown names with a neutral context manager, except for fused_* names. It deliberately raises AttributeError for those, so that a deleted fusion still reads as missing. fused_drafter_ops is also not a scope: it is a plain call that returns how many DFlash2 drafter modules it fused.

The test is the side that needed updating. Zoo's new helper is intentional.

Fix

  • New NEUTRAL_PLAIN_HELPERS holds fused_drafter_ops. Its stub returns 0, meaning nothing fused, because zoo's body needs Metal kernels.
  • The fixture installs it, and the call-shape test calls it as a plain function.
  • It is kept out of PLAIN_HELPERS. test_each_plain_helper_stub_matches_zoos_body pins each PLAIN_HELPERS stub to zoo's own body, and that cannot hold for this helper.

An older zoo that does not import it is unaffected.

Verification

Run with zoo main on the path, comparing failing test IDs on base and head:

  • Base: the two tests above fail.
  • Head: both pass, and test_each_plain_helper_stub_matches_zoos_body still passes.
  • Six other tests in the file fail locally on both sides, from this host's missing mlx_vlm. They are green in CI.

unsloth_zoo #2031 imports fused_drafter_ops from mlx.inference in speculative.py. It is a plain call that returns how many drafter modules it fused, and the stub answers every unlisted fused_* name with AttributeError on purpose, so the two stub-coverage tests failed. Add it as a neutral plain helper returning 0, kept apart from PLAIN_HELPERS, whose bodies are pinned to zoo's.
@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-23T19:12:16.162795Z effb944 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. More of your lovely PRs please.

Reviewed commit: effb9446e4

ℹ️ 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 5ec3ede into main Oct 23, 2026
7 of 32 checks passed
@danielhanchen
danielhanchen deleted the ci-mlx-stub-drafter-ops branch October 23, 2026 19:21
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