w
gcw_uQ09W7jl/Falcon-TST_Large-NPU
Model Introduction
Files & versions
Pull Requests
Discussion
Analysis

Falcon-TST_Large (NPU)

#NPU — Falcon-TST Large time-series foundation model (MoE architecture) running real forecasting inference on Ascend 910 NPU (npu:0).

  • Model: ant-intl/Falcon-TST_Large (revision at adaptation time)
  • Architecture: FalconTST FalconTSTForPrediction — Mixture-of-Experts (MoE) with 4 patch tokenizers + shared expert, 2 MoE layers × 4 expert transformer layers, hidden_size=1024, 16 heads, 4 experts
  • Params: ~2.49 B (weights ≈ 4.98 GB in BF16, 286 tensors, 2 shards)
  • Task: multivariate time-series forecasting (horizon=336, context=2880, 7 channels)
  • Loading backend: HuggingFace Transformers AutoModel with trust_remote_code=True (official modeling_FalconTST.py / configuration_FalconTST.py)

Model overview

Falcon-TST is a large-scale time-series foundation model that combines a Mixture-of-Experts (MoE) architecture with multiple patch tokenizers. Each expert operates on a different patch size and each sample is routed (top-1) to one expert; a shared expert is always active. RevIN reversible instance normalization is applied before the transformer and reversed after forecasting. The predict(time_series, forecast_horizon) method produces an autoregressive multi-horizon forecast (multi_forecast_head_list = [24, 96, 336]).

This repository contains a self-contained inference.py that loads the official pretrained weights from a local directory and runs real NPU inference. No CUDA-only or flash-attention operators are required — the implementation maps onto standard PyTorch / torch_npu kernels.

Data contract

Validation dataset: ETTh1 (Electricity Transformer Temperature, hourly, public, zhouhaoyi/ETDataset).

ItemValue
SourceETTh1.csv (public ETT dataset)
Rows17425
Channels7 (HUFL HULL MUFL MULL LUFL LULL OT)
Context window2880 time steps
Forecast horizon336 time steps
Batch1
Dtypefloat32 input / output
Splitfixed contiguous window (rows 4000–4415), no shuffle
PreprocessingRevIN applied inside the model on-device

The dataset is real, traceable, and non-overlapping with respect to the forecast window (forecast never crosses the data boundary). Inference uses the same real series for both CPU and NPU runs.

Environment

  • Huawei Ascend 910 (Ascend910_9362), 2 NPUs visible, target device npu:0
  • CANN 8.5.1
  • Python 3.11.14
  • PyTorch 2.9.0 + torch_npu 2.9.0 (torch_npu required only for NPU execution)
  • transformers 4.57.6, einops 0.8.2

Installation

pip install -r requirements.txt
# If torch_npu is not preinstalled, install the build matching your torch version, e.g.:
# pip install torch-npu==2.9.0

NPU inference

Download the pretrained weights once and load them from the local directory (the repository does not bundle the ~5 GB checkpoint):

export HF_ENDPOINT=https://hf-mirror.com   # optional, recommended in CN regions
huggingface-cli download ant-intl/Falcon-TST_Large --local-dir ./model

Run real inference on npu:0 (default command):

python inference.py --model-dir ./model

Example output (truncated):

device:     npu:0  (npu_available=True, count=2)
model:      FalconTST params=2,491,557,824
weights:    first param device=npu:0 dtype=torch.float32
tensors:    input (1, 2880, 7) torch.float32 npu:0
dataset:    ETTh1 (real public series) seq_len=2880 horizon=336 channels=7
output:     forecast (1, 336, 7) float32
metrics:    MAE=1.9690  RMSE=3.2803  (vs true ETTh1 values)
status:     OK  device=npu:0 forecast=(1, 336, 7)

Benchmark mode (>= 10 steady-state iterations):

python inference.py --model-dir ./model --benchmark

Real results (this run)

  • Forecast horizon 336 on 7 ETTh1 channels, NPU (npu:0), fp32
  • MAE vs true: 1.969 , RMSE vs true: 3.280
  • Forecast values are finite and physically plausible (oil temperature scale ~20–40 °C)

CPU–NPU consistency

Both runs use identical weights, inputs, preprocessing, dtype (float32) and random seed, evaluated on the same ETTh1 window.

MetricValue
Forecast max abs error9.82e-5
Forecast mean abs error7.69e-6
Shape(1, 336, 7) == (1, 336, 7)
allclose (atol=1e-3, rtol=1e-2)True

The tiny max absolute error (≈1e-4) is attributable to different accumulation order across hardware; forecasts are numerically consistent between CPU and NPU.

Performance (NPU, fp32, batch=1, context=2880, horizon=336, channels=7)

Measured with torch.npu.synchronize() around every timed iteration; warmup=3, iters=10.

MetricValue
First run (graph compile + inference)70.6 ms
Avg inference71.4 ms
Min / Max70.1 / 75.4 ms
p50 / p90 / p9570.7 / 74.0 / 74.7 ms
Throughput~14.0 windows/s
Peak NPU memory (allocated / reserved)10,864 / 11,240 MB

Timing covers the full autoregressive 336-step forecasting forward pass on NPU. CSV loading and preprocessing are excluded from the timed region.

Evidence

The following images were rendered by xterm.js from this run's real stdout/stderr logs (not fabricated screenshots):

  • assets/agent_workflow.png — environment check, model inspection, CPU baseline, NPU inference, consistency check and benchmark.
  • assets/npu_device_call.png — npu-smi info + check_npu.py + model parameter device/dtype proof.
  • assets/model_result.png — default python inference.py full output with data/schema summary, real forecast, metrics and final status.

Limitations

  • Model weights (~5 GB) and the ETTh1 dataset are not bundled; download them before running.
  • The model requires trust_remote_code=True to load its official remote code (modeling_FalconTST.py, configuration_FalconTST.py); review this code before execution.
  • The demonstration uses the ETTh1 dataset with a single contiguous window; other datasets require adapting the data loader while keeping the column order and horizon semantics.
  • NPU first-call latency includes graph compilation; steady-state latency is reported separately.
  • Peak NPU memory (~11 GB) is within the 64 GB HBM of a single Ascend 910, but larger batch sizes will increase memory usage.