冬
gcw_IDzXRVNw/Falcon-TST_Large-ascend
Model Introduction
Files & versions
Pull Requests
Discussion
Analysis

Falcon-TST Large 昇腾 NPU 适配部署文档

1. 模型简介

Falcon-TST 是一个大规模时间序列预测基础模型,由 Ant International 开发。该模型采用 Mixture of Experts (MoE) 架构,结合多个 patch tokenizer 实现高效准确的时间序列预测。

模型架构

属性值
模型类型FalconTSTForPrediction
参数量2.49 B
Hidden Size1024
FFN Hidden Size4096
MoE Expert 数量4
Decoder Layers2
Sequence Length2880
多步预测 horizon[24, 96, 336]

模型特点

  • MoE 架构: 混合专家架构,4个本地专家 + 共享专家
  • 多步预测: 支持 24/96/336 三个预测步长的多步预测
  • RevIN: 可逆实例归一化处理非平稳时间序列
  • Patch Tokenizer: 多尺度 patch 划分 (120, 96, 64, 36)

输入输出格式

  • 输入: 时间序列张量 (batch, seq_len=2880, channels=7)
  • 输出: 预测张量 (batch, seq_len, forecast_horizon)

2. 环境依赖清单

2.1 硬件要求

  • 华为昇腾系列 AI 处理器(Ascend 910B/310P 等)
  • 建议 ≥ 8 GB NPU 显存(Falcon-TST 推理峰值约 5-8 GB)
  • 本次实测使用 910B2(单卡 64 GB)

2.2 软件依赖

依赖项版本要求说明
操作系统CentOS 7.6+ / Ubuntu 18.04+支持主流 Linux 发行版
CANN5.0.RC2+华为昇腾计算架构
Python3.10+推荐 3.10+
PyTorch2.0.0+推荐 2.12
torch_npu与 PyTorch 版本匹配昇腾 PyTorch 扩展

2.3 安装方式

conda activate pt2100
pip install transformers -i https://repo.huaweicloud.com/repository/pypi/simple

3. 分步推理操作流程

步骤 1:准备工作目录

cd /workspace/agent4/Falcon-TST_Large-ascend
ls -la /workspace/agent3/ant-intl/Falcon-TST_Large/

步骤 2:检查 NPU 环境

npu-smi info
python -c "import torch; import torch_npu; print('NPU 可用:', torch.npu.is_available())"

步骤 3:运行推理脚本

python inference.py --device npu:0

4. 完整测试用例

测试用例 1:时间序列预测推理(NPU:0)

conda activate pt2100
cd /workspace/agent4/Falcon-TST_Large-ascend
python inference.py --device npu:0

实际输出:

============================================================
Falcon-TST Large 昇腾 NPU 推理
============================================================

[Device] npu:0

[Model Path] /workspace/agent3/ant-intl/Falcon-TST_Large

[Config]
  model_type: FalconTST
  architectures: ['FalconTSTForPrediction']
  hidden_size: 1024
  ffn_hidden_size: 4096
  num_hidden_layers: 2
  num_experts: 4
  seq_length: 2880
  shared_patch_size: 32
  multi_forecast_head_list: [24, 96, 336]

[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.5        41                0    / 0             |
+===========================+===============+====================================================+


[Loading] Falcon-TST model weights...
[Loading] Falcon-TST model from ...ant-intl/Falcon-TST_Large
  Total keys: 286
  Total parameters: 2.49 B

[Model Created] Allocated: 4.96 GB, Reserved: 5.25 GB

[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            | 95.3        41                0    / 0             |
| 0                         | 0000:C1:00.0  | 0           0    / 0          8862 / 65536         |
+===========================+===============+====================================================+
| NPU     Chip              | Process id    | Process name             | Process memory(MB)      |
+===========================+===============+====================================================+
| 0       0                 | 1718721       | python                   | 5492                   |
+===========================+===============+====================================================+


[Running] Falcon-TST 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            | 113.4       41                0    / 0             |
| 0                         | 0000:C1:00.0  | 0           0    / 0          9052 / 65536         |
+===========================+===============+====================================================+
| NPU     Chip              | Process id    | Process name             | Process memory(MB)      |
+===========================+===============+====================================================+
| 0       0                 | 1718721       | python                   | 5682                   |
+===========================+===============+====================================================+


[Results]
  Output shape: torch.Size([1, 2880, 96])
  Output mean: 0.001565
  Output std: 0.167614
  Output min: -0.812344
  Output max: 0.725130

[Memory After Inference] Allocated: 4.96 GB, Reserved: 5.43 GB

[Done]

性能指标

指标值
模型参数量2.49 B
推理显存峰值~5.5 GB
输入 Shape(1, 2880, 7)
输出 Shape(1, 2880, 96)

5. 参考链接

  • Falcon-TST GitHub
  • HuggingFace 模型页