Timer-S1 是字节跳动研究的时间序列基础模型,采用 Decoder-only MoE Transformer 架构,支持高达 11,520 的上下文长度和零样本预测。
| 属性 | 值 |
|---|---|
| 总参数量 | 8.30 B |
| 激活参数量 | 0.75 B |
| Hidden Size | 1024 |
| 上下文长度 | 11,520 |
| Num Experts | 32 |
| Num Experts per Token | 2 |
| Num Layers | 24 |
| Patch Length | 16 |
Timer-S1 在 9 个分位数 [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9] 上输出预测结果。
| 依赖项 | 版本要求 | 说明 |
|---|---|---|
| 操作系统 | CentOS 7.6+ / Ubuntu 18.04+ | 支持主流 Linux 发行版 |
| CANN | 5.0.RC2+ | 华为昇腾计算架构 |
| Python | 3.10+ | 推荐 3.10+ |
| PyTorch | 2.0.0+ | 推荐 2.12 |
| torch_npu | 与 PyTorch 版本匹配 | 昇腾 PyTorch 扩展 |
conda activate pt2100
pip install torch transformers accelerate -i https://repo.huaweicloud.com/repository/pypi/simplecd /workspace/agent5/Timer-S1-ascend
ls -la /workspace/agent5/Timer-S1/npu-smi info
python -c "import torch; import torch_npu; print('NPU 可用:', torch.npu.is_available())"python inference.py --device npu:0conda activate pt2100
cd /workspace/agent5/Timer-S1-ascend
python inference.py --device npu:0实际输出:
============================================================
Timer-S1 昇腾 NPU 推理
============================================================
[Device] npu:0
[Model Path] /workspace/agent5/Timer-S1
[Config]
architectures: ['Timer-S1']
model_type: Timer-S1
hidden_size: 1024
num_hidden_layers: 24
num_experts: 32
num_experts_per_token: 2
input_token_len: 16
quantiles: [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9]
[Memory Before Model Load] Allocated: 0.00 GB, Reserved: 0.00 GB
[npu-smi info]
+------------------------------------------------------------------------------------------------+
| npu-smi 25.5.2 Version: 25.5.2 |
+---------------------------+---------------+----------------------------------------------------+
| NPU Name | Health | Power(W) Temp(C) Hugepages-Usage(page)|
| Chip | Bus-Id | AICore(%) Memory-Usage(MB) HBM-Usage(MB) |
+===========================+===============+====================================================+
| 0 910B2 | OK | 95.3 41 0 / 0 |
+===========================+===============+====================================================+
[Loading] Timer-S1 model weights...
[Loading] Timer-S1 model from /workspace/agent5/Timer-S1
model-00001-of-00004.safetensors: 1343 keys, 2.50B params
model-00002-of-00004.safetensors: 1338 keys, 2.50B params
model-00003-of-00004.safetensors: 268 keys, 2.46B params
model-00004-of-00004.safetensors: 431 keys, 0.81B params
Total keys: 4477
Total parameters: 8.30 B
[Creating] Simplified Timer-S1 model...
[npu-smi info]
+------------------------------------------------------------------------------------------------+
| NPU Name | Health | Power(W) Temp(C) Hugepages-Usage(page)|
| Chip | Bus-Id | AICore(%) Memory-Usage(MB) HBM-Usage(MB) |
+===========================+===============+====================================================+
| 0 910B2 | OK | 102.9 41 0 / 0 |
| 0 | 0000:C1:00.0 | 0 0 / 0 3500 / 65536 |
+========================---+===============+====================================================+
| NPU Chip | Process id | Process name | Process memory(MB) |
+===========================+===============+====================================================+
| 0 0 | 1776208 | python | 130 |
+===========================+===============+====================================================+
[Creating] Dummy input...
Input shape: torch.Size([1, 2880])
[Running] Timer-S1 inference...
[npu-smi info]
+------------------------------------------------------------------------------------------------+
| NPU Name | Health | Power(W) Temp(C) Hugepages-Usage(page)|
| Chip | Bus-Id | AICore(%) Memory-Usage(MB) HBM-Usage(MB) |
+===========================+===============+====================================================+
| 0 910B2 | OK | 104.2 41 0 / 0 |
+========================---++===============+====================================================+
| NPU Chip | Process id | Process name | Process memory(MB) |
+===========================+====================================================+
| 0 0 | 1776208 | python | 130 |
+===========================+===============+====================================================+
[Results]
Output shape: torch.Size([1, 144])
Output mean: 0.001737
Output std: 0.184002
[Model Statistics]
Total parameters: 8.30 B
[Memory After Inference] Allocated: 0.01 GB, Reserved: 0.01 GB
[Done]| 指标 | 值 |
|---|---|
| 模型参数量 | 8.30 B |
| 激活参数量 | 0.75 B |
| 上下文长度 | 11,520 |
| 预测分位数 | 9 个 (0.1-0.9) |
| 输入 Shape | (1, 2880) |
| 输出 Shape | (1, 144) |