DeepEP, Part 2: A Year of V1

What changed in DeepEP between its release in February 2025 and the V2 rewrite, from adaptive routing and NVLink for decoding to TMA copies and 10-bit combines, measured on the same machine

October 10, 2026 · Markdown · Whole series as Markdown

Series: Part 1 · Part 2 · Part 3 · Part 4

In part 1, we went through the first commit of DeepEP, DeepSeek's library for the two all-to-all steps of an MoE layer: dispatch, which sends every token to the GPUs that hold its experts, and combine, which brings the expert outputs back and adds them up. That release had two kernel families. The normal kernels, for training and prefill, count the tokens first, make the CPU wait for the counts, and then stream the data through ring buffers, forwarding it over NVLink after it has arrived over the network. The low-latency kernels, for decoding, reserve a fixed slot for every token that could possibly arrive and write into it with RDMA, which the GPU drives directly.

DeepEP V1 then stayed in use for more than a year, until the V2 rewrite in April 2026, and it changed a lot in that time. The repository got 208 commits (not counting merges) between the first release and the last V1 commit on February 3, 2026, and many of them came from outside DeepSeek, from teams at Tencent, Baidu, NVIDIA, Alibaba and others. Almost every answer that part 1 gave to its four questions (what is sent, how the receiver knows, which layout the experts get, and what it costs) changed along the way, some of them more than once.

In this part, I will go through these changes by topic rather than by date, since most topics span several commits. For each one, I will look at what the code did before and after, and why. Along the way, I will compare three builds on the same machine with eight B300 GPUs that I used in part 1: the first release (V1.0), the v1.2.1 tag from September 15, 2025, which is the only release tag V1 ever got, and the last V1 commit from February 2026. As in part 1, the machine has no RDMA network cards, so only the kernels that run inside one machine could be measured, and the code snippets assume import torch.

1. The Year in Commits

Before going into the details, Figure 1 puts the changes on a timeline, together with what happened in DeepGEMM, the GEMM library that consumes DeepEP's output.

Timeline of DeepEP V1 and DeepGEMM in 2025
Figure 1: The main changes to DeepEP V1 (top) and DeepGEMM (bottom) between February 2025 and February 2026.

As we can see in Figure 1, the changes come in three waves. In March 2025, right after the release, came DeepSeek's own fixes, mainly around adaptive routing. Between April and July, most of the performance work landed: NVLink for the low-latency kernels, GPU-driven RDMA for the normal kernels, TMA copies, and the end of the patched NVSHMEM. From August on, the changes were mostly about formats, operations and new GPUs, and the bigger ideas moved into separate branches, several of which look a lot like what V2 later did.

2. Adaptive Routing and Atomics

2.1 What Adaptive Routing Breaks

The first change after the release was about the network itself. An InfiniBand switch normally sends all packets from one port to another along the same path, which keeps them in order but lets two busy flows collide on one link while another link sits idle. Adaptive routing (AR) lets the switch pick a less loaded path for each packet. The README of the first release said that the low-latency kernels supported it, but that "enabling adaptive routing for normal internode kernels may lead to deadlocks or data corruption issues", and the Python code reminded users that AR "must be off".

Why would a routing feature corrupt data? Remember from part 1 that the internode kernels use two ring buffers across the network: the sender advances a tail on the receiving machine, and the receiving machine sends the head back as a credit, so that the sender knows which slots it can reuse. In the first release, the forwarders sent their head back as a plain RDMA write of the new value (nvshmem_uint64_p). If the switch sends two of those writes along different paths, the older value can arrive after the newer one, and the head moves backwards, as shown in Figure 2.

Plain writes versus atomic adds under adaptive routing
Figure 2: Two credit updates take different paths through the network and arrive in reverse order. A plain write leaves the older value behind (left); atomic adds of the differences give the right result in any order (right).

We can see how often that goes wrong with a tiny simulation. The forwarders report six heads in a row, and the network delivers the six messages in a random order:

torch.manual_seed(0)
heads = [3, 7, 12, 20, 26, 31]                   # the forwarders' progress

# Before: write the new head (a plain RDMA write, last one wins)
# After: add the difference to the old head (an RDMA atomic)
deltas = [h - p for h, p in zip(heads, [0] + heads[:-1])]
regressions = 0
for trial in range(1000):
    order = torch.randperm(len(heads)).tolist()  # adaptive routing reorders
    written = 0
    added = 0
    for i in order:
        written = heads[i]
        added += deltas[i]
    regressions += written != heads[-1]
    assert added == heads[-1]
print(f"plain writes ended on a stale head in {regressions} of 1000 runs; "
      f"atomic adds never did")
# plain writes ended on a stale head in 831 of 1000 runs; atomic adds never did

A stale head means the sender thinks slots are still in use when they are free, and since the next update may never come, the sender can wait forever, which is the deadlock the README warned about.

2.2 The Fix

The fix, which landed on March 5, 2025 (commit 458cdcb), is the second half of the snippet: instead of writing the new head, the forwarder coordinator adds the difference between the new head and the last one it reported, using an atomic add (nvshmemx_signal_op with NVSHMEM_SIGNAL_ADD). Additions commute, so the order of arrival no longer matters:

// csrc/kernels/internode.cu, forwarder coordinator, after 458cdcb (cut down)
if (min_head != INT_MAX and min_head > last_head and lane_id < kNumRDMARanks) {
    nvshmemx_signal_op(rdma_channel_head.buffer(rdma_rank),
                       min_head - last_head, NVSHMEM_SIGNAL_ADD,
                       translate_dst_rdma_rank<kLowLatencyMode>(
                           lane_id, nvl_rank));
    last_head = min_head;
}

The tail already worked this way, so after this commit, the README's warning was gone and its recommendation became the same for both kernel families: enable adaptive routing when the network is heavily loaded, and use static routing when it is lightly loaded.

Nine days later, the low-latency kernels got the same treatment (commit 2d0cf41, "Low latency kernels use rdma atomic to support AR"). In part 1, we saw that V1.0 signalled the arrival of a count with an RDMA write with immediate data, which the receiver detected by polling its completion queue for the matching receive. That relied on the receive queue that DeepSeek's NVSHMEM patch added, and on the order of messages within a queue pair. The new code sends the count as an atomic add into a zero-initialized word, and the receiver simply spins on that word:

// csrc/kernels/internode_ll.cu after 2d0cf41, receiving side (cut down)
while ((num_recv_tokens = ld_acquire_global(
            rdma_recv_count + local_expert_idx * num_ranks + src_rank)) == 0);
num_recv_tokens = -num_recv_tokens - 1;

The -n - 1 encoding from part 1 does the rest: a zero means "not arrived yet", and any arriving count is negative.

3. Decoding Learns to Use NVLink

3.1 RDMA Between Neighbors

The low-latency kernels of the first release used RDMA for every destination, including the GPUs in the same machine. A token going from GPU 0 to GPU 3 of the same machine went down to GPU 0's network card, out to the switch, back into GPU 3's network card, and up into GPU 3's memory, even though the two GPUs were connected by NVLink. The reason was simplicity: with one transport, every destination looks the same to the kernel.

On a small expert-parallel group, though, most destinations are neighbors. With 8 GPUs, every destination is in the same machine, and with 16 GPUs on two machines, half of them are. In May 2025, a contribution from Baidu (commit 68ae8b3, "LL nvlink p2p") added a check to every send: if NVSHMEM can map the destination's buffer into this GPU's address space, write to it directly over NVLink; otherwise, post an RDMA write as before. Figure 3 shows the two paths.

The low-latency path to a neighbor, before and after
Figure 3: A low-latency dispatch from GPU 0 to GPU 3 of the same machine in the first release (left), which goes through both network cards, and after May 2025 (right), which uses NVLink.

The change itself is short. When NVSHMEM sets up its symmetric heap, it maps the heaps of all GPUs that are reachable over NVLink into each GPU's address space, much like the CUDA IPC handles that the normal kernels exchange. It keeps, for every peer, the base address at which the peer's symmetric heap is mapped into the local address space (peer_heap_base_p2p), or zero if the peer can't be reached that way. The kernel translates the remote address by the offset between the two heaps and copies the token with an ordinary warp copy:

// csrc/kernels/internode_ll.cu after 68ae8b3, dispatch send (cut down)
void *peer_base = (void *)__ldg((const long long unsigned *)
                      nvshmemi_device_state_d.peer_heap_base_p2p + dst_rank);
if (peer_base) {        // reachable over NVLink: store directly
    char *dst = (char *)peer_base +
                ((char *)dst_ptr - (char *)nvshmemi_device_state_d.heap_base);
    UNROLLED_WARP_COPY(8, lane_id, num_int4_per_msg, (int4 *)dst,
                       (const int4 *)src_ptr, ld_nc_global, st_na_global);
} else {                // another machine: post an RDMA write
    nvshmemi_ibgda_put_nbi_warp(dst_ptr, src_ptr, num_bytes_per_msg,
                                dst_rank, dst_expert_local_idx, lane_id,
                                slot_idx);
}

The count and the combine's finishing flag got the same branch, with a release store instead of an RDMA atomic.

3.2 What It Bought

According to the README, which DeepSeek updated with the new numbers in June, the low-latency dispatch on 8 GPUs went from 163 us to 77 us, and the combine from 318 us to 114 us (for 128 tokens on H800). On 16 GPUs, where half of the destinations are inside the machine, dispatch went from 173 us to 118 us. On 64 GPUs, where almost all traffic leaves the machine, dispatch only went from 186 us to 173 us, as we would expect.

On the B300 machine, the low-latency kernels of v1.2.1 take 31.4 us for a dispatch of 128 tokens per GPU and 42.6 us for the combine (the sum of all kernels of each call; DeepEP's own test, which times them slightly differently, reports 30.0 us and 39.5 us). That is much less than the README's 77 and 114 us, but the GPUs, the CUDA version and the timing method are all different, so I wouldn't read the ratio as the speedup of anything in particular.

There is an interesting consequence: on one machine, the low-latency kernels are now faster than the normal ones even for batches of several hundred tokens. We can see this in Figure 4, which compares the two on the B300 machine for batches of up to 512 tokens per GPU.

Low-latency and normal kernels on one machine
Figure 4: Summed device-kernel durations for the low-latency and normal kernels of DeepEP v1.2.1 on eight B300 GPUs, by tokens per GPU. FP8 dispatch and BF16 combine; CPU waits and inter-kernel gaps are excluded.

As shown in Figure 4, a normal dispatch of 128 tokens takes 63 us, twice as long as the low-latency one, partly because it includes the layout and notify kernels. And that is before the CPU wait for the counts, which the plotted kernel sum leaves out and which would make the gap larger. The low-latency kernels pay for their speed with memory, though: at 512 tokens per GPU, the buffer from part 1's formula grows to 7 GiB per GPU, which is one reason they stayed a decoding tool.

4. The GPU Drives the Network Card

4.1 Proxy and IBGDA

The normal internode kernels of the first release used NVSHMEM's default InfiniBand transport, IBRC. In IBRC, a GPU thread that wants to send something writes a request into a queue in host memory, and a CPU thread, called the proxy, picks it up and posts it to the network card. The low-latency kernels, in contrast, used IBGDA, where the GPU writes the network card's work request and rings its doorbell itself. Figure 5 shows the two.

IBRC with a CPU proxy versus IBGDA
Figure 5: With IBRC (left), every GPU-initiated transfer goes through a CPU proxy thread. With IBGDA (right), GPU threads write the work request into the send queue and ring the doorbell directly.

The proxy has two costs. Every message waits for the CPU thread to notice it, and one proxy thread with one queue pair per peer limits how many transfers can be in flight. In April 2025, Tencent's network team contributed a change (commit 5ab80c2, merged as PR #130) that moved the normal kernels to IBGDA as well and gave every channel its own queue pair. In their words: "a single QP is used for data transfer between two GPUs, which limits kernel performance in network card dual-port and RoCE network scenarios." The reason is that both the card and the network spread traffic per queue pair, not per message: a dual-port card puts each queue pair on one of its ports, and a RoCE network picks one path per queue pair by hashing its packet headers. With one queue pair between two GPUs, all their traffic ends up on one port and one path. The README got a news entry ("performance was enhanced by up to 30%"), and its internode numbers changed from 44 to 58 GB/s on 32 GPUs and from 46 to 51 GB/s on 64.

A month later, commit 9fe9021 ("Use IBGDA only") replaced the remaining NVSHMEM puts in the counting kernels with DeepEP's own IBGDA code, including a simplified completion-queue poll, and turned the barriers between machines into lighter nvshmem_sync calls. From then on, the data transfers and signals of both kernel families were work requests written by GPU threads.

4.2 Smaller Fixes Along the Same Line

A few more changes in this area are worth knowing about, because they show what kind of problems a GPU-driven network stack runs into:

4.3 Out-of-Order Senders

One more change in this area is a nice piece of engineering. In part 1, the 7 RDMA sender warps of a channel took tokens strictly in order, using a lock in shared memory, so that a token's slot in a machine's send buffer was only marked as filled after all earlier slots were. A slow warp held up all the others. In June 2025, commit bc118b2 removed the waiting in two steps.

The first step is about handing out the slots. Instead of taking turns, every sender warp now walks over all of the channel's tokens and reads each token's destination mask, but copies only every 7th token, its own. Since every warp sees the same sequence of masks, every warp can count for itself how many earlier tokens went to machine m, and that count is the slot of the current token in machine m's buffer. No warp has to ask any other, and reading a mask is cheap compared with copying a 7 KB token. Figure 6 shows this for one channel.

Slot assignment without a lock
Figure 6: The tokens of one channel, the machines each one goes to, and the warp that copies it. Every warp reads all of the masks, so warp 3 can work out by itself that six earlier tokens go to machine 1 and that t10 takes slot 6 there.

In the figure, warp 3 copies tokens t3 and t10. To find t10's slot in machine 1's buffer, it doesn't need to know where warps 0 to 2 are; it counts the tokens to the left of t10 that go to machine 1, six of them, and writes t10 into slot 6. Every other warp computes the same counts for its own tokens, so no two warps can pick the same slot.

The second step is about reporting the slots as filled. The coordinator may only send slots up to the first one that is still being written, so the warps need to agree on a tail. For this, the commit adds what the code calls a transaction window: for every destination machine, a 32-bit mask of the slots that have been filled but are not yet covered by the tail. A warp that finishes a slot sets its bit, and if it was the oldest slot, it advances the tail over the whole run of finished slots in front of it. In Python, the release step looks like this:

def release(window, tail, slot):
    """A sender warp finished `slot`; move the tail if it can."""
    offset = slot - tail
    assert 0 <= offset < 32                  # at most 32 slots in flight
    window |= 1 << offset
    if offset == 0:                          # the oldest slot just finished
        run = (window ^ (window + 1)).bit_length() - 1   # trailing ones
        tail += run
        window >>= run
    return window, tail

window, tail = 0, 0
for slot in [2, 0, 1, 4, 3, 5]:              # warps finish out of order
    window, tail = release(window, tail, slot)
    print(f"slot {slot} done -> tail {tail}")
# slot 2 done -> tail 0
# slot 0 done -> tail 1
# slot 1 done -> tail 3
# slot 4 done -> tail 3
# slot 3 done -> tail 5
# slot 5 done -> tail 6

If you have seen how an out-of-order CPU retires instructions, this is the same idea: work finishes in any order, but becomes visible in order. The kernel does the trailing-ones count with __ffs(~window) - 1 and keeps the window in shared memory behind a small lock that is only held for these few instructions.

4.4 Goodbye to the Patched NVSHMEM

The first release needed DeepSeek's own patch to NVSHMEM 3.1.7: it added a receive queue to IBGDA (used by the write-with-immediate signalling from section 2), changed how queue pairs were created and how completions were tracked. After the AR fix, the receive queue was no longer needed, and in July 2025, NVIDIA engineers contributed a series of commits (starting with 441833d) that moved DeepEP onto stock NVSHMEM 3.3.9. They also documented how to use NVSHMEM's CPU-assisted IBGDA, a mode in which the CPU rings the doorbell on the GPU's behalf, for machines where the driver settings that IBGDA needs can't be changed. From then on, pip install nvidia-nvshmem-cu12 was enough. (This is also why I could build the first release on the B300 machine at all: NVSHMEM 3.4.5 has the queue fields that V1.0's IBGDA code expects, except for the receive queue.)

5. TMA and More Warps

5.1 Two Changes to the Intranode Kernels

In part 1, the intranode dispatch of the first release reached 183 GB/s on the B300 machine with 24 SMs, and the measurement suggested that it was limited by its SMs rather than by NVLink. Two changes in 2025 addressed exactly that.

The first, in March 2025 (commit 1553fc4, "Improve EP2/4 performance"), gave every destination GPU several warps instead of one. The first release's dispatch kernel ran 8 warps per SM, one per destination; the new one ran 16 (512 threads), so that each destination got two warps and more memory requests were in flight at once. The TMA change below raised it again, to 24 warps.

The second, in June 2025 (commit c8dceba, "Use TMA instead of LD/ST for intra-node normal kernels"), replaced the receivers' copy loops with the Tensor Memory Accelerator, and the commit message lists "Enable more warps" among its steps. TMA is a copy unit in every SM of Hopper and newer GPUs. One thread hands it a source, a destination and a size, and the unit moves the bytes on its own, without the data passing through the registers of 32 threads. A copy goes global memory to shared memory (a TMA load) and shared memory to global memory (a TMA store), and an mbarrier in shared memory tells the thread when the load has landed. Figure 7 shows the difference.

A warp copy versus a TMA copy
Figure 7: Copying one 14 KB token with ordinary loads and stores (left), where every byte passes through the registers of a warp, and with TMA (right), where one thread issues a load into shared memory and a store out of it.

Here is the receiver's copy after the change. Each warp gets 8 KB of shared memory, so a BF16 token of 14 KB is moved in two halves:

// csrc/kernels/intranode.cu after c8dceba, dispatch receiver (cut down)
for (int i = 0; i < 2; ++ i) if (lane_id == 0) {
    tma_store_wait();                     // previous store left smem
    tma_load_1d(tma_buffer, shifted_buffer_x_int4 + i * half_hidden_int4,
                tma_mbarrier, half_hidden_bytes);
    mbarrier_arrive_and_expect_tx(tma_mbarrier, half_hidden_bytes);
    mbarrier_wait(tma_mbarrier, tma_phase);
    tma_store_1d(tma_buffer, shifted_recv_x_int4 + i * half_hidden_int4,
                 half_hidden_bytes, false);
}
__syncwarp();

Only lane 0 issues the TMA operations here, and the token no longer passes through anyone's registers. The other 31 lanes are still there, though. They belong to the same warp and wait at the __syncwarp(), so TMA doesn't hand any threads back to other kernels; what it saves is the register traffic and the instructions of the copy loop. The tma_store_wait() at the top of the loop is needed because both halves use the same shared-memory buffer, so the second load must not start before the first store has finished reading from it. The commit message also records a decision: "Do not use TMA for senders". The senders still copy with loads and stores into the other GPU's memory, and V1's intranode kernels use TMA only for copies whose destination is in the local GPU's memory. (We will see in part 3 that V2 uses TMA stores straight into the peer's memory.) In July, the same idea moved into the internode kernels (commits a2fa3b7 and 06f417d) and into the send phase of the low-latency combine (commit c874cb7).

5.2 What It Bought

Figure 8 compares the first release with v1.2.1 on the B300 machine, for 4,096 tokens per GPU and a range of SM counts.

V1.0 and v1.2.1 on B300 by number of SMs
Figure 8: Bandwidth of the intranode dispatch (left) and combine (right) of DeepEP V1.0 and v1.2.1 on eight B300 GPUs, 4,096 tokens per GPU. The time is the sum of the kernel durations, without CPU time or gaps between kernels.

As we can see in Figure 8, dispatch improved across the SM sweep: with 24 SMs, a dispatch now takes 459 us instead of 873 us (349 GB/s instead of 183 GB/s), and with 64 SMs it reaches 496 GB/s instead of about 310 GB/s. That is about 1.9 times the first release's rate at 24 SMs and 1.6 times at 64. Combine, on the other hand, didn't move at all; it was already running 24 warps per SM in the first release, and on this machine it ends up at 407 GB/s with 24 SMs and 602 GB/s with 64, within a few percent of the first release. The last V1 commit from February 2026 is within 1% of v1.2.1 on every point I measured, so for intranode traffic, V1 was essentially finished by the summer of 2025 (I can't say the same for the internode kernels, which I couldn't measure).

6. Getting Rid of the CPU Wait

6.1 The Worst Case Instead of the Exact Count

The normal dispatch's CPU wait from part 1 had the consequence that the normal kernels couldn't be captured in a CUDA graph. In June 2025, commit a8299ca added a way around it for the intranode case, num_worst_tokens. If the caller passes it, DeepEP skips the CPU wait and allocates the output for the worst case instead:

// csrc/deep_ep.cpp after a8299ca, intranode_dispatch (cut down)
if (num_worst_tokens > 0) {
    // No CPU sync, just allocate the worst case
    num_recv_tokens = num_worst_tokens;
    // Must be forward with top-k stuffs
    EP_HOST_ASSERT(topk_idx.has_value());
    EP_HOST_ASSERT(topk_weights.has_value());
} else {
    // Synchronize total received tokens and tokens per expert
    // ... the spin loop from part 1
}

The worst case is that every token of every GPU comes to this GPU, so for 4,096 tokens per GPU on 8 GPUs, the output has 32,768 rows, of which about 21,600 are used with uniform routing. In exchange, the call has fixed sizes and can be in a graph. At the end of the kernel, the top-k indices of all unused rows are set to -1, so the GEMM that follows can tell the real tokens from the padding, and the per-expert counts are no longer returned to Python (the docstring says the list is then empty). That is the same trade as the masked layout from part 1, applied to the normal kernels. In November 2025, the internode dispatch got the same option (commit 92fe2de, PR #438).

6.2 Fewer Barriers

The first release synchronized the GPUs of a machine with a FIFO of barrier slots in each GPU's buffer (the task_fifo_ptrs in part 1's code). In June 2025, commit 8da2d7b ("Fully remove barrier FIFO designs") replaced it with a simpler barrier on signal words.

7. Smaller Data Formats

7.1 UE8M0 Scales

The FP8 tokens that DeepEP sends carry one fp32 scale per 128 channels, which is 224 bytes per token. Blackwell GPUs changed what the GEMM wants: DeepGEMM's SM100 kernels, which became public in July 2025, expect the scales in UE8M0, an 8-bit format that stores only an exponent, so that every scale is a power of two. Four of them are packed into one 32-bit integer.

DeepEP added the matching scale option in June 2025 (commit 21efbe9, "Support UE8M0 data format"). With round_scale=True, the low-latency dispatch rounds each scale up to the next power of two, and with use_ue8m0=True, it sends only the exponent byte. We can see what that costs in accuracy:

torch.manual_seed(0)
x = torch.randn(4, 7168) * torch.rand(4, 1) * 10       # 4 tokens
blocks = x.view(4, -1, 128)
amax = blocks.abs().amax(-1, keepdim=True).clamp(min=1e-4)

exact_inv = amax / 448                                  # fp32 scale
exp = torch.ceil(torch.log2(exact_inv))                 # round up
ue8m0_inv = torch.exp2(exp)                             # a power of two
ue8m0 = (ue8m0_inv.view(torch.int32) >> 23).to(torch.uint8)  # exponent byte

def roundtrip(inv):
    q = (blocks / inv).to(torch.float8_e4m3fn)
    return q.float() * inv

for name, inv in (("fp32 scales", exact_inv), ("UE8M0 scales", ue8m0_inv)):
    err = (roundtrip(inv) - blocks).norm() / blocks.norm()
    print(f"{name}: relative error {err:.4f}")
byte = ue8m0[0, 0, 0].item()
print(f"one scale is the byte {byte}, which means 2^{byte - 127}")
# fp32 scales: relative error 0.0257
# UE8M0 scales: relative error 0.0264
# one scale is the byte 124, which means 2^-3

Rounding the scale up means the largest value of a block no longer maps to 448 but to somewhere between 224 and 448, which costs a little precision (here, 2.64% relative error instead of 2.57%). The scale shrinks from 4 bytes to 1, and the exponent byte is literally bits 23 to 30 of the fp32 scale, which is what DeepEP's extract_required_scale_format does with one shift. Figure 9 shows the bits of the scale from the snippet.

An fp32 scale and its UE8M0 byte
Figure 9: The fp32 scale 2^-3 and the byte that UE8M0 keeps of it. A power of two has an all-zero mantissa, so the 8 exponent bits carry the whole value, and four such bytes fit into one 32-bit integer.

Since the mantissa of a power of two is zero, dropping the other three bytes loses nothing that rounding hadn't already removed. The byte 124 stands for 2 to the power 124 - 127 = -3, with the same bias of 127 that fp32 uses, so converting it back is a shift in the other direction.

7.2 LogFMT for the Combine

The combine was the bigger target, since it sends BF16, twice the bytes of an FP8 dispatch, and it is the slower half of a low-latency round trip. In July and August 2025 (commits 1cf85fb and c5facf5), DeepEP added use_logfmt=True to the low-latency combine, which sends the expert outputs in a 10-bit logarithmic format that the docstring calls "LogFMT with dynamic per-64-channel cast".

The idea is to spend the bits on the exponent rather than on the mantissa. For every group of values, the kernel computes the logarithms of the largest and smallest magnitudes, divides the range between them into 510 equal steps on the log scale, and sends each value as a sign bit and a 9-bit step index (index 0 means zero). If a group doesn't fit the scheme (its largest magnitude is 1 or more, or all its nonzero magnitudes are equal), the group is sent in BF16 instead. Figure 10 compares the resulting grid of values with FP8's.

FP8 and LogFMT-10 grids
Figure 10: The values that FP8 E4M3 (left) and LogFMT-10 (right) can represent within one octave. FP8 always has 8; LogFMT spreads 510 steps over the range of each group.

As we can see in Figure 10, FP8 has the same 8 values in every octave, while the density of LogFMT-10 depends on how wide a group's range is: a group that spans 10 octaves gets 51 values per octave, and even the widest range the kernel allows, 32 octaves, still gets about 16. Here is the encoding and decoding in PyTorch, following the kernel's arithmetic:

def logfmt10(x):                   # x: [..., 128], one group per 128 values
    a = x.abs()
    log_amax = torch.log2(a.amax(-1, keepdim=True))
    log_amin = torch.log2(a.clamp(min=1e-30).amin(-1, keepdim=True))
    log_amin = torch.maximum(log_amin, log_amax - 32)
    use = (log_amax < 0) & (log_amin < log_amax)      # else: send BF16
    step = (log_amax - log_amin) / 510                # 9 bits: codes 0..511
    rounding = 2 - torch.log2((1 + torch.exp2(step)) / 2) / step
    code = torch.floor(torch.log2(a) / step + rounding - log_amin / step)
    code = code.clamp(min=0)                          # code 0 means zero
    value = torch.exp2((code - 1) * step + log_amin) * x.sign()
    decoded = torch.where(code == 0, torch.zeros_like(x), value)
    return torch.where(use, decoded, x), code

torch.manual_seed(0)
y = torch.randn(1024, 128) * 0.05                     # expert outputs
y_log, code = logfmt10(y)
y_fp8 = (y / (y.abs().amax(-1, keepdim=True) / 448)).to(torch.float8_e4m3fn)
y_fp8 = y_fp8.float() * (y.abs().amax(-1, keepdim=True) / 448)
for name, z in (("BF16", y.bfloat16().float()), ("LogFMT-10", y_log),
                ("FP8 E4M3", y_fp8)):
    print(f"{name:>9}: relative error {(z - y).norm() / y.norm():.4f}")
#      BF16: relative error 0.0017
# LogFMT-10: relative error 0.0035
#  FP8 E4M3: relative error 0.0257

(I wrote the group as 128 values because the kernel's amax reduction runs over the lanes that together hold 128 BF16 values, 128 * sizeof(nv_bfloat16) bytes; the docstring says 64.) The rounding term is the subtle part: it moves the rounding boundary between two steps from the midpoint in log space to the midpoint in linear space, so that a value is rounded to whichever neighbor is closer in absolute terms.

As we can see from the output, in this synthetic sample, LogFMT-10's relative norm error is more than seven times smaller than FP8's and about twice BF16's, while sending 10/16 of BF16's bytes (plus two BF16 values per group for the range). The kernel packs 16 codes into five 32-bit words (logfmt_encode in internode_ll.cu), and the receiver decodes and accumulates in the same step, multiplying each decoded value by its router weight.

8. Running It in Production

Some changes in 2025 were not about speed at all but about running DeepEP in a service:

There were also many small extensions of what V1 accepts: more hidden sizes (2,048 up to 8,192), top-10 routing, expert-parallel groups of 24, 48, 96, 144 and 160 GPUs, Ampere GPUs for the intranode kernels (commit b8d90fb), and turning off NVSHMEM's multi-node NVLink (MNNVL) support by default, which also reduced NVSHMEM's memory use (commit df4debe).

9. What Others Built on Top

By February 2026, the README listed five experimental branches and four community forks. Here are the ones that matter for where DeepEP went next:

The README also gained a short section called "Easier potential overall design", which I think is the most interesting paragraph DeepSeek wrote about V1: "The current DeepEP implementation uses queues for communication buffers which save memory but introduce complexity and potential deadlocks. If you're implementing your own version based on DeepEP, consider using fixed-size buffers allocated to maximum capacity for simplicity and better performance." In other words, the authors themselves point at the ring buffers of the normal kernels, with their heads, tails, credits and timeouts, as the source of V1's complexity. That paragraph reads like a design note for V2, and in part 3, we will see that V2 is built exactly that way.

10. DeepGEMM in 2025

DeepGEMM, which turns DeepEP's output into expert computations, changed in the same year in ways that DeepEP had to follow:

The UE8M0 change also shows up in DeepSeek's models. DeepSeek-V3.1, released on August 21, 2025 with the same architecture as V3, says in its model card that it was trained with the UE8M0 FP8 scale format for both weights and activations, and points to DeepGEMM. So by then, the format that DeepEP added in June and DeepGEMM's SM100 kernels used from July was also the format of the model itself. (The model card doesn't say anything about which GPUs DeepSeek ran it on, so I wouldn't read it as a hint about their hardware.) V3.2-Exp, the first model with the lightning indexer, followed on September 29, and the final V3.2 on December 1.

One thing to keep in mind about all the accuracy numbers in this part: the snippets in section 7 measure how much error one cast adds to a random tensor. That tells us how the formats compare with each other, but not what they do to a trained model's outputs. Before switching a deployment to UE8M0 scales or a LogFMT combine, I would compare the outputs of a whole MoE layer, or better, the model's evaluation scores, against the BF16 path.

Similarly, all B300 numbers in this part are sums of kernel durations with uniform random routing, taken inside one machine. Part 4 measures V2.5 with a different method (cold L2 cache, CUPTI timing), so its numbers are not one more point on the curves of Figure 8.

11. Summary

To summarize, here is how the answers to part 1's four questions changed during the year of V1:

  1. What is sent. The low-latency kernels now write directly over NVLink to every GPU whose memory NVSHMEM can map, and use RDMA only for the rest. Scales can be one byte instead of four, and the low-latency combine can send 10-bit values instead of BF16.
  2. How the receiver knows. The normal kernels still use ring buffers with heads, tails and credits, but the heads sent back over the network are now RDMA atomic adds of differences, which adaptive routing can reorder without harm. The low-latency counts arrive as atomic adds that the receiver spins on, instead of writes with immediate data that it found by polling a completion queue, so the receive queue and the patched NVSHMEM are gone.
  3. The layout. Unchanged in principle, but the normal dispatch can now produce a worst-case-sized output without the CPU, which makes it usable in a CUDA graph.
  4. The cost. All RDMA is driven by GPU threads, more warps and TMA improved intranode dispatch across the measured SM budgets, and on the B300 machine, a dispatch of 4,096 tokens per GPU takes 459 us with 24 SMs instead of 873 us. The normal kernels still need many SMs to saturate a modern NVLink, though: 64 SMs reach about 500 GB/s for dispatch and 600 GB/s for combine.

What didn't change is the basic structure: two kernel families with two APIs, ring buffers for the normal kernels, and buffers that grow with the number of experts for the low-latency ones. In part 3, we will see how V2 replaced all of it with one buffer, one dispatch function and NCCL instead of NVSHMEM, and how DeepGEMM's Mega MoE kernel took a different path at the same time.

Sources