Add xing4_0 model support - #1901
Open
TokenAI-zer wants to merge 1 commit into
Open
TokenAI-zer wants to merge 1 commit into
TokenAI-zer wants to merge 1 commit into
Conversation
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.
Requirements
Model information
Supported checkpoints
The full BF16 checkpoint used for validation is available at:
https://huggingface.co/XingChen-AGI/Xing4.0-29B-A4B
Model
Pre-quantized MLX versions (for local inference without downloading the full 58 GB checkpoint) are available at:
https://huggingface.co/TokenAI-zer/Xing4.0-29B-A4B-4bit-MLX
https://huggingface.co/TokenAI-zer/Xing4.0-29B-A4B-6bit-MLX
https://huggingface.co/TokenAI-zer/Xing4.0-29B-A4B-8bit-MLX
Verification
Run mlx-lm command (
--trust-remote-codeis required: the tokenizer ships ascustom code, without it the command fails with
AttributeError: 'PreTrainedConfig' object has no attribute 'max_position_embeddings'):mlx_lm.generate --model XingChen-AGI/Xing4.0-29B-A4B --trust-remote-code -p "The secret to baking a good cake is" -m 1024Output
AI usage disclosure
The files mlx_lm/models/xing4_0.py and tests/test_xing4_0_hc.py were written by an AI assistant (Claude), under my direction and review.
The implementation has been numerically verified against the PyTorch reference implementation: on a reduced configuration with random weights, the maximum relative error on the logits is 2.6e-07, with 100% agreement on argmax predictions. The hyper-connection component was additionally validated in isolation against the reference torch module, with error < 1e-5 in float32.
The real BF16 checkpoint (58 GB) has been confirmed to load and generate correctly.
The PR description and all responses to reviewers are my own.