lvkaokao commited on
Commit
dd7c9f8
·
verified ·
1 Parent(s): 25238f0

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +57 -55
README.md CHANGED
@@ -12,81 +12,83 @@ tags:
12
  - video
13
  ---
14
 
15
- <div align="center">
16
- <img width="60%" src="figures/logo.svg" alt="MiniMax">
17
- </div>
18
- <hr>
19
 
20
- <p align="center">
21
- <a href="https://agent.minimax.io/" target="_blank"><img src="https://img.shields.io/badge/MiniMax%20Agent-FF6C37?logo=minimax&logoColor=white" alt="MiniMax Agent"></a>
22
- <a href="https://platform.minimax.io/docs/guides/text-generation" target="_blank"><img src="https://img.shields.io/badge/API-FF6C37?logo=minimax&logoColor=white" alt="API"></a>
23
- <a href="https://www.minimax.io" target="_blank"><img src="https://img.shields.io/badge/MiniMax%20Website-FF6C37?logo=minimax&logoColor=white" alt="MiniMax Website"></a>
24
- <br>
25
- <a href="https://modelscope.cn/organization/minimax" target="_blank" rel="noopener noreferrer"><img alt="ModelScope MiniMax AI" src="https://img.shields.io/badge/ModelScope-MiniMax%20AI-white?labelColor=%23EF3D5D"></a>
26
- <a href="https://platform.minimaxi.com/docs/faq/contact-us" target="_blank"><img src="https://img.shields.io/badge/WeChat-07C160?logo=wechat&logoColor=white" alt="WeChat"></a>
27
- <a href="https://discord.com/invite/DPC4AHFCBw" target="_blank"><img src="https://img.shields.io/badge/Discord-5865F2?logo=discord&logoColor=white" alt="Discord"></a>
28
- <a href="https://huggingface.co/MiniMaxAI" target="_blank"><img src="https://img.shields.io/badge/Hugging%20Face-FFD21E?logo=huggingface&logoColor=black" alt="Hugging Face"></a>
29
- <a href="https://github.com/MiniMax-AI/MiniMax-M3" target="_blank"><img src="https://img.shields.io/badge/GitHub-181717?logo=github&logoColor=white" alt="GitHub"></a>
30
- <a href="https://arxiv.org/abs/2606.13392" target="_blank"><img src="https://img.shields.io/badge/arXiv-2606.13392-B31B1B?logo=arxiv&logoColor=white" alt="arXiv Paper"></a>
31
- <a href="https://huggingface.co/MiniMaxAI/MiniMax-M3/blob/main/LICENSE" target="_blank"><img src="https://img.shields.io/badge/LICENSE-4CAF50?logo=creativecommons&logoColor=white" alt="LICENSE"></a>
32
- </p>
33
 
34
- MiniMax-M3 is a native multimodal model with 1M context. It has ~428B parameters and ~23B activated parameters.
35
 
36
- **Highlights:**
37
- - **Native Multimodality:** M3 undergoes mixed-modality training from the very first step, enabling deeper semantic fusion across text, image, and video.
38
- - **Context Scaling via Sparse Attention:** M3 introduces MiniMax Sparse Attention (MSA) to improve long context efficiency. M3 delivers 9× prefill and 15× decode speedups compared to M2 at 1M context, reducing per-token compute to 1/20.
39
- - **Coding & Cowork Capability:** M3 achieves frontier-level performance across long-horizon agentic benchmarks, excelling in both coding and cowork.
40
 
41
 
42
- <p align="center">
43
- <img width="100%" src="figures/benchmark.jpeg">
44
- </p>
45
-
46
- ## MiniMax Sparse Attention (MSA)
47
-
48
- M3 is powered by [**MiniMax Sparse Attention (MSA)**](https://github.com/MiniMax-AI/MSA), a high-performance sparse attention operator designed for million-token contexts. Compared with GQA, MSA dramatically reduces the attention compute and memory footprint while preserving model quality.
 
 
 
49
 
50
- <p align="center">
51
- <img width="100%" src="figures/efficiency_gqa_vs_msa.png" alt="GQA vs MSA Efficiency Comparison">
52
- </p>
 
 
 
 
 
 
 
 
 
 
 
53
 
54
- > 📄 Read the technical report: [arXiv:2606.13392](https://arxiv.org/abs/2606.13392) · [Hugging Face Papers](https://huggingface.co/papers/2606.13392)
55
 
56
- ## How to Use
57
 
58
- - [MiniMax Agent](https://agent.minimax.io/)
59
- - [MiniMax API](https://platform.minimax.io/)
60
 
61
- M3 supports three reasoning modes through the `thinking` parameter:
62
- - **`enabled`** — Reasoning is always enabled.
63
- - **`adaptive`** — M3 automatically determines when additional reasoning is beneficial.
64
- - **`disabled`** — Reasoning is disabled to minimize latency and maximize throughput.
65
 
66
- ## Local Deployment
 
 
 
 
 
 
 
 
 
 
67
 
68
- Download the model:
69
 
70
- ```bash
71
- hf download MiniMaxAI/MiniMax-M3 --local-dir MiniMax-M3
72
- ```
73
 
74
- We recommend the following inference frameworks (listed alphabetically) to serve the model:
75
 
76
- - [SGLang](https://docs.sglang.io/) - see [SGLang cookbook](https://docs.sglang.io/cookbook/autoregressive/MiniMax/MiniMax-M3).
77
 
78
- - [vLLM](https://github.com/vllm-project/vllm) - see [vLLM recipes](https://recipes.vllm.ai/MiniMaxAI/MiniMax-M3).
79
 
80
- - [Transformers](https://github.com/huggingface/transformers) - see [Transformers docs](https://huggingface.co/docs/transformers/model_doc/minimax_m3_vl).
81
 
82
- - [KTransformers](https://github.com/kvcache-ai/ktransformers) - see [KTransformers MiniMax-M3 tutorial](https://github.com/kvcache-ai/ktransformers/blob/main/doc/en/kt-kernel/MiniMax-M3-Tutorial.md).
83
 
84
- - [unsloth](https://unsloth.ai) - see [tutorial](https://unsloth.ai/docs/models/minimax-m3)
85
 
86
- ### Inference Parameters
87
 
88
- We recommend the following parameters for best performance: `temperature=1.0`, `top_p=0.95`, `top_k=40`.
89
 
90
- ## Contact Us
91
 
92
- Contact us at [model@minimax.io](mailto:model@minimax.io).
 
12
  - video
13
  ---
14
 
15
+ This model is a MXFP4 mixed model of [MiniMax-M3](https://huggingface.co/MiniMaxAI/MiniMax-M3) generated by [intel/auto-round](https://github.com/intel/auto-round) with llm_compressor format. Please follow the license of the original model.
16
+ - MOE (block_sparse_moe.experts): MXFP4
17
+ - MOE (block_sparse_moe.shared_experts): MXFP8
18
+ - self_attn (q/k/v/o): MXFP8
19
 
20
+ | Configuration | GSM8K | MMLU | PIQA | HelleSwag | Average | Relative to BF16 |
21
+ |--------------|-------|----------|----------|----------|----------|------------------|
22
+ | BF16 | 95.30 | 0.8415 | 0.8259 | 0.6714 | 0.82295 | - |
23
+ | MXFP4 (experts) + MXFP8 (shared_experts) + MXFP8 (self_attn) | 0.9507 | 0.8294 | 0.8210 | 0.6522 | 0.813325 | 98.83% |
 
 
 
 
 
 
 
 
 
24
 
 
25
 
26
+ ## How to Run Locally
 
 
 
27
 
28
 
29
+ ```
30
+ vllm serve \
31
+ INCModelSharing/MiniMax-M3-MXFP4-Mixed-MXFP8-Attn-CT-AutoRound \
32
+ --tensor-parallel-size 2 \
33
+ --max-model-len 131072 \
34
+ --tool-call-parser minimax_m3 \
35
+ --reasoning-parser minimax_m3 \
36
+ --enable-auto-tool-choice \
37
+ --port 8000
38
+ ````
39
 
40
+ ```
41
+ curl -s http://127.0.0.1:8000/v1/chat/completions -H "Content-Type: application/json" -d '{
42
+ "model": "INCModelSharing/MiniMax-M3-MXFP4-Mixed-MXFP8-Attn-CT-AutoRound",
43
+ "messages": [
44
+ {"role":"user","content":"2+3=?"}
45
+ ],
46
+ "max_tokens": 10,
47
+ "extra_body": {
48
+ "chat_template_kwargs": {
49
+ "enable_thinking": true
50
+ }
51
+ }
52
+ }' | python3 -m json.tool
53
+ ```
54
 
 
55
 
 
56
 
57
+ ## Generate the Model
 
58
 
 
 
 
 
59
 
60
+ ~~~bash
61
+ auto-round MiniMaxAI/MiniMax-M3 --model_free \
62
+ --scheme MXFP8 \
63
+ --ignore_layers vision_tower,lm_head,block_sparse_moe.gate,embed_tokens,\
64
+ patch_merge_mlp,multi_modal_projector,mlp.gate_proj,mlp.up_proj,mlp.down_proj,\
65
+ self_attn.index_q_proj,self_attn.index_k_proj,self_attn.index_q_norm,self_attn.index_k_norm,\
66
+ self_attn.q_norm,self_attn.k_norm \
67
+ --layer_config "{block_sparse_moe.experts:{bits:4,data_type:mx_fp}}" \
68
+ --format llm_compressor \
69
+ --output_dir "./MiniMax-M3-MXFP4MoE-MXFP8-attn"
70
+ ~~~
71
 
72
+ ## Ethical Considerations and Limitations
73
 
74
+ The model can produce factually incorrect output, and should not be relied on to produce factually accurate information. Because of the limitations of the pretrained model and the finetuning datasets, it is possible that this model could generate lewd, biased or otherwise offensive outputs.
 
 
75
 
76
+ Therefore, before deploying any applications of the model, developers should perform safety testing.
77
 
78
+ ## Caveats and Recommendations
79
 
80
+ Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model.
81
 
82
+ Here are a couple of useful links to learn more about Intel's AI software:
83
 
84
+ - [Intel Neural Compressor](https://github.com/intel/neural-compressor)
85
 
86
+ ## Disclaimer
87
 
88
+ The license on this model does not constitute legal advice. We are not responsible for the actions of third parties who use this model. Please consult an attorney before using this model for commercial purposes.
89
 
90
+ ## Cite
91
 
92
+ @article{cheng2023optimize, title={Optimize weight rounding via signed gradient descent for the quantization of llms}, author={Cheng, Wenhua and Zhang, Weiwei and Shen, Haihao and Cai, Yiyang and He, Xin and Lv, Kaokao and Liu, Yi}, journal={arXiv preprint arXiv:2309.05516}, year={2023} }
93
 
94
+ [arxiv](https://arxiv.org/abs/2309.05516) [github](https://github.com/intel/auto-round)