CoolFace
Modelpublic

openbmb/BitCPM-CANN-8B-unquantized

sourceHugging Faceapache-2.0updated 4mo agoView on Hugging Face
6likes2.7kdownloads
Model Card

<div align="center"> <img src="https://github.com/OpenBMB/MiniCPM/blob/main/assets/minicpm_logo.png?raw=true" width="500em" ></img> </div>

<p align="center"> <a href="https://github.com/OpenBMB/MiniCPM/" target="blank">GitHub Repo</a> | <a href="https://github.com/OpenBMB/MiniCPM/blob/main/docs/BitCPMCANN.pdf" target="blank">Technical Report</a> </p> <p align="center"> ๐Ÿ‘‹ Join us on <a href="https://discord.gg/3cGQn9b3YM" target="blank">Discord</a> and <a href="https://github.com/OpenBMB/MiniCPM/blob/main/assets/wechat.jpg" target="_blank">WeChat</a> </p>

Overview

BitCPM-CANN-8B-unquantized is the unquantized QAT (Quantization-Aware Training) checkpoint of BitCPM-CANN-8B, designed for continued pre-training and fine-tuning. It preserves full-precision latent weights with ternary fake quantizers (weights โ†’ {-1, 0, 1} with group-wise scaling, trained via STE) defined in modeling.py, enabling the model to keep learning under quantization constraints. For technical details, see our Technical Report.

โš ๏ธ This model is NOT for direct inference. For inference, use the pseudo-quantized version: openbmb/BitCPM-CANN-8B.

Continued Pre-training & Fine-tuning

The only requirement is that the forward pass must go through the bundled modeling.py (which contains the ternary fake quantizer). Load with trust_remote_code=True and do NOT replace or bypass the model's forward logic.

Option 1: DeepSpeed (Recommended)

We provide ready-to-use training scripts in the example directory (using the 1B model as an example):

  • โ€”Continued pre-training: example/run.sh + example/train.py
  • โ€”SFT (Supervised Fine-tuning): example/run_sft.sh + example/train_sft.py

Quick start:

bash
# Continued pre-training
cd example && bash run.sh

# Supervised fine-tuning
cd example && bash run_sft.sh

Option 2: HuggingFace-compatible Frameworks

Any framework that supports HuggingFace model loading with custom code can be used, such as LLaMA Factory, HuggingFace Trainer, etc. The key is to ensure trust_remote_code=True:

python
from transformers import AutoModelForCausalLM, AutoTokenizer

path = 'openbmb/BitCPM-CANN-8B-unquantized'
tokenizer = AutoTokenizer.from_pretrained(path, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
    path,
    torch_dtype=torch.bfloat16,
    trust_remote_code=True
)

# Use with your preferred framework (LLaMA Factory, HF Trainer, etc.)
# The ternary fake quantizer in modeling.py is applied automatically during forward pass.

Post-Training Conversion

After training, use qat-convert.py to fuse the fake quantizer and produce inference-ready pseudo-quantized weights:

bash
python qat-convert.py \
    --input_bin <path-to-finetuned-pytorch.bin> \
    --output <path-to-output-pseudo-quantized-pytorch.bin> \
    --quant_type ternary \
    --group_size -1

The converted model can be loaded for inference in the same way as openbmb/BitCPM-CANN-8Bโ€”no special quantization libraries required.

Workflow

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  BitCPM-CANN-8B-unquantized  โ”‚   โ† This model (QAT checkpoint + fake quantizer in modeling.py)
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                โ”‚
                โ–ผ  Train (DeepSpeed / LLaMA Factory / HF Trainer / ...)
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚   Fine-tuned checkpoint          โ”‚   โ† Still contains un-fused QAT parameters
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                โ”‚
                โ–ผ  python qat-convert.py --quant_type ternary --group_size -1
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  Pseudo-quantized model          โ”‚   โ† Ready for inference (same format as BitCPM-CANN-8B)
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

BitCPM-CANN Model Family

Statement

  • โ€”As a language model, BitCPM-CANN generates content by learning from a vast amount of text.
  • โ€”However, it does not possess the ability to comprehend or express personal opinions or value judgments.
  • โ€”Any content generated by BitCPM-CANN does not represent the viewpoints or positions of the model developers.
  • โ€”Therefore, when using content generated by BitCPM-CANN, users should take full responsibility for evaluating and verifying it on their own.

LICENSE

  • โ€”This repository and BitCPM-CANN models are released under the Apache-2.0 License.

Citation

  • โ€”Please cite our technical report if you find our work valuable.
bibtex
@article{bitcpmcann,
  title={{BitCPM-CANN}: Native 1.58-Bit Large Language Model Training on Ascend NPU},
  author={BitCPM Team},
  year={2026}
}