Blog

Alibaba's AI Infrastructure: Architecture, Scale, and Lessons for Engineers

An in‑depth look at Alibaba's AI infrastructure — from custom silicon and high‑performance networking to the Feitian training platform and ModelScope model hub — with practical takeaways for building scalable ML systems.

Alibaba Group operates one of the world’s largest AI infrastructures, powering e‑commerce recommendation, cloud services (Alibaba Cloud), logistics optimization, and large‑language‑model (LLM) research. Understanding its architecture helps engineers design systems that scale from a few GPUs to tens of thousands while keeping cost, latency, and reliability in check.

#Custom Silicon: The Hanguang ASIC Family

Alibaba designs its own AI accelerators under the Hanguang (含光) brand.

Generation Process Peak FP16 TFLOPS Typical Use Case
Hanguang 800 (2019) 12 nm 78 Inference for search, recommendation, image recognition
Hanguang 1000 (2022) 7 nm 200+ Training & inference for LLMs, multimodal models

Key design choices:

  • Domain‑specific tensor cores optimized for BF16/FP8 mixed precision.
  • On‑chip SRAM (up to 128 MiB) to reduce HBM pressure.
  • Chiplet packaging enabling 8‑die modules with 2.5 TB/s interconnect.

Reference: Alibaba Cloud, “Hanguang 1000: A High‑Performance AI Accelerator for Large Models,” Hot Chips 34, 2022.

#High‑Performance Networking: X‑Dragon and RDMA Fabric

Training clusters of >10 k GPUs require a non‑blocking fabric. Alibaba’s X‑Dragon network stack combines:

  1. RoCE v2 over 200 Gbps/400 Gbps Ethernet with PFC/ECN for lossless transport.
  2. Custom congestion control (X‑CC) tuned for all‑reduce traffic patterns.
  3. Topology‑aware scheduling that places parameter‑server shards and workers on the same leaf switch when possible.
graph TD
  A[Worker GPU] -->|RoCE v2| B(Leaf Switch)
  B -->|400Gbps| C(Spine Switch)
  C --> B2(Leaf Switch)
  B2 --> D[Parameter Server]

The result: <1 µs** intra‑rack latency and **>95 % link utilization during synchronous SGD.

#Feitian (飞天) Distributed Training Platform

Feitian is Alibaba’s internal counterpart to NVIDIA’s Megatron‑LM / DeepSpeed. It provides:

  • 3D parallelism (data, tensor, pipeline) with automatic sharding via a graph‑partitioning compiler.
  • Zero‑Redundancy Optimizer (ZeRO‑3)‑style optimizer state partitioning, extended to activation offloading to host DRAM.
  • Elastic scaling: add/remove nodes mid‑job without checkpoint restart, leveraging CRIU‑based process migration.
# Pseudocode: Feitian job launch
from feitian import Trainer, ParallelConfig

cfg = ParallelConfig(
    dp=64, tp=8, pp=4,
    zero_stage=3,
    offload_activations=True
)
trainer = Trainer(model=my_llm, config=cfg)
trainer.fit(train_dataset, epochs=3)

Feitian powers the training of Qwen‑72B and Qwen‑1.5‑110B models on clusters of 3 000+ Hanguang 1000 chips.

#ModelScope: Open Model Hub & Serving Stack

ModelScope (modelscope.cn) is Alibaba’s public model repository and serving framework. It mirrors Hugging Face Hub conventions but adds:

  • Model cards with MLPerf‑style benchmarks (throughput, latency, accuracy).
  • One‑click deployment to Alibaba Cloud PAI‑EAS (Elastic Algorithm Service) using Triton Inference Server + TensorRT‑LLM back‑ends.
  • Fine‑tuning pipelines (LoRA, QLoRA) that run on spot instances with automatic checkpointing.
# Deploy a Qwen‑7B‑Chat model via ModelScope CLI
modelscope deploy \
  --model_id qwen/Qwen-7B-Chat \
  --instance_type ecs.gn7i-c8g1.2xlarge \
  --replicas 3

#Observability & Reliability

  • Metrics: Prometheus + VictoriaMetrics for long‑term storage; custom exporters for Hanguang chip telemetry (temperature, power, SM occupancy).
  • Tracing: OpenTelemetry‑instrumented training loops; trace IDs propagated across parameter‑server RPCs.
  • Chaos engineering: Monthly “Fire Drill” exercises that randomly kill 5 % of workers; Feitian’s elastic recovery validates SLA < 2 min.

#Cost & Energy Efficiency

Alibaba publishes PUE (Power Usage Effectiveness) of 1.15 for its AI data centers (2023 sustainability report). By co‑locating Hanguang ASICs with immersion cooling, they achieve ~2.5× higher FLOPS/W versus comparable GPU‑only racks.

#Key Takeaways for Engineers

  1. Co‑design silicon, network, and software — custom ASICs only pay off when the compiler and runtime exploit their ISA.
  2. Invest in lossless Ethernet (RoCE v2 + ECN) early; it scales cheaper than InfiniBand at >10 k nodes.
  3. Build elasticity into the training framework — node failures are the norm, not the exception, at hyperscale.
  4. Expose hardware telemetry to the scheduler — temperature‑aware placement avoids thermal throttling.
  5. Open‑source the model hub — community feedback accelerates optimization cycles (e.g., TensorRT‑LLM kernels for Qwen).

#Conclusion

Alibaba’s AI infrastructure demonstrates that vertical integration — from custom ASICs through a purpose‑built training framework to an open model hub — can deliver both performance and cost advantages at massive scale. Engineers building next‑generation ML platforms should study the co‑design principles, networking choices, and elasticity mechanisms that make Feitian and ModelScope work reliably across thousands of accelerators.

Share this article