Support for Zyphra/ZAYA1-base#1261
Open
kyr0 wants to merge 2 commits intoml-explore:mainfrom
Open
Conversation
…ttention (CCA) and Residual Scaling as well as quantized expert layer switching in SwiGLU scenarios, and general convert/quantization support for ZAYA.
…cing an empty self.cache list; so we correctly return True in this case generically
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.
I found this novel architecture quite interesting, so I clean room implemented support for it after reading and debugging the vLLM patch pushed 2 days ago.
This implementation works well with full precision, 8 bit quantization and 4 bit quantization on a Macbook Air M4 24GB.
Stats:
I covered testing with manual tests of
mlx_lm.benchmark,mlx_lm.convertandmlx_lm.serveras well.Novel features added:
...as described in the technical report.
The converted/quantized models are available on my HF account: https://huggingface.co/kyr0
e.g. https://huggingface.co/kyr0/zaya1-base-8b-MLX
https://huggingface.co/kyr0/zaya1-base-8b-8bit-MLX
https://huggingface.co/kyr0/zaya1-base-8b-4bit-MLX
Enjoy!
Transparency: I'm not affiliated with Zyphra
Repro for convert/quants:
mlx_lm.convert \ --hf-path Zyphra/ZAYA1-8B \ --mlx-path "./zaya1-base-8b-MLX" \ --dtype bfloat16Quantization
Tested with 8 and 4 bits, group size 64. Lower quants lead to garbage results.
A quick test with AWQ quantization support led to OOM in all cases. Dynamic quant as well. I'm too GPU poor on my Mac machine guys... Does anyone have a Mac Pro?
Server + Test
mlx_lm.server \ --model "./zaya1-base-8b-8bit-MLX" \ --host 127.0.0.1 \ --port 8080 \ --temp 0.0 \ --top-p 1.0 \ --max-tokens 8192 \ --prefill-step-size 512 \ --prompt-cache-size 0