Repository navigation
Add qwen3.6 script - #5084
Add qwen3.6 script#5084
Conversation
* Fixing cache.empty() calls * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: Manan Shah <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Fixing cache.empty() calls * fixing for mlx versions * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: Manan Shah <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Manan17 <[email protected]>
* removed bidirectional check for 31b * Change gemma4_text for moe * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: Manan Shah <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* fix(gemma4): cast RoPE offset to int before mx.arange() * fix(gemma4): use zero-based arange + offset to avoid CPU-GPU sync
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b2225e6a64
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this comment.
Code Review
This pull request introduces an installation script for Qwen3.6 MLX on macOS and provides the implementation for the Gemma4 model using the MLX framework. The feedback focuses on improving the robustness and debuggability of the installation script by ensuring download failures are properly handled and installation logs are not silenced. Additionally, a critical performance issue was identified in the Gemma4 text model's embedding logic, where an inefficient reverse lookup of input IDs could lead to significant memory overhead and potential out-of-memory errors.
I am having trouble creating individual review comments. Click here to see my feedback.
unsloth/models/gemma4_text.py (561-565)
This reverse lookup of input_ids from input_embeddings is extremely inefficient and will likely cause an Out-Of-Memory (OOM) error. Comparing input_embeddings (shape [B, L, D]) against the entire embedding weight matrix (shape [V, D]) using broadcasting creates a massive intermediate tensor of shape [B, L, V, D]. For a typical vocabulary size (V) and hidden dimension (D), this can easily exceed hundreds of gigabytes of memory even for a single token.
scripts/install_qwen3_6_mlx.sh (159)
The curl command should include the -f (or --fail) flag to ensure the script exits if the remote patch file is not found (e.g., a 404 error). Without it, curl might exit with code 0 even if the download fails, potentially writing an error message into the target .py file.
curl -sSLf "${_PATCH_BASE}/qwen3_5.py" -o "${_SITE_PKGS}/mlx_vlm/models/qwen3_5/qwen3_5.py"
scripts/install_qwen3_6_mlx.sh (111)
Silencing the output of the uv installation script makes it difficult to diagnose failures. If the installation fails, the script will exit due to set -e, but the user will have no information about why it failed.
sh "$_uv_tmp" </dev/null
scripts/install_qwen3_6_mlx.sh (130)
Redirecting stderr to /dev/null during package installation hides potential error messages that are crucial for troubleshooting environment issues.
if uv pip install --python "$_VENV_PY" -q "transformers>=5.5.0"; then
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7deb6952e6
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
7deb695 to
76e66d0
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f611f3e130
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
|
||
| step "patch" "fixing multi-turn image chat..." | ||
|
|
||
| if curl -sSLf "${_PATCH_BASE}/qwen3_5.py" -o "${_SITE_PKGS}/mlx_vlm/models/qwen3_5/qwen3_5.py"; then |
There was a problem hiding this comment.
Download patches atomically before overwriting installed modules
This curl ... -o writes directly into site-packages, so a transient transfer failure (e.g., connection reset mid-download) can leave a partially written qwen3_5.py/generate.py. Because the failure branch only emits a warning and the script continues to the success banner, users can end up with a corrupted mlx_vlm install that fails later at import/runtime; downloading to a temp file and mv-ing only after success avoids this corruption path.
Useful? React with 👍 / 👎.
|
Script is not executable |
This is a new installation script addition for qwen3.6 using MLX