AI guides

Inside openPangu’s Ascend 950 work: where the 24% training gain comes from

By 陈陈、Panda0 viewsSource: 机器之心
openPangu reports Ascend 950 training and inference gains: 24% higher MXFP8 throughput for a 505B model

A 505B MoE gains 24% training throughput with MXFP8 versus BF16 under matching parallelism. We retain the training, agent-inference and recommendation details, including mixed precision, caches, device counts, speculation and release scope.

openPangu has detailed training and inference optimizations for Ascend 950. On a 1,024-rank cluster, its 505B MoE model using mixed MXFP8 achieved 24% higher throughput than BF16 under the same parallel configuration and 51% MFU. These figures apply to a particular model and setup, not every domestic model or workload.

This article separates training, agent inference and generative recommendation while retaining the engineering details of quantization, communication, scheduling and caching. Results are team-reported; AINRK did not reproduce them on a cluster. Claims of being first are not treated as an exhaustive industry comparison.

On December 1, DeepSeek announced the release of production-grade DeepInfer inference code for Huawei Ascend, covering core operators, communication and memory management, inference workflows, and task scheduling. The public version provides offline inference; some components needed for a complete online service remain unreleased.

More notably, DeepSeek disclosed that DeepSeek V4.1 Flash deployed on Ascend 950 is already serving substantial live user traffic. With an average input length of about 98K tokens, P50 time to first token is 277ms and single-stream output speed reaches 138 tokens/s.

Article illustration

DeepSeek’s deployment and openPangu’s disclosure address different systems. The former reports online service, while the latter covers training, general inference and recommendation. Their measurements should not be mixed into one comparison.

Code and reports are being released in stages. Internal production deployments, currently downloadable implementations and components still in development need to be distinguished.

The training report describes a one-trillion-token run without pronounced loss spikes or divergence, with approximately 0.16% mean relative loss difference from BF16. It does not reduce every operation to eight bits: major matrix calculations use low precision while sensitive components retain higher precision.

Inference work covers HiF8, MXFP8, MXFP4 and four-bit coordination of selected weights, activations and caches. An unchanged average does not mean every benchmark is unchanged. Sensitive layers and rotary cache components retain BF16, and some four-bit acceleration kernels remain under development.

The system work targets first-token latency, per-token latency and concurrent throughput separately. The later sections retain device counts, sequence lengths, cache state and speculation settings rather than treating minimum single-request latency as a concurrent result.

Generative recommendation focuses on Beam Search, user-history caches and scheduling. The team reports 27ms and 114ms end-to-end latency for 1K and 10K sequences with a 1B model and Beam=128 on Ascend 950. The public entry point is offline inference, not the complete internal online service.

Article illustration

Training: preserve convergence, then address communication and scheduling

Low-precision training stores parameters and performs computation with fewer bits—for example, reducing traditional 16-bit BF16 to 8 bits or even 4 bits. It is a key route to reducing accelerator-memory use and overcoming computing bottlenecks.

But practical implementation is difficult: quantization errors can accumulate over long training runs and cause divergence. Once matrix computations accelerate, data movement, communication waits, and scheduling overhead quickly become new weak points.

The disclosure combines precision control, whole-model scheduling and hardware-aware operators. The following sections examine numerical stability, training throughput and on-chip optimization.

Combining MXFP8 and BF16 to assign suitable precision to different modules

Low-precision training can reduce resource overhead and improve efficiency, but numerical errors can also affect convergence stability.

To address this, openPangu's in-house training framework uses mixed MXFP8 and BF16 precision. MXFP8 is enabled for forward and backward matrix multiplication in the main linear layers, routed experts, and shared experts, while precision-sensitive modules such as Embedding, LM-Head, Router, FlashAttention, RMSNorm, SwiGLU, and mHC retain their original precision.

Article illustration

Mixed-precision scheme

The scheme also introduces two levels of precision control:

  • The first selects the scope of low-precision computation by Transformer layer index.
  • The second uses module names within each layer and an allowlist to decide whether to enable low precision. Modules not on the allowlist retain their original precision settings.

This design has two benefits: low-precision coverage can be expanded gradually, and if a module shows numerical anomalies, its specific computation path can be adjusted without reverting the entire model.

Quantization itself also requires fine-grained control.

MXFP8 uses block-shared scaling factors, with multiple elements in a data block sharing one factor. If the factor is inappropriate, larger values can saturate or overflow.

The team addresses this by rounding scaling factors upward, reducing numerical clipping risks from insufficient scaling.

It also monitors precision at the matrix-multiplication level. Beyond overall loss, it separately tracks underflow rates, mean squared error (MSE), and normalized root mean squared error (NRMSE) for the left and right operands, linking results to specific modules, training stages, and operands.

This adds a more detailed numerical-monitoring system to low-precision training. When problems arise, the team can locate error sources more quickly and adjust precision settings for particular modules.

Training on 1T tokens: MXFP8 and BF16 show similar convergence

The team compared MXFP8 mixed-precision convergence against a BF16 baseline.

Both experiments' losses initially fell rapidly and then gradually entered stable convergence. No obvious loss spikes or divergence were observed within the tested interval. MXFP8's average relative loss deviation from BF16 was only 0.16%.

Downstream evaluations gave similar results. At the 537B-, 738B-, and 906B-token checkpoints, the MXFP8 model's average downstream-task score was slightly higher than the BF16 baseline. Overall evaluation performance was essentially consistent across the three checkpoints, with no continuing degradation as training progressed.

Article illustration

Model training-loss curves

The team also explored lower-bit MXFP4 quantization-aware training (QAT). Its average relative loss deviation from the MXFP8 baseline was about 0.173%, remaining stable over the observed interval.

This experiment shows that, within the quantization scope and training configuration tested, MXFP4 weight quantization can be incorporated into the existing training path while maintaining convergence close to the MXFP8 baseline.

A 505B MoE model: 24% higher FP8 training performance

Turning low precision into actual production efficiency also requires addressing communication, accelerator memory, and operator-scheduling overhead across the full model.

The team used openPangu-2.0-Pro, a 505B MoE model, with the following configuration:

Article illustration

With the same parallelism configuration, the MXFP8 training scheme increased throughput by 24% over BF16, reaching full-model MFU of 51%.

Article illustration

End-to-end training performance results

A closer breakdown identifies low-precision matrix computation as an important source of performance gains.

Switching from BF16 to MXFP8 yielded compute-only speedups of 1.98× for routed-expert grouped matrix multiplication (GMM) and 1.96× for ordinary matrix multiplication (MM). Even including quantization overhead, speedups remained 1.83× and 1.79×, respectively.

Once matrix multiplication becomes faster, however, overhead elsewhere stands out more. Data movement, collective communication, kernel launches, and optimizer computation can all become new bottlenecks.

The team therefore optimized multiple layers around Ascend 950's hardware characteristics.

First, low-precision weights remain resident. The framework keeps FP32 master weights for optimizer updates while retaining MXFP8 model weights on-chip, reusing them across forward and backward computations for multiple microbatches rather than requantizing before every matrix operation.

Second, quantized data is communicated on demand. Forward and backward computation require different quantized components of the resident MXFP8 weights. Sending both complete sets of quantized data and scaling factors every time could actually exceed the communication volume of one copy of BF16 weights. The framework therefore gathers only the data needed for each computation direction, avoiding redundant transmission.

For activations and output gradients, the team designed split communication of bidirectionally quantized data. Under combined TP and SP parallelism, the quantized data needed for forward and backward passes is transmitted separately according to their dependencies. Asynchronous communication overlaps with computation to reduce waits.

The optimizer is also specially designed. Muon's Newton-Schulz orthogonalization requires complete momentum matrices. The team assigns each complete matrix to a designated rank for orthogonalization, then broadcasts the result, reducing Newton-Schulz computation time by about 70%.

For operator scheduling, AutoFuse fuses multiple small operators into a single launch. With MoE Router enabled, full-model kernel launches fall by 7.7% and end-to-end performance improves by 3%.

MegaMoE is particularly noteworthy.

MoE computation comprises dispatch, expert matrix multiplication, activation, and combine stages. Traditionally, these execute sequentially, often leaving compute units waiting for communication and communication units waiting for computation.

MegaMoE organizes the stages in one kernel, coordinating communication and computation and splitting large tasks into fine-grained pipelines to reduce waits between stages.

With MXFP8, enabling MegaMoE raises MFU from 46% to 51% and increases full-model throughput by 10.9%.

To address memory-access pressure from Engram's large embedding table, the team also uses Ascend 950 supernode pooling to manage CPU-side DRAM and NPU-side HBM together. One-sided communication directly reads target embedding vectors, reducing All-Gather and All-to-All communication. Engram forward time falls from 0.93ms to 0.39ms, a 2.38× speedup; backward time falls from 1.5ms to 1.0ms, a 1.5× speedup.

Bringing hardware characteristics inside the operators

Beyond full-model scheduling, Ascend 950's internal chip design creates new opportunities for operator optimization.

Ascend 950 adds a high-speed data-exchange path between Cube Cores and Vector Cores, allowing matrix and vector computations to pass data directly and reducing the overhead of going through GM. A new collective-communication engine, CCU, handles collective operations, reducing their use of system-bus bandwidth and AI Core resources.

The openPangu team specifically optimized mHC, the DSA Indexer, and HCCL communication in Pangu models.

For example, mHC is an important component for expanding residual streams, accounting for more than 7% of computation in the Pangu model and involving substantial Vector computation.

The team divides it into three stages: mHC Pre, mHC Post, and mHC Sinkhorn, with six forward and backward operators in total, then optimizes them through Cube-Vector paths and multi-stream parallelism.

mHC Sinkhorn can be separated independently, running Cube-type operators in parallel with Vector computation to hide 100% of the associated Vector latency. mHC Pre and mHC Post use fine-grained pipelines, data reuse, and Cube-Vector fusion to reduce data movement.

For the mHC Post backward pass, the team also supplements Vector with Cube, moving some Vector operations to Cube to unlock more of Ascend's computing capacity.

Ultimately, mHC-related operator performance improves by 26%–163%, delivering about a 3% full-model performance gain.

The DSA Indexer handles a large QK matrix, frequent transfers and Top-K sorting. Direct L0C-to-UB transfer, resident queries and double-buffered key blocks reduce intermediate and repeated movement.

Compare+Select filters smaller values before sorting, reducing the Top-K candidate set. The report gives over 1.35× operator performance and over 3% whole-training improvement. Operator gains and end-to-end gains are different measures.

For communication, the team prioritizes the longer-running EP and TP communication domains for CCU based on Pangu's parallelism strategy, and improves dynamic allocation and reuse of CCU resources during communication. These changes further exploit Ascend 950's collective-communication capabilities.

Inference: quantization, Prefill and Decode have distinct constraints

As large models enter agent applications such as coding, debugging, and multi-step tool use, inference-system challenges are changing. A complex agent task often involves multiple rounds of model inference and tool calls, with latency accumulating under serial execution.

Quantization reduces selected storage and computation, caching avoids repeated context processing, and stream and communication scheduling address remaining waits. Their gains cannot simply be added together.

Low precision does not put every component into four bits

The scheme covers HiF8, MXFP8 and MXFP4 and explores W4A4C4 coordination. The name identifies an optimization direction; the mixed-precision policy determines which layers and cache components actually use it.

The team uses mixed precision: some precision-sensitive projection layers that are not major performance bottlenecks retain BF16, while the other main matrix multiplications and expert computations use low-precision formats.

Huawei's HiF8 uses flexible numerical encoding to balance precision and dynamic range. Its average score is no lower than BF16 in the team's listed evaluations, although some individual scores fall. MXFP8 uses block quantization with one shared scaling factor per 32 elements to accommodate different numerical distributions across blocks. The team also fuses normalization, activation, and quantization to reduce intermediate reads and writes and separate operator calls.

For lower-bit MXFP4, the team proposes SoScale, using second-order information to search quantization scales and compensate errors during block-by-block quantization. Optional Hadamard rotation further improves low-bit quantization accuracy.

Non-rotary KV components can use low-bit quantization while rotary components retain BF16; the Lightning Indexer also explores low bits. A four-bit value uses one-quarter of BF16’s value width, but total storage also contains BF16 portions, scale factors and other overhead. Total KV storage is not necessarily one-quarter.

The report lists some four-bit acceleration kernels as development work. Current accuracy testing can dequantize to BF16 outside a fused attention kernel. Accuracy feasibility is different from a fully accelerated implementation.

Relative to BF16, the table gives average absolute score differences of +0.4 for HiF8 and +0.36 for MXFP8 (W8A8C8), each with some declining individual results. W4A4LI4KV4 averages −0.07 points. These are absolute score differences, not proof that every task is lossless or declines by less than one percent.

Article illustration

For deployment, the team separates prefill and decode into independently deployed stages, combining hybrid parallelism, shared caching, and full-graph replay to reduce time to first token.

Prefill optimization: reducing repeated computation around KV Cache

In multi-turn agent scenarios, many requests repeatedly include conversation history and task context. These have often already been computed for earlier requests. Reprocessing them every time increases prefill computation and time to first token.

The openPangu team therefore focuses prefill optimization on KV Cache, combining hybrid parallelism, shared caching, and full-graph replay to reduce repeated computation and communication waits.

First, hybrid parallelism and multi-stream scheduling.

The team tailors parallelism to different attention modules. Sequence parallelism (SP) is used between Transformer layers; DSA uses context parallelism (CP) over query tokens; SWA uses tensor parallelism (TP) over attention heads.

Multi-stream scheduling further overlaps convolution computation with state AllGather, and shared-expert computation with ReduceScatter of routing results, reducing communication waits and improving compute utilization.

Second, a shared KV cache pool.

KV Offload saves reusable cache blocks in host memory, while a shared cache pool is built on Fusion Pool. Four prefill nodes each contribute 1TB, creating a 4TB shared KV cache pool.

The shared pool also requires deciding which node should handle each request. Cache-aware routing jointly considers cache-read cost, remaining computation, and instance load to select an execution node, maximizing existing-cache reuse and reducing recomputation and queuing.

Finally, full-graph replay for short prefill sequences.

At a target QPS of 4, the team found that 77.3% of requests had fewer than 1,024 uncached tokens. After historical KV reuse, many remaining prefill sequences were therefore already short. Computation itself took less time, making per-operator launch overhead more prominent.

The team includes qualifying pure-prefill batches in full-graph replay, reducing per-operator scheduling overhead through graph execution. In a dedicated test, the smallest short-prefill configuration achieved a 3.47× single-step speedup.

The multi-turn agent test uses 40 devices in 4P8+1D8: 32 for Prefill and eight for Decode. It warms up with 2,000 requests and then sends 10,156 measured requests at target QPS=4.

For that workload, mean client TTFT is 341.56ms and prefix-cache hit rate is 93.74% of input tokens. Cache state and repeated-request structure are part of the result.

Article illustration

From parallel computation and shared caching to short-sequence full-graph replay, openPangu's KV-centered prefill optimizations reduce repeated computation of historical context and turn cache-reuse gains into lower time to first token.

Decode optimization: improving single-request latency and multi-request throughput

Optimization goals change again during decode.

With concurrent requests, the system must improve aggregate throughput while maintaining responsiveness. For ultra-low-latency single requests, it must concentrate compute resources as much as possible and reduce task launches, data movement, and synchronization waits.

The team therefore uses different parallelism strategies for the two cases.

For low latency and high throughput, attention uses data parallelism (DP), with each card independently handling its assigned requests. MoE uses expert parallelism (EP), distributing experts across devices.

For ultra-low-latency single requests, tensor parallelism (TP) distributes attention, output projections, and feed-forward computation across cards, combining results through AllReduce.

Single-request decode has a small computational workload, making task-launch, data-movement, and synchronization overhead more pronounced. The team therefore focuses on fusing Vector computations to reduce memory accesses and running independent tasks in parallel.

For example, ConvQuant moves quantization into the convolution output stage, reducing intermediate handoffs. ConvRMSNormQuant fuses convolution, normalization, and quantization to reduce cross-core reduction overhead. InitRoutingV3 Flash builds small routing tables inside each core to reduce inter-core waits. SwiGLURotateQuant fuses activation, Hadamard rotation, and quantization.

For long-context retrieval, the team also designed a QLI MXFP4 pipeline combining MXFP4 matrix multiplication, BF16 result transfer, and streaming Top-K to optimize MTP7 decode.

Multi-stream scheduling is carefully designed as well. Based on computational dependencies, queries, indexing, and KV preparation are split across different streams, with Cube and Vector core resources allocated to separate branches so independent computations can run together.

For communication, Ascend 950's CCU handles collectives. The team replaces existing calls with out-of-place AllReduce better suited to the hardware pipeline. In ultra-low-latency tests, a single AllReduce falls from 20μs to 10μs.

The team ultimately obtains two representative sets of results in different scenarios.

The single-request test uses eight devices, 8,192 input tokens, 1,024 output tokens and MTP7. Mean latency is 2.03ms per token, approximately 493 tokens/s, with some queries reaching 1.77ms.

Speed depends on speculative acceptance; the reported test averages about 5.49 accepted tokens. It is not a fixed output speed for any prompt.

Article illustration

The multi-request test uses 32 devices, 131,072 input tokens, 1,024 output tokens and MTP7. Forced EPLB produces 2,740 tokens/s/device. The report warns that forcing EPLB affects real speculative acceptance; this configuration averages about 5.88 accepted tokens and should be adjusted for actual datasets.

Article illustration

Generative recommendation: candidate paths and user history

Recommendation systems are core infrastructure for internet platforms. In recent years, generative recommendation (GR) has brought large models into recommendation pipelines, autoregressively generating candidate items' semantic IDs through beam search. This improves models' representational and generative capabilities but also places greater demands on inference systems.

Generative recommendation has more distinctive business requirements than conventional large-model question answering. Models must explore multiple candidate paths through beam search, with wider beams increasing computation. Recommendation systems must also continually process many users' historical behavior sequences and maintain their KV caches, potentially reaching petabyte scale. They face demanding latency and concurrency requirements: user requests must return quickly while chip utilization is maximized.

General-purpose large-model inference frameworks struggle to meet these needs directly.

To address this, the openPangu team introduced openPangu-GenRec-Infer, built on the open-source vLLM inference architecture and Mooncake pooling engine. It designs three dedicated modules around generative recommendation's computation, scheduling, and cache requirements, handling inference-engine optimization, compute-resource scheduling, and large-scale cache management, respectively.

Article illustration

According to the team's technical report, the system has been deployed in terminal-cloud production services. In its listed comparisons using the same hardware and requests, end-to-end latency falls by more than 90% relative to the adapted baseline. Several core innovations have been merged into the jointly developed open-source vLLM-GR project. The current public repository supports offline inference and does not contain a complete online service.

Compute reusable history before the online request

General inference often separates Prefill and Decode onto different machines. Recommendation exploits comparatively stable user history by computing some KV ahead of time and reusing it when a request arrives. This is temporal decoupling, not only a physical split.

Article illustration

KV work is arranged as nearline asynchronous computation and history reuse. The online window reads caches and decodes. Benefits depend on history updates, freshness, hits and transfer costs; not every request can be assumed to need no Prefill.

GR-Engine: reducing redundant computation in beam search

Beam search is important in generative recommendation. Traditional implementations may issue separate requests for different beams, scheduling and preprocessing/postprocessing them independently, creating substantial redundancy.

GR-Engine first divides KV Cache into Prompt KV shared by all beams and Beam KV unique to each beam. Attention computes the two portions separately, then merges them blockwise through online softmax, reducing repeated computation.

For postprocessing, the team replaces serial decoding of individual candidate sequences with parallel processing, reducing waits when handling candidate results.

The team also designs Dynamic Constrained Beam Search. Recommendation cannot invent arbitrary "words"; it must show real, valid items that satisfy business rules.

A prefix table retains paths corresponding to valid catalogue items at each step. Layers can use different beam widths, such as 128, 256 and 512. The aim is to reduce invalid expansion while retaining useful candidates, which still needs assessment against the actual catalogue and business rules.

Traditional batching wastes compute on padding because users' history lengths vary widely. GR-Engine instead uses compact Jagged packing into graph-size buckets. Like assembling building blocks, it concatenates variable-length sequences end to end, adding only a little padding at the end of the combined sequence to match static graph shapes, substantially reducing unnecessary computation.

GR-Scheduler: keeping limited compute busy

Generative-recommendation models are relatively small. One inference call may not provide enough computation to fill an NPU's AI Cores, leaving considerable hardware resources idle.

GR-Scheduler uses core-limited multi-stream parallelism on a single card, partitioning NPU AI Cores into independent groups, each bound to an inference stream. The scheduler dynamically assigns tasks to idle streams according to real-time load.

In 1B-model tests, MatMul Cube utilization improves by 24.7% and Mul Vector utilization by 7.4%.

The team also introduces asynchronous scheduling, passing data between iterations directly inside the NPU rather than incurring the overhead of returning it to the CPU and sending it back.

Sampling results return asynchronously through a separate data-copy stream, overlapping CPU-side scheduling preparation with NPU forward computation as much as possible and reducing device idle time between inference steps.

This optimization reduces per-step inference latency by 20%.

GR-Cache: storing and transferring petabyte-scale cache

For generative recommendation, KV Cache is more than temporary computation data; it is an important foundation for reusing users' histories.

Managing cache by physical blocks can readily create fragmentation and scheduling overhead.

GR-Cache manages a user’s complete history as one allocation and eviction unit rather than scattered physical blocks, reducing block fragmentation and scheduling steps.

Keeping a user’s KV on one node also supports affinity scheduling in a memory pool. The granularity still needs to match history lengths and eviction requirements.

Building on this, EKPool brings embeddings and KV Cache into a unified pooling-management framework.

By coordinating transfer workflows for both caches, EKPool reduces redundancy from separate scheduling, further lowering end-to-end latency by 30%–40%.

For scattered paged-KV transfers, the team also designs the LiteTransfer aggregated-transfer scheme, moving all blocks of each layer in one batched call. Bandwidth improves by 12% for small transfers with 128KB block size and by 34% for large transfers with 1024KB blocks.

Together, these optimizations produce substantial gains for openPangu-GenRec-Infer on both Ascend A2 and Ascend 950.

On Ascend 950, the openPangu 1B model with beam width 128 achieves end-to-end latency of 27ms and 114ms for 1K and 10K sequences. Compared with adapted baselines of 403ms and 1709ms, both represent latency reductions of approximately 93.3%.

On Ascend A2 under the same configuration, 1K and 10K latency reaches 46ms and 261ms. Compared with adapted baselines of 822ms and 3951ms, the reductions are approximately 94.4% and 93.4%, respectively.

Article illustration

These results show openPangu's optimizations moving beyond the model's inference speed alone, redesigning inference systems around real recommendation workloads' request patterns, cache structures, and scheduling needs.

How to read the performance figures

The shared approach is to consider model structure and chip properties together rather than only switch numeric formats. Training computation, communication and optimization, inference cache and speculative acceptance, and recommendation beams and history all affect end-to-end outcomes.

Comparisons should first align model, hardware, device count, precision, sequence lengths and baseline, then inspect warm-up, repeated requests, load balancing and speculation. An operator speedup is not automatically a whole-model gain.

Reports, public code and future work must remain distinct. DeepInfer does not expose its full KV-cache and load-balancing components, and GenRec’s current entry point is offline. Reuse on another model or workload requires testing.

Finally, some reference links:

Collection of openPangu open-source repositories:

https://atomgit.com/collections/openpangu/Pangu-Infra

Ascend 950 supernode openPangu low-precision training system and technical report:

https://atomgit.com/openpangu/openPangu-training-system

Ascend 950 supernode openPangu high-performance inference system and technical report:

https://atomgit.com/openpangu/openPangu-inference-system

Ascend 950-friendly generative-recommendation inference system and technical report:

https://atomgit.com/openpangu/openPangu-genrec-Infer

CANN large-model technical-documentation repository: https://atomgit.com/cann/cann-recipes-docs

Edited by AINRK from the Synced report by Chenchen and Panda and the teams’ training, inference and recommendation repositories. Results retain team attribution. Original figures, technical links and key configurations are preserved; AINRK did not independently reproduce the results.

Related topics

After reading

Join the AINRK community

Read how to join the community and connect with people working in AI.

Community information (opens in a new tab)