2026-11-26 15:51 UTC

DeepSeek MegaMoE uses Blackwell’s two-die memory locality

state: expiredheat: mediumuncertainty: mediumrelevance: mediumgpu-memory-topology blackwell inference-performanceVincent ZhongDeepSeek

What is this?

Vincent Zhong’s October 23, 2026 article examines DeepSeek’s MegaMoE implementation in DeepGEMM on NVIDIA Blackwell. It describes a single B200/B300 GPU package as two memory-locality domains: each die has its own SMs and attached HBM, so accesses to the other die’s memory cross NV-HBI. The article says MegaMoE measures which die each SM is nearer to, places weight slices by die, and schedules work locally first, allowing cross-die task stealing only when there is enough work to justify it. It attributes claims of roughly 100 W lower package power and 5–10% higher GPU clocks under heavy load to DeepSeek release notes; the supplied sources do not include independent verification or workload details for those figures.

Why it matters

The article offers a concrete example of how a GPU that looks like one device to software can have meaningful memory-locality differences inside the package. DeepGEMM’s die-aware placement and scheduling could help MoE workloads avoid unnecessary cross-die traffic, with potential power and clock benefits. More broadly, as accelerators are built from multiple dies, software may need to account for hardware topology even within a single GPU. The performance figures are attributed to DeepSeek and lack independent verification in the supplied evidence.

Current assessment

Vincent Zhong’s October 23, 2026 article describes DeepSeek’s MegaMoE implementation in DeepGEMM for Blackwell B200/B300 GPUs. It says each package has two dies with separate SMs and attached HBM, and that accessing the other die’s memory incurs cross-die traffic over NV-HBI. The described implementation probes SM-to-memory latency to infer locality, places weight slices in die-local memory, and schedules local tasks first, allowing cross-die stealing only when there is enough work to justify it. The article attributes roughly 100 W lower package power and 5–10% higher GPU clocks under heavy load to DeepSeek release notes; the supplied sources do not provide workload details or independent verification. It also says CUDA lacks a direct API for allocating on a specific die at the time described, and that CUDA 13.4 support was expected, not yet available. The source is an implementation-focused technical analysis, not a broad benchmark or adoption report; its significance is as evidence that multi-die locality can matter within one GPU and invite more topology-aware kernel design.

Measured heat

no measured readings yet — the hourly heat pass fills this in

How the heat travelled

10-22 13:00⭐ origin echo-reconstructedExplains how DeepGEMM’s MegaMoE detects Blackwell’s two memory-locality domains, places weights by die, and schedules work to favor local me
Vincent Zhong on blog (echo) · attributed from hn.story.50240148
—
10-26 07:08first on hacker news · published · +90.1hBlackwell Brings NUMA Back, Inside One GPU
frostbyte7
—
10-26 07:08amplified on hacker news 👑hn.story.50240148
frostbyte7
peak 2 · 0 comments · 98% of case engagement
10-26 07:27our radar first saw it · +90.5hdiscovery anchor: hn.story.50240148—

Evidence (2) — ⭐ canonical anchor

sourceobjectauthorscorecomments
🟧 hnBlackwell Brings NUMA Back, Inside One GPU
Retrieved article excerpt

Open article · Retrieved 2026-10-26T07:27:57.253598+00:00

# Blackwell Brings NUMA Back, Inside One GPU

Die-Local Memory and Scheduling in DeepGEMM's MegaMoE

Vincent Zhong · October 23, 2026

[One B200/B300 package as two dies joined by NV-HBI: each die's SMs read the half of the weights in their own HBM, and steal tasks from the other die only in layers with two or more waves of work](https://vincentzed.com/diagrams/blackwell-numa/locality-domains.webp)

**Figure 1:** Each die holds half of the weight rows in its own HBM and has its own task counter. A task is stolen across NV-HBI only when the layer has 2+ waves of work.

On Blackwell (SM100) we are back to solving NUMA problems, inside a single GPU package.

To software, a B200 or B300 looks like one big GPU. CUDA shows one device with a flat address space and a unified L2, and you launch kernels across all the SMs just like you did on Hopper. Physically, though, it is two separate silicon dies joined by NV-HBI. The link is fast, but HBM attached to your own die is still noticeably closer than HBM attached to the other one. If you ignore this, memory-heavy kernels like MoE layers pull half their weights across the link, which costs latency and power.

DeepSeek recently handled this in DeepGEMM for their MegaMoE kernel ([deepseek-ai/DeepGEMM#462](https://github.com/deepseek-ai/DeepGEMM/pull/462)). All the code below comes from that implementation.

## Two locality domains[#](https://vincentzed.com/writing/blackwell-numa#two-locality-domains)

Each die is a locality domain with its own SMs and its own HBM stacks. CUDA has no API that tells you which SM sits on which die, so DeepGEMM measures it at startup. It puts one buffer on each die and has every SM chase a chain of pointers through both, timing the hops with `clock64`:

```
template <uint32_t kNumHops, uint32_t kNumChunksPerSM, uint32_t kNumChunkBytes>
__global__ __launch_bounds__(32, 1)
void locality_domain_probe_chase(const uint32_t* buf, uint16_t* out) {
    if (threadIdx.x != 0)
        return;
    const auto sm_idx = ptx::get_sm_idx();
    for (uint32_t chunk_idx = 0; chunk_idx < kNumChunksPerSM; ++ chunk_idx) {
        const auto chunk = buf + static_cast<uint64_t>(sm_idx * kNumChunksPerSM + chunk_idx) * (kNumChunkBytes / 4);
        uint32_t idx = ptx::ld_global_cg(chunk);
        const auto start = clock64();
        #pragma unroll
        for (uint32_t i = 0; i < kNumHops; ++ i)
            idx = ptx::ld_global_cg(chunk + idx);
        const auto cycles = clock64() - start;
        out[sm_idx * kNumChunksPerSM + chunk_idx] = idx == 0xffffffffu ? 0u : static_cast<uint16_t>(cycles / kNumHops);
    }
}
```

The probe launches one 32-thread block per SM, and each block reserves the full capacity of shared memory so no SM can run two of them at once. Only thread 0 does the chase. Each 4 KB chunk is 32 cache lines, and each line points 7 lines ahead, so every load waits on the one before it. The loads use `ld.global.cg` to bypass L1, and L2 is flushed beforehand, so the cycles measure HBM round-trip latency.

Each SM is assigned to whichever die it reads faster, taking the median over 8 chunks. The measurement is only accepted if the far die is at least 1.25x slower across the board and both SMs in every TPC agree. The two SMs in a TPC are physically paired, so disagreement means the measurement is noise. DeepGEMM retries up to 5 times and otherwise falls back to an even split. And because the scheduler expects an exact 50-50 balance, asymmetry from harvested SMs is fixed by reassigning a few TPCs to the smaller side.

## Slicing the weights across dies[#](https://vincentzed.com/writing/blackwell-numa#slicing-the-weights-across-dies)

Once you know where each SM lives, the next problem is memory placement. Instead of storing MoE weights as one big flat array, MegaMoE splits each tensor along N. So `(*B, N, K)` becomes `(2, *B, N/2, K)`, with slice d stored in die d’s HBM:

```
def localize(t: torch.Tensor, dim: int = -2) -> torch.Tensor:
    num_domains, dim = get_num_locality_domains(), dim % t.dim()
    assert t.size(dim) % num_domains == 0
    localized = empty_per_domain((*t.shape[:dim], t.size(dim) // num_domains, *t.shape[dim + 1:]), t.dtype)
    localized.copy_(t.unflatten(dim, (num_domains, -1)).movedim(dim, 0))
    return localized
```

Behind the scenes, `empty_per_domain` reserves one virtual address range and maps each half onto physical memory on its own die using the CUDA virtual memory APIs (`cuMemAddressReserve`, `cuMemMap`). CUDA cannot allocate on a specific die directly yet—that should arrive in CUDA 13.4. Until then, DeepGEMM gets die-local memory through MLOPart, an MPS mode that exposes each die as a separate CUDA device. DeepGEMM spins up a private MPS server in a helper process, does the allocation there, and passes each chunk back to the main process as a shareable file descriptor.

## Affinity scheduling and work stealing[#](https://vincentzed.com/writing/blackwell-numa#affinity-scheduling-and-work-stealing)

Having localized data only helps if your thread blocks run on the right SMs. MegaMoE uses a persistent scheduler where each die gets its own task counter. A task pulled from die d’s counter maps to die d’s half of N, so by default an SM reads weights only from its own HBM. When its own queue runs dry, an SM can steal from the other die, but only if the layer has at least two waves of work. For smaller layers, stealing is skipped entirely:

```
template <uint32_t kNumClusters>
static CUTLASS_DEVICE bool get_next_task_idx(const uint32_t* task_count_ptr, const uint32_t& locality_domain_idx, const uint32_t& num_m_blocks,
                                             uint32_t& m_block_idx, uint32_t& n_cluster_idx) {
    constexpr uint32_t kNumLocalClusters = kNumClusters / kNumLocalityDomains;
    // One lane does an atomic add on this die's counter and broadcasts the result
    const uint32_t task_idx = get_next_local_task_idx(task_count_ptr, locality_domain_idx);
    if (task_idx >= num_m_blocks * kNumLocalClusters)
        return false;
    m_block_idx = task_idx / kNumLocalClusters;
    // Clusters [d * kNumLocalClusters, (d + 1) * kNumLocalClusters) cover die d's half of N
    n_cluster_idx = locality_domain_idx * kNumLocalClusters + task_idx % kNumLocalClusters;
    return true;
}

template <uint32_t kNumClusters>
CUTLASS_DEVICE bool get_next_task_idx(const uint32_t* task_count_ptr, const uint32_t& num_m_blocks,
                                      uint32_t& m_block_idx, uint32_t& n_cluster_idx) const {
    // 1. This SM's own die first
    if (get_next_task_idx<kNumClusters>(task_count_ptr, sm_locality_domain_idx, num_m_blocks, m_block_idx, n_cluster_idx))
        return true;
    // 2. Steal from the other die only with 2+ waves of work (one wave = kNumSMs / 2 two-SM clusters)
    return kNumLocalityDomains > 1 and num_m_blocks * kNumClusters >= kNumMinStealWaves * (kNumSMs / 2) and
           get_next_task_idx<kNumClusters>(task_count_ptr, sm_locality_domain_idx ^ 1, num_m_blocks, m_block_idx, n_cluster_idx);
}
```

Stealing across dies means higher memory latency and a busier link. For a few leftover tiles it is faster to let the local die finish them; with two or more waves of work, the steal pays for its penalty.

## Hardware addressing with TMA[#](https://vincentzed.com/writing/blackwell-numa#hardware-addressing-with-tma)

The die split is also encoded in the Tensor Memory Accelerator (TMA) descriptor. The weight tensor map is 4D, and one dimension is the die index: `[K, N/2, die, expert]`. Instead of pointer math, each CTA picks the half with a coordinate:

```
// Each CTA of the 2-SM cluster loads its own BLOCK_N slice
const auto n_block_idx = task_info.n_cluster_idx * 2 + (is_leader_cta ? 0u : 1u);
// half_idx: which die's slice holds this N block
const uint32_t half_n = shape_n / 2, n_idx = n_block_idx * BLOCK_N, half_idx = n_idx >= half_n;
const uint32_t half_n_idx = n_idx - half_idx * half_n, expert_idx = task_info.is_shared() ? 0 : task_info.local_expert_idx;

// TMA coordinates: [k, n within the half, die, expert]
tma::copy_nd<BLOCK_K, LOAD_BLOCK_N, kSwizzleBMode, weight_dtype_t, 4>(
    tensor_map_b_ptr, &shared_storage.full_barriers[stage_idx], shared_storage.smem_b[stage_idx],
    2,  // 2-CTA load: completion is signaled to the leader CTA's barrier
    k_idx, half_n_idx, half_idx, expert_idx);
```

The stride along the die dimension steps directly across the physical split in memory, so `half_idx` decides which die serves the load. Normally that coordinate matches the SM’s physical die, so traffic stays local. Only stolen tasks, or SMs on reassigned TPCs, read across NV-HBI. The inner loop needs no branches or address recalculation.

DeepSeek’s release notes mention this saves about 100 W of package power and gives 5-10% higher GPU clocks under heavy load.

As chips scale by stitching dies together, the hardware gets less uniform, not more. Treating one GPU as two locality domains takes more engineering up front, and it pays for itself.
frostbyte720
🟧 echo.blog ⭐Explains how DeepGEMM’s MegaMoE detects Blackwell’s two memory-locality domains, places weights by die, and schedules work to favor local meVincent Zhong——

Interpretation history

Decision trace