<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE rfc [
  <!ENTITY nbsp    "&#160;">
  <!ENTITY zwsp   "&#8203;">
  <!ENTITY bom    "&#65279;">
  <!ENTITY wd     "&#x2011;">
]>
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" ipr="trust200902"
     docName="draft-li-moe-ep-communication-optimization-00"
     category="info" submissionType="IETF" consensus="true" version="3"
     xml:lang="en" tocInclude="true" sortRefs="true" symRefs="true">
  <front>
    <title abbrev="MoE EP Comm Optimization">Communication Optimization for MoE Expert Parallelism in Distributed Training</title>
    <seriesInfo name="Internet-Draft" value="draft-li-moe-ep-communication-optimization-00"/>

    <author fullname="Zhiqiang Li" initials="Z." surname="Li">
      <organization>China Mobile</organization>
      <address>
        <postal><city>Beijing</city><code>100053</code>
        <country>China</country></postal>
        <email>lizhiqiangyjy@chinamobile.com</email>
      </address>
    </author>
    <author fullname="Zongpeng Du" initials="Z." surname="Du">
      <organization>China Mobile</organization>
      <address>
        <postal><city>Beijing</city><code>100053</code>
        <country>China</country></postal>
        <email>duzongpeng@chinamobile.com</email>
      </address>
    </author>
    <author fullname="Junjie Wang" initials="J." surname="Wang">
      <organization>Centec</organization>
      <address>
        <postal><city>Shanghai</city><code>201203</code>
        <country>China</country></postal>
        <email>wangjj@centec.com</email>
      </address>
    </author>
    <author fullname="Wei Cheng" initials="W." surname="Cheng">
      <organization>Centec</organization>
      <address>
        <postal><city>Shanghai</city><code>201203</code>
        <country>China</country></postal>
        <email>chengw@centec.com</email>
      </address>
    </author>
    <author fullname="Guoying Zhang" initials="G." surname="Zhang">
      <organization>Centec</organization>
      <address>
        <postal><city>Shanghai</city><code>201203</code>
        <country>China</country></postal>
        <email>zhanggy@centec.com</email>
      </address>
    </author>
    <author fullname="Xun Sun" initials="X." surname="Sun">
      <organization>Inesa</organization>
      <address>
        <postal><city>Shanghai</city><code>200030</code>
        <country>China</country></postal>
        <email>sunxun@inesa.com</email>
      </address>
    </author>
    <author fullname="Chunhao Zhao" initials="C." surname="Zhao">
      <organization>SAIA</organization>
      <address>
        <postal><city>Shanghai</city><code>200125</code>
        <country>China</country></postal>
        <email>chunhao.zhao@sh-aia.com</email>
      </address>
    </author>

    <date year="2026" month="July" day="4"/>
    <area>TSV</area>
    <workgroup>Network Working Group</workgroup>
    <keyword>MoE</keyword>
    <keyword>Expert Parallelism</keyword>
    <keyword>All-to-All</keyword>
    <keyword>AllReduce</keyword>
    <keyword>distributed training</keyword>
    <keyword>collective communication</keyword>
    <abstract>
      <t>This document describes a communication optimization mechanism for Mixture of Experts (MoE) Expert Parallelism (EP) in distributed training environments. It defines two core mechanisms: (1) an adaptive communication mode selection that dynamically chooses between Data-Centric and Expert-Centric All-to-All communication patterns based on a comparison of expert parameter size versus token data size, minimizing cross-node communication volume; (2) a priority-based co-scheduling strategy for All-to-All and AllReduce collective communications, combined with chunked transmission and in-network aggregation acceleration, to eliminate bandwidth contention and reduce overall training latency.</t>
    </abstract>
  </front>

  <middle>
<section anchor="introduction" numbered="true" toc="include"><name>Introduction</name>
<t>Mixture of Experts (MoE) <xref target="MoE"/> is a sparse neural network architecture that significantly scales model parameters without proportionally increasing computational cost. In a MoE architecture, each input token activates only a small number of expert sub-networks (typically 1 to 2) for processing, enabling efficient utilization of compute resources.</t>
<t>Expert Parallelism (EP) is a key parallelism strategy for MoE training. By distributing different experts across multiple compute nodes (e.g., GPUs), EP achieves parallel computation across nodes, significantly reducing per-node load and improving training throughput.</t>
<t>However, EP relies heavily on All-to-All collective communication to dispatch tokens to the correct experts and gather results. Experiments have shown that All-to-All communication accounts for over 34.1% of total training time <xref target="DeepSpeed-MoE"/>, constituting the primary scalability bottleneck. Furthermore, during the backward pass, All-to-All communication contends for bandwidth with AllReduce communication used for gradient aggregation in data parallelism.</t>
<t>This document proposes two mechanisms to address these challenges: (1) Adaptive Communication Mode Selection: Dynamically selects between Data-Centric and Expert-Centric All-to-All patterns based on model and cluster parameters. (2) Priority-Based Co-Scheduling: Coordinates All-to-All and AllReduce communications through priority scheduling, chunked transmission, and in-network aggregation to eliminate bandwidth contention.</t>
<section anchor="requirements-language" numbered="true" toc="include"><name>Requirements Language</name>
<t>The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 <xref target="RFC2119"/> <xref target="RFC8174"/> when, and only when, they appear in all capitals, as shown here.</t>
</section></section>
<section anchor="terminology" numbered="true" toc="include"><name>Terminology</name>
<dl><dt>MoE (Mixture of Experts):</dt><dd>A sparse neural network architecture where each input activates only a subset of expert sub-networks.</dd>
<dt>EP (Expert Parallelism):</dt><dd>A parallelism strategy that distributes different experts across multiple compute nodes.</dd>
<dt>All-to-All:</dt><dd>A collective communication primitive where each node sends distinct data to every other node.</dd>
<dt>AllReduce:</dt><dd>A collective communication primitive that performs a reduction operation across all nodes and distributes the result.</dd>
<dt>Token:</dt><dd>The smallest unit of input data processed by the model.</dd>
<dt>Worker:</dt><dd>A single compute unit participating in training, typically corresponding to one GPU.</dd>
<dt>H:</dt><dd>The hidden dimension size of the model.</dd>
<dt>T:</dt><dd>Total number of tokens to process, determined by Batch Size (B) and Sequence Length (S).</dd>
<dt>E:</dt><dd>Total number of experts in the MoE model.</dd>
<dt>Top-K:</dt><dd>The number of experts selected per token by the MoE router.</dd>
<dt>GDR (GPU Direct RDMA):</dt><dd>A technology enabling direct memory access between GPUs across a network without CPU involvement.</dd>
<dt>NVLink:</dt><dd>A high-speed interconnect bus between NVIDIA GPUs within a node.</dd>
<dt>NVSwitch:</dt><dd>A high-speed switching chip for inter-GPU communication within a node.</dd>
<dt>ToR Switch:</dt><dd>Top-of-Rack switch, used for inter-node communication.</dd>
<dt>In-Network Aggregation:</dt><dd>The capability of performing reduction operations on network switching devices.</dd></dl>
</section>
<section anchor="problem-statement" numbered="true" toc="include"><name>Problem Statement</name>
<section anchor="all-to-all-bottleneck" numbered="true" toc="include"><name>All-to-All Communication Bottleneck</name>
<t>MoE models achieve computational efficiency through dynamic expert activation. However, the All-to-All communication required for Expert Parallelism constitutes the primary bottleneck in scaling distributed training. Empirical studies demonstrate that All-to-All communication accounts for over 34.1% of total training time. The All-to-All communication exhibits a "barrel effect": overall communication latency is determined by the slowest node. Since processing capacity and token count vary across nodes, individual slow nodes can degrade overall training throughput.</t>
</section>
<section anchor="static-mode-limitation" numbered="true" toc="include"><name>Static Communication Mode Limitation</name>
<t>Existing implementations typically employ a fixed All-to-All communication pattern, either exchanging data or exchanging expert parameters. However, the communication cost of each pattern varies significantly under different model configurations and cluster topologies. A static approach cannot adapt to all scenarios.</t>
</section>
<section anchor="bandwidth-contention" numbered="true" toc="include"><name>All-to-All and AllReduce Bandwidth Contention</name>
<t>During the backward pass of training, All-to-All communication (for EP gradient synchronization) and AllReduce communication (for data-parallel gradient aggregation) share physical link bandwidth. Concurrent execution of both communication types leads to bandwidth contention, causing significant increases in overall communication latency and degraded training performance.</t>
</section></section>
<section anchor="adaptive-mode-selection" numbered="true" toc="include"><name>Adaptive Communication Mode Selection</name>
<section anchor="mode-overview" numbered="true" toc="include"><name>Overview</name>
<t>This mechanism dynamically selects the optimal All-to-All communication mode by comparing expert parameter size against token data size. Data-Centric Mode: When expert parameter size is smaller than token data size, workers dynamically exchange expert parameters while keeping data stationary. Suitable for scenarios with smaller experts and larger data volumes. Expert-Centric Mode: When expert parameter size is larger than token data size, workers exchange token data while keeping expert parameters stationary. Suitable for scenarios with larger experts and smaller data volumes.</t>
</section>
<section anchor="mode-criteria" numbered="true" toc="include"><name>Mode Selection Criteria</name>
<t>The collective communication library SHOULD automatically select the communication mode through the following procedure: Step 1 - Compute Sizes: Expert parameter size S_expert = 8 * H^2; Token data size S_data = 2 * H * T (where T = B * S * K). Step 2 - Detect Cluster Topology: The library MUST automatically detect node configuration, GPU type, network topology, and inter-node interconnect bandwidth. Step 3 - Compute Cross-Node Communication Volume: Data-Centric volume C_dc = 8 * H * E * m * (n - 1); Expert-Centric volume C_ec = 2 * m * H * T * (n - 1) / n (E = expert count, n = node count, m = workers per node). Step 4 - Select Mode: If C_dc &lt; C_ec, select Data-Centric mode. Otherwise, select Expert-Centric mode.</t>
</section>
<section anchor="data-centric-execution" numbered="true" toc="include"><name>Data-Centric Mode Execution</name>
<t>When Data-Centric mode is selected, the following procedure MUST be executed: (1) Each worker fetches remote expert parameters to local node CPU memory via GDR NIC; fetch targets SHOULD be staggered across workers to avoid link contention. (2) The fetch operations are coordinated by the collective communication library or scheduled by in-network compute switches. (3) Intra-node expert transfer between workers is performed via NVLink, scheduled by the collective communication library or NVSwitch. (4) Expert parameters are loaded into workers (GPUs) via the PCIe bus in parallel. (5) Inter-node Ethernet transfers and intra-node PCIe/NVLink transfers SHOULD proceed concurrently to achieve pipelining.</t>
</section></section>
<section anchor="co-scheduling" numbered="true" toc="include"><name>All-to-All and AllReduce Co-Scheduling</name>
<section anchor="cosched-overview" numbered="true" toc="include"><name>Overview</name>
<t>During the backward pass, this mechanism eliminates bandwidth contention between All-to-All and AllReduce communications through: Chunked Transmission (AllReduce gradient data is split into fixed-size chunks); Priority Scheduling (All-to-All traffic is assigned high priority; AllReduce chunks are assigned low priority); Gap Filling (AllReduce chunks are transmitted during idle intervals between All-to-All bursts); In-Network Aggregation (AllReduce traffic passing through ToR switches and NVSwitch is accelerated by performing aggregation operations on network devices).</t>
</section>
<section anchor="scheduling-procedure" numbered="true" toc="include"><name>Scheduling Procedure</name>
<t>The collective communication library MUST execute the following scheduling rules: (1) AllReduce gradient data MUST be split into fixed-length chunks; chunk size MAY be statically configured or dynamically adjusted; each chunk is assigned low priority and enqueued. (2) All-to-All gradient synchronization data MUST be assigned high priority and enqueued. (3) The library MUST schedule the send queue in priority order, transmitting All-to-All data first and filling idle gaps with AllReduce chunks. (4) The library MAY monitor or predict contention in real time, dynamically adjusting chunk size to optimize throughput. (5) AllReduce traffic traversing ToR switches and NVSwitch SHOULD leverage in-network aggregation for acceleration.</t>
</section>
<section anchor="communication-hierarchy" numbered="true" toc="include"><name>Communication Hierarchy</name>
<t>This mechanism follows an "intra-node first, inter-node second" communication principle. Intra-node communication (typical bandwidth: 600 GB/s via NVLink) completes local All-to-All and AllReduce operations first. Inter-node communication (typical bandwidth: 200 Gbps via Ethernet/InfiniBand) then completes cross-node synchronization. For AllReduce, inter-node traffic is aggregated via ToR switches, and intra-node traffic is aggregated via NVSwitch.</t>
</section></section>
<section anchor="protocol-operations" numbered="true" toc="include"><name>Protocol Operations</name>
<section anchor="library-extensions" numbered="true" toc="include"><name>Collective Communication Library Extensions</name>
<t>To support this mechanism, the collective communication library SHOULD provide the following extension interfaces: Mode Query Interface (returns the currently recommended communication mode); Topology Detection Interface (returns cluster physical topology information); Chunk Size Configuration Interface (sets AllReduce chunk size); Priority Configuration Interface (sets priority levels for different communication task types); In-Network Aggregation Control Interface (enables or disables in-network aggregation).</t>
</section>
<section anchor="reevaluation" numbered="true" toc="include"><name>Mode Re-evaluation Triggers</name>
<t>Communication mode selection is performed during training initialization. The library MUST re-evaluate mode selection upon: training initialization; cluster topology changes (e.g., node addition or removal); model configuration changes (e.g., changes to expert count, hidden dimension, or other relevant parameters).</t>
</section>
<section anchor="compatibility" numbered="true" toc="include"><name>Compatibility</name>
<t>This mechanism is designed as an incremental extension to existing collective communication libraries (e.g., NCCL, HCCL). It does not alter existing All-to-All and AllReduce semantic interfaces. Mode selection and scheduling strategies are implemented as internal optimizations, supporting seamless integration with existing training frameworks (e.g., PyTorch, MindSpore).</t>
</section></section>
<section anchor="security-considerations" numbered="true" toc="include"><name>Security Considerations</name>
<t>This mechanism involves communication optimization across multiple nodes and the following security aspects MUST be considered. Cluster Topology Protection: Auto-detected cluster topology information constitutes sensitive infrastructure data; the library MUST ensure this information is not accessible to unauthorized parties. Communication Integrity: In Data-Centric mode, expert parameters are transmitted over the network; implementations SHOULD ensure the integrity of parameter data during transmission to prevent man-in-the-middle tampering that could compromise training results. Denial of Service Protection: Misuse of in-network aggregation capabilities could exhaust switch resources; network devices SHOULD implement rate limiting and resource isolation for in-network aggregation tasks. Priority Abuse Prevention: Improper use of the priority mechanism could cause persistent starvation of low-priority traffic; the library SHOULD enforce minimum guaranteed bandwidth to ensure AllReduce communication is not indefinitely deferred.</t>
</section>
<section anchor="iana-considerations" numbered="true" toc="include"><name>IANA Considerations</name>
<t>This document has no IANA actions.</t>
</section>
  </middle>

  <back>
      <references title="Normative References">
    <reference anchor="RFC2119" target="https://www.rfc-editor.org/info/rfc2119">
      <front>
        <title>Key words for use in RFCs to Indicate Requirement Levels</title>
        <author initials="S." surname="Bradner" fullname="Scott Bradner"/>
        <date year="1997" month="March"/>
      </front>
      <seriesInfo name="BCP" value="14"/>
      <seriesInfo name="RFC" value="2119"/>
      <seriesInfo name="DOI" value="10.17487/RFC2119"/>
    </reference>
    <reference anchor="RFC8174" target="https://www.rfc-editor.org/info/rfc8174">
      <front>
        <title>Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words</title>
        <author initials="B." surname="Leiba" fullname="Barry Leiba"/>
        <date year="2017" month="May"/>
      </front>
      <seriesInfo name="BCP" value="14"/>
      <seriesInfo name="RFC" value="8174"/>
      <seriesInfo name="DOI" value="10.17487/RFC8174"/>
    </reference>
      </references>
      <references title="Informative References">
    <reference anchor="MoE">
      <front>
        <title>Outrageously Large Neural Networks: The Sparsely-Gated Mixture-of-Experts Layer</title>
        <author initials="N." surname="Shazeer" fullname="Noam Shazeer"/>
        <author initials="A." surname="Mirhoseini" fullname="Azalia Mirhoseini"/>
        <author initials="K." surname="Maziarz" fullname="Krzysztof Maziarz"/>
        <author initials="A." surname="Davis" fullname="Andy Davis"/>
        <author initials="Q." surname="Le" fullname="Quoc Le"/>
        <author initials="G." surname="Hinton" fullname="Geoffrey Hinton"/>
        <author initials="J." surname="Dean" fullname="Jeff Dean"/>
        <date year="2017"/>
      </front>
      <seriesInfo name="ICLR" value="2017"/>
    </reference>
    <reference anchor="DeepSpeed-MoE">
      <front>
        <title>DeepSpeed-MoE: Advancing Mixture-of-Experts Inference and Training to Power Next-Generation AI Scale</title>
        <author initials="S." surname="Rajbhandari" fullname="Samyam Rajbhandari"/>
        <author initials="C." surname="Li" fullname="Conglong Li"/>
        <author initials="Z." surname="Yao" fullname="Zachary Yao"/>
        <author initials="M." surname="Zhang" fullname="Minjia Zhang"/>
        <author initials="R.Y." surname="Aminabadi" fullname="Reza Yazdani Aminabadi"/>
        <author initials="A.A." surname="Awan" fullname="Ammar Ahmad Awan"/>
        <author initials="J." surname="Rasley" fullname="Jeff Rasley"/>
        <author initials="Y." surname="He" fullname="Yuxiong He"/>
        <date year="2022"/>
      </front>
      <seriesInfo name="ICML" value="2022"/>
    </reference>
      </references>
  </back>
</rfc>
