Skip to content

Catch the llama-prebuilt validator stubs up with rocm_gfx - #8182

Merged
danielhanchen merged 2 commits into
unslothai:mainfrom
danielhanchen:fix/llama-prebuilt-validator-stubs
Aug 8, 2026
Merged

danielhanchen merged 2 commits into
unslothai:mainfrom
danielhanchen:fix/llama-prebuilt-validator-stubs

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

What breaks

Four tests are red on main right now, at 21f8efdfe:

FAILED tests/studio/install/test_install_llama_prebuilt_logic.py::test_install_prebuilt_falls_back_to_older_release_plan
FAILED tests/studio/install/test_install_llama_prebuilt_logic.py::test_install_prebuilt_skips_when_older_release_fallback_matches_existing_install
FAILED tests/studio/install/test_install_llama_prebuilt_logic.py::test_install_prebuilt_skips_same_release_fallback_attempt_when_installed
FAILED tests/studio/install/test_install_llama_prebuilt_logic.py::test_install_prebuilt_same_tag_upstream_failure_uses_older_unsloth_release_plan
4 failed, 94 passed, 1 skipped

All four are the same thing, from studio/install_llama_prebuilt.py:7140:

TypeError: test_install_prebuilt_falls_back_to_older_release_plan.<locals>.fake_validate()
           got an unexpected keyword argument 'rocm_gfx'

validate_prebuilt_attempts and validate_prebuilt_choice both take rocm_gfx: str | None = None, and the real call site passes it. The four fake_validate stubs standing in for them stop at llama_backend.

Nothing is wrong with the production code. The parameter was added there and the stubs were not brought along.

Why it read as four unrelated failures

The stub is patched in and then called from deep inside the fallback logic, so the TypeError surfaces inside whatever assertion happened to be running. Nothing in the output says a parameter moved, which is why four separate release-fallback tests went red at once for one reason.

The fix

Add rocm_gfx = None to the four stubs, and add a test that names the keyword-only parameter set of each validator. A future keyword then fails once, in that test, naming the parameter, instead of scattering TypeErrors through unrelated assertions.

I checked the guard actually discriminates: dropping rocm_gfx from the expected set for validate_prebuilt_attempts turns it red and leaves the other 99 green.

Result

100 passed, 1 skipped

Import-hoist verifier CLEAN / OVERALL: PASS, ruff check clean, pre-push gate pass. Test-only change; no production file is touched, so no runtime behaviour moves on any platform.

danielhanchen and others added 2 commits August 8, 2026 13:18
Both validators take a rocm_gfx keyword and the four stubs standing in for them
do not, so the real call site passes it and the stub raises TypeError. It lands
inside whatever assertion was running, which reddened four unrelated fallback
tests on main rather than saying a parameter had moved.

Adds the keyword, and a test naming the keyword-only set of each validator so
the next one fails once, here, with the parameter that moved.
@danielhanchen
danielhanchen merged commit b0ea23b into unslothai:main Aug 8, 2026
20 of 24 checks passed
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

1 similar comment
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep them coming!

Reviewed commit: b0ea23bbf2

ℹ️ 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".

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