Text Generation
Transformers
Safetensors
English
Chinese
qwen3
haidass
npu
bilingual
mindspeed-llm
conversational
text-generation-inference
Instructions to use DALabCommunity/Haidass-143M-v1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use DALabCommunity/Haidass-143M-v1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="DALabCommunity/Haidass-143M-v1") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("DALabCommunity/Haidass-143M-v1") model = AutoModelForCausalLM.from_pretrained("DALabCommunity/Haidass-143M-v1", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use DALabCommunity/Haidass-143M-v1 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "DALabCommunity/Haidass-143M-v1" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "DALabCommunity/Haidass-143M-v1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/DALabCommunity/Haidass-143M-v1
- SGLang
How to use DALabCommunity/Haidass-143M-v1 with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "DALabCommunity/Haidass-143M-v1" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "DALabCommunity/Haidass-143M-v1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "DALabCommunity/Haidass-143M-v1" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "DALabCommunity/Haidass-143M-v1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use DALabCommunity/Haidass-143M-v1 with Docker Model Runner:
docker model run hf.co/DALabCommunity/Haidass-143M-v1
Upload folder using huggingface_hub
Browse files- .gitattributes +1 -0
- README.md +1 -1
- README_ZH.md +141 -0
- logo.png +3 -0
.gitattributes
CHANGED
|
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
logo.png filter=lfs diff=lfs merge=lfs -text
|
README.md
CHANGED
|
@@ -16,7 +16,7 @@ library_name: transformers
|
|
| 16 |
pipeline_tag: text-generation
|
| 17 |
---
|
| 18 |
|
| 19 |
-
#
|
| 20 |
|
| 21 |
A bilingual (English/Chinese) small language model trained entirely on **Huawei Ascend** NPU ecosystem.
|
| 22 |
|
|
|
|
| 16 |
pipeline_tag: text-generation
|
| 17 |
---
|
| 18 |
|
| 19 |
+
# haidass-143M
|
| 20 |
|
| 21 |
A bilingual (English/Chinese) small language model trained entirely on **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end
|
| 9 |
+
- npu
|
| 10 |
+
- 910b
|
| 11 |
+
- atlas-a2
|
| 12 |
+
- bilingual
|
| 13 |
+
- from-scratch
|
| 14 |
+
- mindspeed-llm
|
| 15 |
+
library_name: transformers
|
| 16 |
+
pipeline_tag: text-generation
|
| 17 |
+
---
|
| 18 |
+
|
| 19 |
+
# haidass-143M
|
| 20 |
+
|
| 21 |
+
中英双语小语言模型,在**华为昇腾**生态上进行全流程训练。
|
| 22 |
+
|
| 23 |
+
## 模型简介
|
| 24 |
+
|
| 25 |
+
Haidass-143M 是一个 143M 参数的中英双语语言模型,在约 100B token 的中英文数据上训练完成。模型在华为昇腾生态上进行全流程训练,整体流程基于 **MindSpeed-LLM** 框架和 Atlas A2 服务器(910B)。同时配套训练了大小为 64,000 的中英双语词表。该模型在 150M 以下参数规模的多语言模型中具有较强竞争力,并在多个评测指标中排名靠前。
|
| 26 |
+
|
| 27 |
+
## 模型架构
|
| 28 |
+
|
| 29 |
+
| 参数 | 值 |
|
| 30 |
+
|------|-----|
|
| 31 |
+
| 架构 | Qwen3 |
|
| 32 |
+
| 层数 | 30 |
|
| 33 |
+
| 隐层维度 | 576 |
|
| 34 |
+
| 注意力头数 | 9 |
|
| 35 |
+
| KV 头数 (GQA) | 3 |
|
| 36 |
+
| 头维度 | 64 |
|
| 37 |
+
| FFN 中间维度 | 1,536 |
|
| 38 |
+
| 词表大小 | 64,000 |
|
| 39 |
+
| 最大序列长度 | 4,096 |
|
| 40 |
+
| 绑定嵌入 | 是 |
|
| 41 |
+
| 激活函数 | SwiGLU (SiLU) |
|
| 42 |
+
| 归一化 | RMSNorm (eps=1e-6) |
|
| 43 |
+
| 位置编码 | RoPE (θ=100,000) |
|
| 44 |
+
| 注意力偏置 | 无 |
|
| 45 |
+
| 精度 | BF16 |
|
| 46 |
+
| 总参数量 | ~143M |
|
| 47 |
+
|
| 48 |
+
## 训练数据
|
| 49 |
+
|
| 50 |
+
模型在约 100B token 的中英文混合数据上训练。主要数据来源为:
|
| 51 |
+
|
| 52 |
+
- [openbmb/Ultra-FineWeb](https://huggingface.co/datasets/openbmb/Ultra-FineWeb) (ultrafineweb-en + ultrafineweb-zh)
|
| 53 |
+
- [mlfoundations/dclm-baseline-1.0-parquet](https://huggingface.co/datasets/mlfoundations/dclm-baseline-1.0-parquet) (dclm)
|
| 54 |
+
- [HuggingFaceTB/finemath](https://huggingface.co/datasets/HuggingFaceTB/finemath) (finemath-4plus)
|
| 55 |
+
|
| 56 |
+
|
| 57 |
+
## 训练配置
|
| 58 |
+
|
| 59 |
+
| 参数 | 值 |
|
| 60 |
+
|------|------|
|
| 61 |
+
| 框架 | MindSpeed-LLM (v2.3.0) |
|
| 62 |
+
| 硬件 | 8 台 Atlas A2 服务器 (每台 8 卡 NPU,256 核) |
|
| 63 |
+
| NPU 型号 | 华为昇腾 910B |
|
| 64 |
+
| 总 NPU 数 | 64 (8 节点 × 8 卡) |
|
| 65 |
+
| 张量并行 | 1 |
|
| 66 |
+
| 流水线并行 | 1 |
|
| 67 |
+
| 数据并行 | 64 |
|
| 68 |
+
| 微批次 | 2 |
|
| 69 |
+
| 全局批次 | 128 |
|
| 70 |
+
| 序列长度 | 4,096 |
|
| 71 |
+
| 每迭代 token 数 | 524,288 |
|
| 72 |
+
|
| 73 |
+
|
| 74 |
+
## 优化器
|
| 75 |
+
|
| 76 |
+
| 参数 | 值 |
|
| 77 |
+
|------|------|
|
| 78 |
+
| 优化器 | AdamW |
|
| 79 |
+
| 峰值学习率 | 3e-4 |
|
| 80 |
+
| 最低学习率 | 0 |
|
| 81 |
+
| 权重衰减 | 1e-5 |
|
| 82 |
+
| 梯度裁剪 | 2.0 |
|
| 83 |
+
| Adam β1 | 0.9 |
|
| 84 |
+
| Adam β2 | 0.95 |
|
| 85 |
+
| 初始 loss scale | 4,096 |
|
| 86 |
+
| 随机种子 | 42 |
|
| 87 |
+
|
| 88 |
+
## 词表
|
| 89 |
+
|
| 90 |
+
| 属性 | 值 |
|
| 91 |
+
|------|------|
|
| 92 |
+
| 类型 | SentencePiece BPE |
|
| 93 |
+
| 词表大小 | 64,000 |
|
| 94 |
+
| 语言覆盖 | 英文 + 中文 |
|
| 95 |
+
|
| 96 |
+
## 测评与对比(补)
|
| 97 |
+
|
| 98 |
+
在 checkpoint (iter 188,000, ~98B tokens) 上基于 lighteval 框架(v0.9.2)测评。
|
| 99 |
+
|
| 100 |
+
| Benchmark | Score |
|
| 101 |
+
|------|------|
|
| 102 |
+
| ARC-Easy | 60.44 |
|
| 103 |
+
| ARC-Challenge | 27.13 |
|
| 104 |
+
| PIQA | 67.25 |
|
| 105 |
+
| HellaSwag | 37.91 |
|
| 106 |
+
| OpenBookQA | 31.8 |
|
| 107 |
+
| Winogrande | 52.17 |
|
| 108 |
+
| agi_eval | 23.78 |
|
| 109 |
+
|
| 110 |
+
## 核心特点
|
| 111 |
+
|
| 112 |
+
- **全昇腾原生**: 完全在华为昇腾 910B NPU 上训练,使用 MindSpeed-LLM 框架
|
| 113 |
+
- **中英双语**: 模型基于中英混合数据集训练
|
| 114 |
+
|
| 115 |
+
|
| 116 |
+
## 预期用途
|
| 117 |
+
|
| 118 |
+
本模型为研究型模型,适用于:
|
| 119 |
+
- 研究小模型在昇腾 NPU 上的训练动态
|
| 120 |
+
- 中英文语言建模研究
|
| 121 |
+
- 作为后续微调或退火实验的基础模型
|
| 122 |
+
|
| 123 |
+
## 局限性
|
| 124 |
+
|
| 125 |
+
- 模型规模较小,推理和生成能力有限
|
| 126 |
+
- 未经过指令微调 — 仅为原始预训练模型
|
| 127 |
+
- 未经过 RLHF 或对齐训练
|
| 128 |
+
|
| 129 |
+
## Citation
|
| 130 |
+
|
| 131 |
+
```bibtex
|
| 132 |
+
@misc{haidass-143m,
|
| 133 |
+
title={haidass-143M: A Bilingual Small Language Model Trained on Ascend 910B},
|
| 134 |
+
year={2026},
|
| 135 |
+
note={Based on Qwen3 architecture, trained from scratch on 100B tokens using MindSpeed-LLM on 64× Ascend 910B NPUs}
|
| 136 |
+
}
|
| 137 |
+
```
|
| 138 |
+
|
| 139 |
+
## License
|
| 140 |
+
|
| 141 |
+
Apache 2.0
|
logo.png
ADDED
|
Git LFS Details
|