[CI-validation] MLX PRs #679 + #682 + #692#19
Open
danielhanchen wants to merge 19 commits into
Open
Conversation
…ing/mlx-prs-679-682-692
…to staging/mlx-prs-679-682-692
…ging/mlx-prs-679-682-692
Combines three open MLX-only PRs against unslothai/unsloth-zoo into one staging branch and wires up real ubuntu-latest / macos-14 / windows-latest GitHub Actions runs to validate them together: - unslothai#679 fix(mlx): persist LoRA adapter metadata on save - unslothai#682 fix(mlx): handle zero-token and invalid labels in CCE - unslothai#692 fix(mlx): save only LoRA adapter tensors This branch is intentionally throwaway; do not merge into staging/main. It is the iteration unit for the three workflow files below. PR unslothai#679 + PR unslothai#692 both touch unsloth_zoo/mlx/{utils,trainer}.py. Git's ort strategy auto-resolved cleanly: - utils.py keeps PR unslothai#692's _save_adapter_artifacts helper + lora_-name filter in save_lora_adapters, PLUS PR unslothai#679's _get_mlx_dropout_probability, _infer_mlx_lora_rank, and the expanded _enrich_mlx_adapter_config that writes lora_parameters / rank / scale / dropout / peft_type=LORA. - trainer.py imports both save_trainable_adapters (PR unslothai#692) and the helpers from PR unslothai#679, with checkpoint saves switched to the new save_trainable_adapters and final adapter export still calling save_lora_adapters. New scaffolding: - tests/test_mlx_save_lora_adapters_filter.py: four tests over the combined PR unslothai#692 + PR unslothai#679 surface (LoRA-only filter, metadata fields, no-adapter ValueError, trainable-checkpoint preserves everything). Closes the PR unslothai#692 coverage gap Copilot flagged. Uses mlx_simulation so it runs on Linux + Windows too. - tests/_zoo_aggressive_cuda_spoof.py: deeper torch.cuda spoof copied from danielhanchen/unsloth-staging-2, kept available for harder import paths that escape tests/conftest.py's device-type preload. - .github/workflows/mlx-pr-mac.yml: macos-14, real MLX install, PR-specific pytest set. Primary green signal. - .github/workflows/mlx-pr-linux.yml: ubuntu-latest, CPU torch + no-MLX install, import smoke + the new save_lora_adapters_filter shim test. - .github/workflows/mlx-pr-windows.yml: same as Linux but pinned to shell: bash everywhere; no triton. All three workflows trigger only on push to this staging branch with paths: filters and cancel-in-progress so force-pushes during iteration do not queue.
The seven upstream workflows (consolidated-tests-ci, lint-ci, mlx-ci, security-audit, stale, studio-export-fix-ci, wheel-smoke) would fire on every push and PR-event to this throwaway staging branch and burn runner minutes that have nothing to do with validating MLX PRs unslothai#679, unslothai#682, unslothai#692. Keep only the three mlx-pr-* workflows on this branch. They stay in upstream main / origin/main untouched -- this deletion is scoped to the staging branch only.
macOS: pip install -e .[mlx] does not pull torch (correct in production
since MLX replaces torch on Apple Silicon), but the new
test_mlx_save_lora_adapters_filter.py uses torch via the shim. Add an
explicit torch==2.10.0 install from the PyTorch CPU index (same pattern
as danielhanchen/unsloth-staging-2/.github/workflows/mlx-ci.yml).
Linux + Windows: unsloth_zoo/__init__.py:198 has a find_spec("unsloth")
hard gate that fires before UNSLOTH_IS_PRESENT is read. Install
unsloth --no-deps from git main so the import survives without dragging
in unsloth's heavy CUDA-only deps. Mirror of upstream
consolidated-tests-ci.yml.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Throwaway staging-fork CI validation for three open MLX-only PRs against
unslothai/unsloth-zoo, all by @Lyxot:fix(mlx): persist LoRA adapter metadata on savefix(mlx): handle zero-token and invalid labels in CCEfix(mlx): save only LoRA adapter tensorsDo not merge. This PR exists only to surface the three CI runs (mac / linux / windows) in the GitHub UI.
What this branch contains
unslothai/unsloth-zoomainmerged in (origin/main was behind).#682→#679→#692. Git'sortstrategy auto-resolved the#679+#692collision inunsloth_zoo/mlx/{utils,trainer}.py:utils.pykeeps#692's_save_adapter_artifacts+lora_filter insave_lora_adapters, plus#679's new_get_mlx_dropout_probability/_infer_mlx_lora_rankhelpers and the expanded_enrich_mlx_adapter_config(writeslora_parameters/rank/scale/dropout/peft_type=LORA).trainer.pyimports both the newsave_trainable_adapters(fix(mlx): save only LoRA adapter tensors unslothai/unsloth-zoo#692) and the rank/dropout helpers (fix(mlx): persist LoRA adapter metadata on save unslothai/unsloth-zoo#679); checkpoint saves now go throughsave_trainable_adapterswhile final adapter export still callssave_lora_adapters.tests/test_mlx_save_lora_adapters_filter.py— 4 tests over the combined#692+#679surface. Closes the coverage gap Copilot flagged on#692(no test) and exercises#679's_p_1keep-prob dropout fallback. Runs on every platform via themlx_simulationshim.tests/_zoo_aggressive_cuda_spoof.py— deeper torch.cuda spoof fromdanielhanchen/unsloth-staging-2, kept in reserve for stricter import paths.mlx-pr-mac.yml,mlx-pr-linux.yml,mlx-pr-windows.yml.CI design
mlx-pr-macmacos-14mlx-pr-linuxubuntu-latestsave_lora_adapterstest. MLX wheels do not install on Linux, so this cannot exercise Metal.mlx-pr-windowswindows-latestshell: basheverywhere, notriton.All three workflows:
pushtostaging/mlx-prs-679-682-692(so they iterate on force-pushes without burning upstream CI minutes).concurrency.cancel-in-progress: trueso a new push supersedes a still-running iteration.paths:filters scoped to MLX surfaces + their own workflow file.Test plan
mlx-pr-macpasses: MLX install OK, all 7 MLX submodule imports OK,test_mlx_save_lora_adapters_filter.py(4 tests) green,test_mlx_runtime_cce_compile.pygreen.mlx-pr-linuxpasses:import unsloth_zooOK,is_mlx_available()returnsFalse, shim-backedtest_mlx_save_lora_adapters_filter.pygreen.mlx-pr-windowspasses: same as Linux.cancel-in-progresscheck).