ggg_0963/Olmo-3-1025-7B
模型介绍文件和版本Pull Requests讨论分析
下载使用量0

Olmo-3-1025-7B NPU 适配验证

#+NPU

1. 简介

本仓库记录 Olmo-3-1025-7B 模型在昇腾 NPU 上的适配和验证结果。

  • 模型说明:Olmo-3-1025-7B 是 Allen AI 发布的基于 Olmo3 架构的 70 亿参数语言模型,采用交替滑动窗口和全注意力机制。
  • 权重地址:ModelScope: allenai/Olmo-3-1025-7B
  • 参考文档:vLLM-Ascend

2. 验证环境

组件版本
Python3.11.14
PyTorch2.9.0+cpu
torch_npu2.9.0
transformers4.57.6
vllm-ascend0.18.0rc1
CANN8.5.1
NPU昇腾 910B2
modelscope1.36.3

3. 模型下载

modelscope download --model allenai/Olmo-3-1025-7B

4. 模型架构

参数值
架构Olmo3ForCausalLM
隐藏层大小4096
层数32
注意力头数32(键值头数:32)
中间层大小11008
词表大小100278
总参数量~70亿

5. 基础推理验证

#!/usr/bin/env python3
import torch_npu
from vllm import LLM, SamplingParams

MODEL_PATH = "/home/openmind/volume/modelscope/hub/models/allenai/Olmo-3-1025-7B"

llm = LLM(
    model=MODEL_PATH,
    trust_remote_code=True,
    dtype="float16",
    tensor_parallel_size=1,
    max_model_len=4096,
    gpu_memory_utilization=0.9,
    enforce_eager=True,
)

sampling = SamplingParams(max_tokens=64, temperature=0)
outputs = llm.generate(["The capital of France is"], sampling)
print(outputs[0].outputs[0].text)

冒烟测试结果 (4/4 通过)

测试输入输出
常识推理The capital of France isknown for its rich history and culture, which includes A. A significant number of museums and art galleries.
代码生成def fibonacci(n):if n <= 1
翻译Translate to English: Bonjour le monde, je suis une jeune fille de 18 ans...
数学运算2 + 3 * 4 =14, 2 + 3 + 4 = 9

6. 精度评测

ARC-Challenge 25-shot

指标hardware: NPU (vLLM-Ascend tp=1)基线 (GPU)误差
准确率25.26% (296/1172)26.00%-0.74%
评测时间860s--
吞吐量1.36 samples/s--

7. 性能基准

输入长度 vs 输出吞吐量 (output_len=128, num_prompts=10):

输入长度吞吐量 (tokens/s)
3252.40
12857.52
51259.15
102457.62
204858.04

8. 注意事项

  • 模型为 Olmo3 架构(交替滑动窗口+全注意力),单卡即可加载(~13.7GB)
  • enforce_eager=True 确保在 NPU 上使用 eager 模式
  • 吞吐量约 52-59 tokens/s