Paper

Running Long-Context MoE on Chinese Chips: The Attention, Decoding, and Training Systems of Xing 4

Recipes optimized for GPUs do not transfer directly. With long contexts, producing each token requires reading more past state, and those reads consume memory bandwidth and latency. When time is also stolen by normalization, routing, and data movement rather than the matrix operations the chip excels at, the penalty grows with scale. The Xing 4 report presents structural solutions to each of these two bottlenecks.

1. What the Report Covers

A technical report on the Xing 4 series from China Telecom’s Xingchen AGI Lab (arXiv 2611.22115). It is a design note on continuing to scale the TeleChat family on Ascend NPUs and MindSpore.

The three most striking architectural choices are the focus of this post.

  • MLA (Multi-head Latent Attention) — compresses keys and values into a smaller latent representation for storage.
  • DSA (DeepSeek Sparse Attention) — a lightweight indexer selects which keys each query attends to.
  • IndexShare — reuses those selected indices across layers.

Also covered are a 45-layer wide-and-shallow MoE architecture, the block-level draft model DSpark, and a training system without pipelines. In the abstract, the report highlights up to 4.68x prefill throughput over MLA, 2.67x–3.77x decode throughput with speculative decoding, and a 16.1% throughput gain from removing the pipeline. This post focuses on attention, decoding, the training system, and host bottlenecks.

Term box: MoE (Mixture of Experts) is an architecture that activates only a subset of the total parameters per token. The total parameter count is large, but actual compute scales with the active parameters. The KV cache stores past keys and values that are read again for every token during decode. TTFT is the time to the first token, and TPOT is the time per output token.

2. Attention: What Is Expensive

In standard attention, a single query scans all keys in the context to score them and mixes the values. During decode, the keys and values of past tokens are stored in the KV cache and read again every step. As the context grows to hundreds of thousands of tokens, these reads come to dominate decode latency.

The report separates the bottleneck into two parts (§2.1).

  1. Long-context inference bottleneck — Even after MLA reduces the KV cache size, the main attention still has to read a vast amount of past KV, so decode latency tracks context length.
  2. Ascend hardware efficiency bottleneck — In deep networks, non-matrix operations such as normalization, routing, indexing, scheduling, and data movement repeat at every layer, lowering utilization of the Cube matrix unit that the 910C excels at.

The hardware’s character determines the design direction. The 910C is strong at Cube matrix operations, while vector operations and HBM bandwidth are relatively constrained (§2). Hence three principles (from the caption of Figure 1 in the original).

  • Preserve matrix-dominated computations that use the Cube.
  • Ease vector bottlenecks through structural optimization.
  • Reduce HBM pressure with sparse memory access.

3. The Three Techniques Reduce Different Costs

Even after MLA reduces storage, costs remain for deciding how much to read and where to read from. Each technique targets a different cost.

TechniqueWhat it reducesSource in original
MLAAmount to store (KV cache size)§2.2
DSAAmount to read (number of past KVs the main attention accesses)§2.2
IndexShareCost of deciding the selection (indexer computation repeated at each layer)§2.2

A Small Example: Reading Only 2 of 8 Keys

This is an illustrative example, not a measurement. Eight keys ($K_1 \dots K_8$) remain in the KV cache, and a new query $q$ arrives.

StepInputState retainedOperationResult
① Indexer scan$q$ + 8 cached keysAll 8 KV cache entries unchangedScan all 8, score them, select the top 2 ($K_3, K_7$)2 selected indices
② Sparse attention$q$, $K_3$, $K_7$All 8 KV cache entries unchangedRead only the 2 and mix values1 layer output
③ IndexShare (next layer)Indices from ①All 8 KV cache entries unchangedSkip the indexer scan, read the same keys as ②1 layer output

In summary:

  • State retained: The KV cache does not shrink. All 8 entries remain stored.
  • What changes: The amount this query reads drops from 8 to 2.
  • What is skipped: With IndexShare, the indexer scan in the next layer is skipped entirely.
  • What is rejected: Keys outside the top 2 are not read at all for this query.

The actual Top-K value and context length differ from this example.

  flowchart LR
    IN["Input token sequence (long context)"] --> MLA["KV compression (MLA): store keys and values as latent representations"]
    MLA --> KV["KV cache — persistent state"]
    Q["New query q"] --> IDX["Indexer (DSA): select Top-K keys for q"]
    KV --> READ["Sparse attention: read only selected keys and produce output"]
    IDX --> READ
    READ --> OUT["Layer output"]
    IDX -.->|"IndexShare: reuse indices in the next layer"| NEXT["Next layer skips the indexer scan"]

The point where the solid and dashed lines diverge in the diagram summarizes the design.

  • The upper row (MLA → KV cache) is state that persists once populated. It is not revised on every pass while reading the prompt.
  • The lower row (query → indexer → sparse attention) is computation repeated for every token.
  • The solid path does not traverse the entire KV cache. Only the subset of keys chosen by the indexer passes through.
  • The dashed line removes a scan that used to repeat at every layer. Index selection happens once, and the next layer borrows the result.

Separating the step that chooses which keys to retrieve (indexer) from the step that reads and mixes the chosen keys’ values (sparse attention) reveals which stage each of the three techniques touches.

4. Simulation Comparison of Three Attention Variants

The authors compared three attention variants of a 285B model using Huawei’s Zhanlu simulation framework. MLA, MLA+DSA, and MLA+DSA+IndexShare were run under P/D disaggregation (deploying prefill and decode separately) (§2.2).

Comparison setup (§2.2, Table 1).

ItemSetting
Inference environment32 Ascend 910C cards
Deployment modeP/D disaggregation
Prefill parallelismTP4DP4
Decode parallelismTP2DP8
Evaluation context length256K

Results are normalized to MLA (§2.2, Table 2). Lower is better for access- and latency-related metrics; higher is better for throughput metrics.

ArchitectureKV HBM accessIndex computationRelative TTFTRelative TPOTPrefill throughputDecode throughput
MLA1.00×None1.00×1.00×1.00×1.00×
MLA + DSA0.85×At every DSA layer0.37×0.84×2.67×1.18×
MLA + DSA + IndexShare0.80×Shared across layers0.21×0.79×4.68×1.27×

The following three readings of the table are the author’s interpretation. The report presents the numbers for each variant and the rationale for the choices, but does not spell out every step-level causal link.

First, the effect of sparse selection is largest in prefill. With DSA added, TTFT fell to 0.37×. Since prefill is the stage that scans the keys of a long input all at once, the reduction in the amount read appears to translate into lower latency. The report only states that DSA substantially reduced TTFT and TPOT (§2.2). This step-level attribution is not an explicit conclusion in the original.

Second, the decode improvement is relatively small. Decode throughput is 1.18×. Decode latency is bound to reading past KV (§2.1), which lines up with DSA’s KV HBM access dropping by 15% to 0.85×. Still, this causal link cannot be asserted from the table alone.

Third, IndexShare makes index computation shared rather than repeated at every layer. Prefill throughput changed from 2.67× to 4.68×, and TPOT from 0.84× to 0.79×. One reading is that the decode bottleneck remains on the KV-read side rather than index computation.

Because this comparison consists of simulation-based relative values, it does not capture all overheads of production serving and may be optimistic relative to measurements (§2.2). The indexer’s Top-K value and quality impact are not reported in the original.

5. Depth and Width: Fewer Layers, Wider FFNs

The second bottleneck is depth. As layers deepen, non-matrix operations such as normalization, routing, indexing, scheduling, and data movement repeat at every layer, and Cube utilization drops (§2.1). Under similar total and active parameter budgets, the report favors reducing the layer count and widening the FFN. A wide, shallow structure increases the per-layer matrix-multiply scale, improving Cube utilization, and reduces inter-layer scheduling and communication overhead (§2.3).

The authors took two candidates sharing the base architecture (MLA, DSA, IndexShare, Dense/MoE, MTP), fixed the hidden dimension at 4096, 256 routed experts, and 128 heads, and varied the layer count, expert intermediate size, and experts per token (§2.3, Table 3).

ConfigurationLayersExpert intermediate sizeExperts per tokenShared experts
Baseline60153661
Wide and shallow45204881

Results are normalized against the baseline (§2.3, Table 4).

ConfigurationRelative TTFTRelative TPOTPrefill throughputDecode throughputDecision
Baseline1.00×1.00×1.00×1.00×Reference
Wide and shallow0.83×0.90×1.20×1.11×Adopted

In large-scale training measurements, the wide, shallow structure also gave about 10% better training throughput (§2.3). The 45-layer structure was therefore chosen as the actual architecture for the 285B model (§2.5).

The final configurations of the two models show a spectrum (§2.5, Table 6).

ModelLayersHidden dimensionRouted expertsExpert intermediate sizeExperts per tokenShared experts
Xing 4 (29B)40358464102441
Xing 4 (285B)454096256204881

The 29B is the publicly released Xing4.0-29B-A4B, activating only 4B parameters per token and natively supporting 256K context. The 285B activates about 17B per token and supports up to 1 million token contexts. The 285B uses Dense FFNs in the first 2 layers and MoE FFNs in the rest (§2.5).

6. Decoding: Drafting in Blocks

Because decode generates tokens sequentially, one at a time, it calls the large model (the verifier) every step. Speculative decoding targets this sequentiality. DSpark runs the draft model in blocks, grouping drafting into parallel block computations to shift the burden toward the matrix operations the 910C excels at (§2.4).

The sequence of operations is as follows (§2.4).

  1. Preparation — Feed intermediate representations from several verifier layers into the draft model (a 5-layer DFlash backbone).
  2. Parallel drafting — Use those representations to predict tokens at 7 positions in parallel in one pass.
  3. Dependency correction — A lightweight Markov head incorporates dependencies between neighboring tokens as logit corrections.
  4. Acceptance probability estimation — A confidence head estimates per-position acceptance probabilities from the draft representations and previous-token information.
  5. Verification and commitment — The verifier evaluates the proposed block and commits the accepted prefix.

In short, multiple tokens are committed per verifier call.

Why MTP Alone Is Not Enough

In the representative configuration, MTP remains a training auxiliary objective, while DSpark handles speculative decoding for inference (§2.2). Table 5 uses MTP3 as the comparison baseline to show DSpark’s difference (§2.4, Table 5). The figures are output throughput (tokens/s), in the order baseline / MTP3 / DSpark.

BenchmarkOutput throughput (tokens/s)MTP3/baselineDSpark/baselineDSpark/MTP3
GSM8K35.4 / 63.7 / 115.81.80×3.28×1.82×
MATH-50036.8 / 70.0 / 128.11.90×3.49×1.83×
HumanEval35.7 / 64.1 / 134.71.80×3.77×2.10×
MBPP37.1 / 70.0 / 132.01.89×3.56×1.89×
AIME2537.0 / 71.5 / 109.21.93×2.95×1.53×
LiveCodeBench35.6 / 64.5 / 95.21.81×2.67×1.48×

While MTP3 reaches 1.80x–1.93x over the baseline, DSpark reaches 2.67x–3.77x, beating MTP3 on all six benchmarks (1.48x–2.10x). The widest gain is on HumanEval (2.10x) and the narrowest on LiveCodeBench (1.48x). The report links this difference to “more tokens committed per verifier call.” It does not quantify the causes of the per-benchmark differences.

7. Training System: Removing the Pipeline

The main structural bottleneck on the training side is the bubble in pipeline parallelism (PP). PP saves memory by splitting layers into stages, but devices idle while stages are being filled and drained. For a 1F1B schedule with 4 stages (pp=4) and 8 microbatches (m=8), the theoretical bubble fraction is $(p-1)/(m+p-1)=3/11\approx27\%$ (§3.1).

Interleaving the schedule with virtual pipeline parallelism (VPP) reduces the bubble but does not eliminate it. The authors’ answer is to remove the pipeline altogether. HSDP, adapted from FSDP (fully sharded data parallelism), shards parameters within the cluster’s high-bandwidth group (SuperPoD) and replicates them across groups.

ScopePlacement
Within a SuperPoDParameter sharding. Weight gathering and gradient synchronization stay within the high-bandwidth domain.
Across SuperPoDsParameter replication. The only communication crossing the boundary is coarse gradient summation (AllReduce).

Why this placement works comes from two properties of the SuperPoD (§3.1): internal bandwidth is very high and internal latency very low, so fine-grained AllGather/ReduceScatter can run efficiently inside. If FSDP is scaled as-is to tens of thousands of devices, the sharding group grows with the cluster size, fine-grained collectives cross SuperPoD boundaries, make inefficient use of the limited boundary bandwidth, and are hard to overlap with computation.

Two more designs are layered on (§3.1).

  • Zero-copy communication — PyTorch FSDP flattens parameters into a single contiguous buffer for communication. This requires a copy-in before communication and a copy-out after it; copy-out in particular sits on the critical path because the next computation immediately depends on its result. HSDP performs AllGather/ReduceScatter directly on individual parameter tensors, eliminating intermediate buffers and copies.
  • Three-way communication overlap — While computing the backward pass for layer $i$, HSDP concurrently runs ReduceScatter for layer $i+1$, AllGather for layer $i-1$, and AllReduce across SuperPoDs. Communication synchronization is deferred to the end of the backward pass.

This communication relies on the premise that the interior of a SuperPoD is high-bandwidth and low-latency.

Step-Time Measurement

Step times measured on a 1,024-NPU profiling cluster with the 285B MoE model (context 262,144, global batch 16, TP=4, EP=64, CP=32) (§3.1, Table 7 and §3.2–§3.4.1).

OptimizationStep timeComparison baselineImprovement
PP-1F1B (baseline)36.4s—1.00×
PP-Interleaved (vpp=2)34.2sPP baseline−6.0% (1.06×)
HSDP (pipeline removed, dp replicate 4×, shard 2)31.8sPP baseline−12.6% (1.14×)
+ owner-based Muon28.9sHSDP−9.1% (1.10×)
+ selective recomputation26.9sHSDP+Muon−6.9% (1.07×)
+ per-layer indexer backward24.5sHSDP+Muon−15.2% (1.18×)

For the PP-1F1B, PP-Interleaved, and HSDP rows, mbs is 8, 4, and 2 respectively, while HSDP+Muon and the two subsequent optimizations keep the same HSDP layout. Owner-based Muon was measured independently against HSDP’s 31.8s, and selective recomputation and per-layer indexer backward were each measured independently against HSDP+Muon’s 28.9s.

The abstract reports a 16.1% throughput gain from removing the pipeline. In this table, however, HSDP is reported as a 12.6% step-time reduction (1.14×) versus PP-1F1B; the conditions under which 16.1% was derived are not reported, so it cannot be confirmed that it is the same comparison.

Switching PP from 1F1B to interleaved reduces the bubble but leaves some, amounting to a 6.0% improvement. Removing PP entirely with PP=1 and replacing it with HSDP gives 12.6%. In this table, eliminating the bubble itself yields the larger gain.

Three Memory and Compute Optimizations

Each item reduces a different thing.

Owner-based Muon execution. Muon is an optimizer that orthogonalizes matrix parameters via Newton–Schulz (NS) iterations. NS requires the full weight matrix, but in sharded training each rank holds only a shard. A naive implementation has every rank update the momentum of its own shard, reconstruct the full NS input, run the same NS iteration, and then keep only its own shard. The computation is duplicated across all ranks, and each rank uses only part of the result (§3.2).

The fix is to designate “who performs the full-matrix computation.” For each matrix, one owner rank is chosen within the shard group. Non-owners send their input shard to the owner over P2P; the owner assembles the full input, runs NS, scales the update, keeps its own shard, and sends the rest back to the original ranks. The sharding of parameters and momentum is unchanged — only the full-matrix computation moves to the owner.

The scheduler combines owner assignment with batching. It groups matrices by shape, shard group, and estimated cost and distributes them to suitable owners; full inputs with compatible shapes are stacked along the batch dimension and processed with batched matrix multiplication. Each matrix is still normalized and orthogonalized independently. Because the full inputs and NS work concentrate on the owners, the actual gain depends on assignment balance and the distribution of matrix shapes. Layouts that cannot use P2P fall back to the existing execution path.

Selective recomputation. Layer-level recomputation is a coarse compromise that treats all operators in a layer the same way, especially so for long-sequence DSA. Some operators are expensive to execute but produce small outputs; recomputing them costs a lot of compute while saving little activation memory. Native operator-level checkpointing is finer-grained, but a Python policy callback fires on every operator dispatch, adding host work throughout the forward pass (§3.3).

This report controls at the granularity of named model objects. Operators are registered as object members at initialization, and recomputation is specified per member path. Different uses of the same operator type can be distinguished as separate members. Expensive operators are placed in an exclude region, while the computations around them remain recomputation targets (§3.3.1). Fine-grained control is maintained without a framework-wide dispatch policy or per-operator Python callbacks.

Selection uses profiling data. For each candidate operator $i$, record its forward execution time $t_i$ and the output memory $m_i$ estimated from the output shape and data type. Let $M$ be the remaining activation-memory budget; $x_i=1$ means “keep the output and exclude it from re-execution.”

$$\max_{x_i \in \{0,1\}} \sum_i x_i t_i \quad \text{s.t.} \quad \sum_i x_i m_i \le M$$

Keeping an output costs $m_i$ bytes, and what is saved is the re-execution compute $t_i$. Operators not selected remain recomputation targets. Instead of applying one policy to an entire layer, the limited memory is spent on the most expensive operators to execute.

Time and output size do not line up well. The table aggregates by kernel name, and output size is the logical total computed from output shape and data type. On rank 0 of a 256K-token run, one forward Transformer layer uses 150 kernels totaling 115.1ms (§3.3.1, Table 9).

KernelExecution time (ms)Output size (MiB)
SparseLightningIndexerGradKLLoss38.32193.0
LightningIndexer21.5148.0
AllGatherMatmul15.90656.0
SparseFlashAttention13.47516.0
MatmulReduceScatter6.0064.0

The most expensive kernel is SparseLightningIndexerGradKLLoss at 38.32ms (193MiB). SparseFlashAttention processes 516MiB in 13.47ms, and AllGatherMatmul processes 656MiB in 15.90ms. The original text calls 516MiB “the largest output in the layer,” but the same table shows AllGatherMatmul at 656MiB, so the text and table disagree. Either way, output size alone cannot determine the cost ranking.

Boundary handling adds another layer. Even when an operator is stored in the exclude region, large inputs inside that region stay alive. The report recognizes the storage address of tensors crossing between the recomputation and saved regions. When the saved region tries to keep a tensor at the same address, it stores a placeholder instead; during backpropagation, upstream recomputation creates a new boundary tensor that restores the saved region’s activation. This removes the persistent occupancy of boundary inputs without re-executing the expensive operator (§3.3.2).

The profiled SFA query has shape 16,384 × 32 × 512 BF16 and occupies 512MiB, with the position-query input adding another 64MiB. The DSA indexer’s query projection is 16,384 × 64 × 128 BF16, or 256MiB (§3.3.2).

Per-layer indexer backward. DSA selects Top-K keys with a learnable indexer, and that indexer carries an auxiliary KL loss. If this auxiliary graph stays alive until the main language-model backward pass finishes, activations remain occupied to the end (§3.4.1).

The report’s explanation is as follows. The fused KL operator can already produce a precomputed gradient with respect to the indexer projection output during the forward pass. An explicit backward pass propagates that gradient to the indexer projection parameters, and the auxiliary loss is not backpropagated through the teacher or the main-branch inputs.

The backward boundary changes as follows.

  • The path from the indexer projection through Top-K to the indexer KL loss is backpropagated immediately.
  • Main-branch inputs and teacher statistics are detached.
  • Gradient accumulation (GAS) and loss-scaling rules are unchanged, and the optimizer updates once at the end of the step.

Without IndexShare, the auxiliary graph is consumed layer by layer. With a shared graph, it is collected and backpropagated once per IndexShare group. When main-branch recomputation is enabled, the framework automatically excludes Indexer and IndexerLoss from recomputation targets and keeps the inputs needed for the early backward. Users do not need to manually specify exclude ops for the two modules.

This contributed the most of the three features: 15.2% (1.18x). The auxiliary graph is reclaimed at the layer level rather than at the end of the step.

However, this design is not “zero memory cost.” The Top-K outputs, the actual inputs to the early backward, and the projections shared within a group still occupy device memory (§3.4.1).

The Two Remaining DSA Boundaries

Q-block pairing and batch planning. Under a causal mask, later queries can generally see more keys. Equal token counts do not imply equal compute. With fixed Q-block size, head count, and feature dimension, the dominant theoretical work of operators that scan without an index (LightningIndexer, FA, dense loss) grows roughly linearly with the number of effectively visible keys (§3.4.2).

Here “linear” refers to theoretical work. Actual execution time is affected by sparse memory access, document partitioning, physical K/V lengths, gradient initialization and writes, and kernel tiling, so it is not predicted by a simple linear function of visible K. Dynamic pairing must therefore use measured cost, not a balance of K counts or token counts.

In a single document, if the work of 8 equal-length blocks is 1–8, contiguous partitioning gives one rank a load of at most 7+8=15 and at least 1+2=3. Head-tail pairing gives each rank 1+8=9. The heaviest rank’s load drops while total work is unchanged. These values are illustrative units, not measured times. They describe only the geometry of the pairing; whether P2P is actually needed and when folding occurs depend on implementation boundaries.

With TND (document packing) and multiple documents, the situation changes. Because causal positions reset at document boundaries, cost does not increase monotonically with global position. A fixed head-tail rule may help but does not guarantee balance and can leave substantial imbalance. Dynamic pairing estimates cost from features such as the number of dense/sparse pairs within a document, logical KV, and active document KV, then pairs light and heavy blocks. It replaces the fixed scheme only when the predicted maximum cost strictly decreases.

The layout itself also changes. The reference approach folds at operator boundaries and unfolds as soon as an operator finishes; Indexer, SFA, and KL then return to the original batch each time and repeatedly cross the same folding boundary. The sparse stage of this work instead decides the layout at the model entrance. Input ids, labels, loss mask, and position ids are selected together to establish folded token ownership before Embedding, and all subsequent layers and the three DSA operators reuse that ownership. Inside an operator, only the two Q blocks are split locally and the required KV is selected. The round trips to exchange Q tail fragments per operator and the movement to return per-Q outputs to the original rank disappear.

CP and TP sequence placement are planned together. Each CP rank’s local input is arranged to match a combination of two blocks from TP ranks, and the existing TP sequence distribution/conversion is left to emit complementary Q blocks. One extra TP folding exchange is not needed. KV AllGather, gradient reduction, the necessary TP head/sequence conversions, and FSDP communication remain. In other words, this change does not eliminate all attention communication (§3.4.2).

Imbalance at the DP level is a separate matter. Pairing only adjusts the Q-block load within one replica; it cannot remove differences arising because different DP replicas receive different document combinations. Inter-DP data balancing therefore estimates upfront cost from document-boundary metadata. It can use the density proxy $\sum_i L_i^2$, or use a DSA cost model to estimate the heaviest sequence shard of a TND microbatch. If LBS>1, it scores the full layout with T=LBS×sequence length.

The current implementation follows the framework’s default shuffle and data-fetch order to obtain the step’s global sample window, treats the original microbatches as indivisible units, stably sorts them by estimated cost, and assigns them to DP replicas and micro slots in a SNAKE pattern. A candidate is adopted only when neither the maximum cumulative replica cost $\max_d \sum_m C[d,m]$ nor the sum of per-micro-slot maxima $\sum_m \max_d C[d,m]$ gets worse and at least one improves. The global sample set, DP quota, and microbatch composition stay the same at every step, so repacking does not change the local denominators of CE/CP/MTP. Prefetching runs only a virtual plan and commits state after consumption succeeds.

This is a conservative heuristic, not a global optimization search. The default assignment is kept when there is only one microbatch per DP, the window is incomplete, an epoch boundary is crossed, or no predicted improvement exists. Furthermore, DP scheduling, document rearrangement within a microbatch, and CP/TP dynamic pairing are three distinct levels, and DSA data scoring still estimates cost under fixed folding, so it does not automatically invoke the dynamic-pairing owner. When combining the two, one must check that the cost objectives are consistent; using the same set of coefficients does not make the scoring identical (§3.4.2).

Document-aware KV compaction. Under a per-document causal mask, a Q block $B=[a,b)$ needs only the KV from the start of the first active document, $d(a)$, up to $b$. The full original prefix $[0,b)$ is unnecessary; $[d(a),b)$ suffices (§3.4.3).

The implementation selects the overlapping chunks according to the physical layout, trims the boundaries, consistently rewrites the Q/K cumulative lengths, and removes empty intervals and duplicated trailing padding. Indexer, SFA, and KL use the same coordinates. The backward pass sums gradients over overlapping intervals and writes them back to the full KV, restoring the saved layout to preserve the existing gradient-communication semantics.

A small example makes this concrete (Figure 15 in the original). With 4 documents (12 / 16 / 12 / 24 tokens) in a 64-token sequence and Q = [32, 40), the original physical KV window is [0, 40). Applying document boundaries leaves only [28, 40). AllGather still covers the full length; only the local physical KV window is reduced.

Validation uses a combined pipeline. Along with operator regressions that check document boundaries, Top-K coordinates, overlapping gradient writes, and the interleave plan, a combined comparison ran each configuration for 8 steps on 8 devices, 8 layers, and 16K (TP2/CP4); the maximum absolute differences in the main loss and MTP loss were 0.000530 and 0.000441, respectively.

8. Host CPU: The Bottleneck Outside the Device

A fast device is of no use if the host CPU is slow. The host handles data processing, task submission, and communication scheduling. When a critical thread waits on the CPU, compute tasks may be submitted late, or a process may arrive late to a collective, and that delay propagates to other training processes (§5).

CPU pinning defines the set of logical CPUs (affinity) on which each thread may run. The coarse approach assumes one training process per device and divides the CPU set $T$ into per-device pools $T_i$, with all threads of the same process sharing that pool. The fine-grained approach subdivides the same $T_i$ by execution role. For example, on device 0, the coarse approach has all relevant threads sharing 28 logical CPUs {8, 10, 12, 14, 16–39}. The fine-grained approach assigns {8, 10, 12, 14} to PyNative, 16–23 to MindData, and 24–39 to Main, runtime, and support threads (§5.1). This fine-grained assignment is a proposed configuration; the original does not confirm whether it was actually used in the existing samples. If a role gets too few CPUs, its threads queue up while CPUs assigned to other roles may sit idle. The gain depends on how well the assignment matches the load.

Core isolation separates the system CPU pool $H$ from $T$. Selected services, logging and monitoring processes, and movable interrupt (IRQ) handlers are confined to $H$. Turning isolation off restores the recorded default placement. Non-movable interrupts and kernel-task settings are held constant and documented. $H$ must retain enough capacity that system work is not backed up.

The two optimizations differ in nature. Pinning governs resource allocation inside training; isolation limits competition from outside. Their combined effect must be measured in controlled experiments. The report’s experiments cover six configurations: three pinning policies × isolation on/off. CPU budget, quota, process and thread counts, model, parallelization settings, memory placement policy, and external load are held fixed, and the actual affinity mask and effective cpuset are verified after framework initialization and after thread re-creation. If verification fails, the constraints are corrected and the check is repeated.

Relative to throughput before optimization at each cluster size, the improvement with pinning and isolation both enabled is as follows (§5.2, Table 5-1).

ClusterThroughput improvement
512 cards1–2%
8,192 cards5–10%

The gain was larger on the bigger cluster. The report explains this through host scheduling: pinning restricts which CPUs training threads can run on, while isolation moves selected background work and movable interrupt handling outside the training CPU pool. As a result, scheduling latency for critical threads dropped, and processes that used to arrive late at communication groups began submitting data earlier.

9. Limitations and Applicability

The limitations stated directly by the authors are as follows.

  • The attention comparison is simulation-based and may be optimistic relative to measured serving (§2.2).
  • Step times come from a 1,024-NPU profiling cluster and may differ from an 8,192-card production cluster (§3).
  • CPU optimization gains vary with cluster size and host contention, amounting to only 1–2% on 512 cards (§5.2).
  • Dynamic Q-block pairing and inter-DP data placement are conservative heuristics rather than global optimization, so imbalance may remain depending on the document distribution (§3.4.2).
  • Owner-based Muon can change floating-point results because of execution order and batched kernels, so bit-level equivalence and convergence equivalence are not guaranteed (§3.2).
  • The fine-grained pinning assignment by role is a proposed configuration, and its actual use in the existing samples is not confirmed (§5.1).

The following is the author’s reasoning, which is hard to judge from this report alone. The optimizations are tied to the Ascend 910C and MindSpore HyperParallel, and porting to GPUs or other frameworks is not validated by this report. For the 285B model’s quality, the report claims the wide, shallow structure preserves scale and quality, but accuracy scores are not reported, so it cannot be confirmed that the efficiency gains came without a quality sacrifice. The DSA learnable indexer’s Top-K value and quality impact are not quantified. The attention figures are relative to MLA, so absolute TTFT and TPOT values are not reported in the original.

Finally, the nature of the numbers must be distinguished. The attention comparison in §4 and the decoding table in §6 of this post are simulation- and benchmark-based relative values, while the step times in §7 were measured on a 1,024-NPU profiling cluster. Prefill and decode, absolute values and relative improvements, and kernel speed and overall system throughput should not be compared on the same line.

In sum, this design targets environments that train and serve MoEs at the tens-of-B to hundreds-of-B scale on Ascend NPUs, where HBM access and pipeline bubbles are the bottlenecks at long contexts of 256K and above. GPU portability, absolute latency figures, and the tradeoff with model quality remain unverified.

Tables from the paper

Tables converted mechanically from the arXiv e-print LaTeX source. The numbers are the paper’s own and did not pass through a model.

Table 1. Training throughput gains with CPU pinning and core isolation enabled together.

OptimizationCluster sizeThroughput gainEvaluation condition
CPU resource isolationSmall (512 accelerators)1–2%Pinning and isolation combined
CPU resource isolationLarge (8,192 accelerators)5–10%Pinning and isolation combined

Table 2. Inference evaluation setup for attention variants of the 285B model.

ItemConfiguration
Inference environment32 Ascend 910C cards
Deployment modeP/D disaggregation
Prefill-side parallelismTP4DP4
Decode-side parallelismTP2DP8
Evaluation context length256K

Table 3. Simulation-based inference efficiency of attention variants in the 285B study. All metrics are normalized against the MLA baseline. For access and latency metrics, lower is better; for throughput metrics, higher is better.

ArchitectureKV HBM AccessIndex ComputationRelative TTFTRelative TPOTPrefill ThroughputDecode Throughput
MLA1.00$\times$None1.00$\times$1.00$\times$1.00$\times$1.00$\times$
MLA + DSA0.85$\times$Per-DSA-layer0.37$\times$0.84$\times$2.67$\times$1.18$\times$
MLA + DSA + IndexShare0.80$\times$Cross-layer0.21$\times$0.79$\times$4.68$\times$1.27$\times$

Table 4. Candidate configurations for the representative model’s depth-width study.

ConfigurationLayersHidden SizeHeadsRouted ExpertsExpert Intermediate SizeExperts per TokenShared Experts
Baseline604096128256153661
Wider-shallower454096128256204881

Table 5. Normalized inference efficiency in the 285B depth-width study.

ConfigurationRelative TTFTRelative TPOTPrefill ThroughputDecode ThroughputDecision
Baseline1.00$\times$1.00$\times$1.00$\times$1.00$\times$Reference
Wider-shallower0.83$\times$0.90$\times$1.20$\times$1.11$\times$Selected

Table 6. Decoding throughput of the 285B model with the base configuration, MTP3, and DSpark. Throughput values are listed in the order Base / MTP3 / DSpark; ratios represent output throughput speedups.

BenchmarkOutput Throughput (tokens/s)MTP3/BaseDSpark/BaseDSpark/MTP3
GSM8K35.4 / 63.7 / 115.8$1.80\times$$3.28\times$$1.82\times$
MATH-50036.8 / 70.0 / 128.1$1.90\times$$3.49\times$$1.83\times$
HumanEval35.7 / 64.1 / 134.7$1.80\times$$3.77\times$$2.10\times$
MBPP37.1 / 70.0 / 132.0$1.89\times$$3.56\times$$1.89\times$
AIME2537.0 / 71.5 / 109.2$1.93\times$$2.95\times$$1.53\times$
LiveCodeBench35.6 / 64.5 / 95.2$1.81\times$$2.67\times$$1.48\times$

Table 7. Representative configurations of the Xing 4 series. The per-token expert count includes selected routed experts only; shared experts are listed separately.

ModelLayersHidden SizeRouted ExpertsExpert Intermediate SizeExperts per TokenShared Experts
Xing 4 (29B)40358464102441
Xing 4 (285B)454096256204881

Table 8. Training performance of the 285B model on the 1,024-NPU profiling cluster.

SchemePipelineDP (Replica $\times$ Shard)mbsStep TimeSpeedup
PP-1F1B (Baseline)$pp=4,\ vpp=1$$2 \times 1$$8$$36.4\,\mathrm{s}$$1.00\times$
PP-Interleaved$pp=4,\ vpp=2$$2 \times 1$$4$$34.2\,\mathrm{s}$$1.06\times$
HSDP (Ours)$pp=1$$4 \times 2$$2$$31.8\,\mathrm{s}$$1.14\times$

License

Author: Jaehun Ryu

Link: https://jaehun.me/en/posts/paper-2611-22115/

License: CC BY 4.0

This work is licensed under the Creative Commons Attribution 4.0 International License. You are free to use it for any purpose, including commercial use, as long as you provide proper attribution.

Comments