Skip to content

Fix Backend CI: add has_blackwell_gpu to the mlx worker test stub - #6980

Merged
danielhanchen merged 1 commit into
mainfrom
fix-mlx-blackwell-stub
Jul 8, 2026
Merged

danielhanchen merged 1 commit into
mainfrom
fix-mlx-blackwell-stub

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

Summary

#6970 restored has_blackwell_gpu in studio/backend/utils/wheel_utils.py and re-added its import in studio/backend/core/training/worker.py, but the mlx worker test's _load_worker_module stubs utils.wheel_utils with a fixed name tuple that did not include has_blackwell_gpu. Loading the worker against that stub raised ImportError: cannot import name 'has_blackwell_gpu' from 'utils.wheel_utils' (unknown location), so Backend CI could not collect studio/backend/tests/test_mlx_training_worker_config.py on any of Python 3.10 to 3.13.

This adds has_blackwell_gpu to the stub tuple so it matches worker.py's imports, restoring the consistent state the file had before the name was dropped.

Verification

  • Reproduced the exact collection error locally: cannot import name 'has_blackwell_gpu' from 'utils.wheel_utils' (unknown location).
  • With the fix, test_mlx_training_worker_config.py collects and its tests pass (the one unrelated failure I saw locally is a bitsandbytes/CUDA setup issue on a GPU box; it does not occur under the CPU torch the Backend CI installs).
  • One line, test-only change; matches the other importers (worker.py, install_python_stack.py) that already list has_blackwell_gpu.

worker.py imports has_blackwell_gpu from utils.wheel_utils, but _load_worker_module
stubs utils.wheel_utils with a fixed name tuple that omitted it, so loading the worker
raised ImportError (cannot import name 'has_blackwell_gpu') and Backend CI could not
collect test_mlx_training_worker_config.py. Add the name to the stub so it matches
worker.py's imports.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the test configuration in test_mlx_training_worker_config.py by adding has_blackwell_gpu to the list of mocked worker module attributes. There are no review comments, and I have no feedback to provide.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0c915657d7

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

for name in (
"direct_wheel_url",
"flash_attn_wheel_url",
"has_blackwell_gpu",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Stub training_runs before loading worker

When this test module is collected in isolation, _load_worker_module() replaces utils with an empty package, and worker.py imports utils.training_runs before it reaches utils.wheel_utils. I ran pytest -q studio/backend/tests/test_mlx_training_worker_config.py and collection still fails with ModuleNotFoundError: No module named 'utils.training_runs', so adding only has_blackwell_gpu leaves Backend CI broken unless another test happened to prepopulate sys.modules['utils.training_runs'].

Useful? React with 👍 / 👎.

@danielhanchen
danielhanchen merged commit 3d41e58 into main Jul 8, 2026
37 of 38 checks passed
@danielhanchen
danielhanchen deleted the fix-mlx-blackwell-stub branch July 8, 2026 14:22
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