YAML Metadata Warning: empty or missing yaml metadata in repo card (https://huggingface.co/docs/hub/model-cards#model-card-metadata)

Introduction

MiniCPM-o 2.6-FlagOS-Cambricon provides an all-in-one deployment solution, enabling execution of MiniCPM-o 2.6 on Cambricon DSAs. As the first-generation release for the Cambricon-MLU590 series, this package delivers two key features:

  1. Comprehensive Integration:
    • Integrated with FlagScale (https://github.com/FlagOpen/FlagScale).
    • Open-source inference execution code, preconfigured with all necessary software and hardware settings.
    • Pre-built Docker image for rapid deployment on Cambricon-MLU590.
  2. Consistency Validation:
    • Evaluation tests verifying consistency of results between NVIDIA H100 and Cambricon-MLU590.

Technical Summary

Serving Engine

We use FlagScale as the serving engine to improve the portability of distributed inference.

FlagScale is an end-to-end framework for large models across multiple chips, maximizing computational resource efficiency while ensuring model effectiveness. It ensures both ease of use and high performance for users when deploying models across different chip architectures:

  • One-Click Service Deployment: FlagScale provides a unified and simple command execution mechanism, allowing users to fast deploy services seamlessly across various hardware platforms using the same command. This significantly reduces the entry barrier and enhances user experience.
  • Automated Deployment Optimization: FlagScale automatically optimizes distributed parallel strategies based on the computational capabilities of different AI chips, ensuring optimal resource allocation and efficient utilization, thereby improving overall deployment performance.
  • Automatic Operator Library Switching: Leveraging FlagScale's unified Runner mechanism and deep integration with FlagGems, users can seamlessly switch to the FlagGems operator library for inference by simply adding environment variables in the configuration file.

Triton Support

We validate the execution of MiniCPM-o 2.6 model with a Triton-based operator library as a PyTorch alternative.

We use a variety of Triton-implemented operation kernelsβ€”approximately 70%β€”to run the MiniCPM-o 2.6 model. These kernels come from two main sources:

  • Most Triton kernels are provided by FlagGems (https://github.com/FlagOpen/FlagGems). You can enable FlagGems kernels by setting the environment variable USE_FLAGGEMS. For more details, please refer to the "How to Run Locally" section.

  • Also included are Triton kernels from vLLM, including fused MoE.

Bundle Download

Requested by Cambricon, the file of docker image and model files should be applied by email.

Usage Cambricon
Basic Image basic software environment that supports model running [email protected]
Contact by email,please indicate the unit/contact person/contact information/equipment source/specific requirements
Model model weight and configuration files [email protected]
Contact by email,please indicate the unit/contact person/contact information/equipment source/specific requirements

Evaluation Results

Benchmark Result

Metrics MiniCPM-o 2.6-A100-CUDA MiniCPM-o 2.6-FlagOS-Cambricon
mmmu_val 48.33 48.33
math_vision_test 22.57 23.12
ocrbench_test 85.4 85
blink_val 54.87 55.23
mmvet_v2 59.07 57.35
mmmu_pro_vision_test 70.12 71.04
mmmu_pro_standard_test 30.75 30.29
cmmmu_val 39.11 38.56
cii_bench_test 50.98 49.67

How to Run Locally

πŸ“Œ Getting Started

Environment Setup

# install FlagScale
git clone https://github.com/FlagOpen/FlagScale.git
cd FlagScale
pip install .

# download image and ckpt
flagscale pull --image <IMAGE> --ckpt <CKPT> --ckpt-path <CKPT_PATH>

# Note: For security reasons, this image does not have passwordless configuration. In multi-machine scenarios, you need to configure passwordless access for the image yourself.

# build and enter the container
docker run -e --net=host --pid=host --ipc=host -v /tmp/.X11-unix:/tmp/.X11-unix --privileged -it -v <CKPT_PATH>:<CKPT_PATH> -v /opt/data/:/opt/data/ -v /usr/bin/cnmon:/usr/bin/cnmon --name flagrelease_cambricon <IMAGE> /bin/bash

Download and install FlagGems

git clone https://github.com/FlagOpen/FlagGems.git
cd FlagGems
git checkout minicpm_release_cambricon
# no additional dependencies since they are already handled in the Docker environment
pip install ./ --no-deps
cd ../

Download FlagScale and unpatch the vendor's code to build vllm

git clone https://github.com/FlagOpen/FlagScale.git
cd FlagScale
# please set the name and email in git config in advance, for example: git config --global user.name "your_name"; git config --global user.email "your_email"
python tools/patch/unpatch.py --device-type cambricon_MLU --commit-id 57637057 --dir build
cd build/cambricon_MLU/FlagScale/vllm
pip install -e . -i https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple
cd vllm_mlu
pip install -e . -i https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple
cd ../../

Serve

# config the minicpm yaml
build/cambricon_MLU/FlagScale/
β”œβ”€β”€ examples/
β”‚   └── minicpm/
β”‚       └── conf/
β”‚           └── config_minicpm.yaml # set hostfile, env.sh path and ssh_port(optional), if it is passwordless access between containers, the docker field needs to be removed
β”‚           └── serve/
β”‚               └── minicpm.yaml # set model parameters and server port
# install flagscale
pip install .
# serve
flagscale serve minicpm

Usage Recommendations

When custom service parameters, users can run:

flagscale serve <MODEL_NAME> <MODEL_CONFIG_YAML>

Contributing

We warmly welcome global developers to join us:

  1. Submit Issues to report problems
  2. Create Pull Requests to contribute code
  3. Improve technical documentation
  4. Expand hardware adaptation support

πŸ“ž Contact Us

Scan the QR code below to add our WeChat group send "FlagRelease"

WeChat

License

This project and related model weights are licensed under the MIT License.

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model is not currently available via any of the supported Inference Providers.
The model cannot be deployed to the HF Inference API: The model has no library tag.