The Nvidia GPU was originally built to shade pixels, and every Nvidia generation since 2017 has bolted on another piece of AI-specific hardware to fix the bottleneck the previous one exposed. Volta added Tensor Cores, Hopper added TMA for tile data movement between HBM and SRAM, and Blackwell added Tensor Memory for accumulating. Nvidia removed many hardware units that are required to render graphics for their datacenter GPUsIn comparison, the Trainium microarchitecture is built ground-up specifically for ML workloads, with tiles as a first-class primitive instead of having a sea of threads and then bolting on tensor/tile compute and data movement engines. Trainium3 behaves the way the physics says it should. In this past this meant software was a humongous challenge, but now no longer.7 months later, Trainium 3 and TPUs are live on InferenceX, both trading blows or even winning vs Nvidia GB300 in cost to generate tokens at TCO. We will dive into those details below. This advantage is not purely due to Amazon’s ultra low cost supply chain. It's also due to microarchitectural decisions, which we will dive into in this post. For example, using the Trainium Descriptor Generation Engines (DGE), the equivalent of Nvidia TMA and AMD MI455X TDM, our microbenchmarks show that Trainium can reach peak HBM bandwidth utilization (MBU) at small message sizes, which is not possible on Nvidia GPUs. Furthermore, our testing covers cycle-level SRAM scratchpad latency and bandwidth testing (SBUF to PSUM), rack-scale bandwidth and latency microbenchmarks, attention exponential testing, and the precise cycle-level latency of different shapes, including how different attention head_dim (K) would affect the percentage of roofline. Every result comes from UBenchX, our microbenchmark suite, and we model each unit from first principles before we measure it. We thank Nafea Bshara (Co-Founder of AWS Annapurna Labs), Ron Diamant (Trainium Chief Architect), Michael Shteinbok, Armin Ebrahim and the rest of their team for helping teach us their architecture and validate our benchmark experiments. Star the InferenceX & UBenchX GitHub repository if you find the open-source benchmark and data useful! InferenceX is the only inference benchmark in the world to have TPUv7, OpenAI Jalapeño, Nvidia Rubin NVL72, AMD, and now, Trainium3. Source: SemiAnalysisAgentX measures Trainium3 on a production end-to-end agentic inference workload. This is achieved by replaying real coding-agent sessions against a Trainium3 server. The goal is to compare accelerators’ realistic inference performance, that you may expect to see on actual agentic workloads. For those unfamiliar with InferenceX, the Pareto frontiers (curves) represent the fundamental inference tradeoff between throughput and latency. Each point is a different inference configuration targeting a different latency-throughput target. At each slice of the x-axis, higher perf per TCO is better and directly leads to higher inference gross margins. Today, we are excited to share that Trainium 3 PDS + vLLM achieves amazing perf/$ TCO across the entire frontier. In fact, it is better than every other accelerator besides Vera Rubin across the entire TCO versus p90 interactivity curve. This is an amazing achievement. Source: SemiAnalysisTrainium is also very competitive from an end-to-end latency perspective, across the entire curve. With that being said, there is still room for improvement, particularly with respect to TTFT. Source: SemiAnalysisSource: SemiAnalysisIt is not surprising that Trainium lags behind in some p90 TTFT cases against GB300 as this metric is largely dictated by prefill, a compute bound operation. Trainium3 has only 17% the theoretical FP4 flops as Blackwell Ultra (2,517 TFLOPS versus 15,000 TFLOPS). It has more competitive interactivity since decode is memory bound and Trainium3 has 4.9 TB/s per chip against 8.0 TB/s for GB300, 61% of the bandwidth at about 30% the TCO. Also, pipelined prefill (which Trainium relies on, as discussed in the subsequent section) generally favors throughput over latency. In fact, at a p90 interactivity of 135 tok/s/user (a typical speed you’d observe on OpenRouter), Trainium3 with vLLM yields the highest profit margin at 73.5%, compared to runner up GB300 + SGLang at 53% (at 3 year rental prices). This assumes Z.ai list price for token pricing and a 60% hardware fleet utilization factor. Trainium3 achieves these margins with 144GB of HBM per chip, half GB300’s capacity per GPU. This reflects our Short King thesis: additional HBM capacity must deliver enough extra throughput at the target latency to justify its cost. This is also why 4-Hi is attractive industry wide option and next generation accelerators are primarily using 8-Hi. Source: SemiAnalysisWhat makes these results interesting for this article is how directly the software follows the hardware we measure in Section 2. Prefill and decode run on separate nodes, and each arranges the same 16 chips to suit the topology. A quick primer for this section: a Trainium3 chip has 8 NeuronCores, each pair sharing one HBM stack, and a node is 16 chips. Section 2 covers the hardware in detail. For a more in depth analysis, see our Trainium3 deep dive article. Source: SemiAnalysisA prefill node is a pipeline. The model’s layers are cut into 16 stages, one chip per stage, and a chunk of prompt tokens flows from chip to chip. Inside a stage, the chip’s 8 NeuronCores split the chunk between them, so all of the stage’s tensor and expert parallelism stays on one chip. This is the layout our collective benchmarks argue for. Chip-level collectives were well ahead of every wider group we tested, and all-to-all, the pattern MoE layers need, is slower once it leaves the chip. With the heavy exchanges kept on one chip, what limits a stage is TensorE, which is where the MXFP4 matmul modes covered below do their work. Source: SemiAnalysisFor decode, one copy of the model is spread across individual ranks on all 128 NeuronCores (across 16 chips), and every core takes part in the computation for each token. For those familiar with Nvidia architecture, each GPU is typically a separate rank whereas Trainium treats all 128 cores as logical devices and separate EP ranks. In the case of multi-user GLM-5.3, this assigns two routed experts per NeuronCore. Decode runs at LNC=1, so each physical NeuronCore is its own rank, whereas the rest of this article uses the default LNC=2. Again, each NeuronCore is its own device with local HBM, so nothing synchronizes across the chip unless the software invokes a collective. Nvidia added locality domains in CUDA 13.4 to pin Rubin kernels to one die’s memory in the same way. Source: SemiAnalysisNot every exchange spans the node though. Decode declares nested groups of cores: half a chip, one chip, the two chips of a tray, two trays, half the node, and the whole node, plus a second family that takes the same core position on every chip. The smaller exchanges, such as the dense layers and the shared expert, can run on the small groups. A group of 8 is one chip and a group of 16 is one tray, whose two chips share a direct link, so those exchanges never touch a switch. But activations are gathered across all 128 cores and the expert outputs are reduced across all 128, so that traffic crosses the switch on every layer. Trainium’s profiler is by far the industry leader and is state of the art (SOTA). Trainium’s profiler is loved by all the performance engineers at Anthropic. Anthropic’s head of performance has publicly said that performance analysis on Trainium is way better than performance analysis on Nvidia GPUs (and obviously better than on AMD GPUs). In order to demonstrate how fine-grained their profiler is, we recreated the Olympic performance of the Bay Area’s own Alysa Liu on the actual Trainium3 hardware profile. We were mainly inspired by the Bad Apple post from Daniel Liu (Anthropic Performance Engineer). This combines fine art, performance art, and chip architecture all into one video. Source: SemiAnalysisFull video: SemiAnalysis@SemiAnalysis_ALERT 🚨: Trainium3 Neuron profiling & trace stack is so fine-grained and precise that it can generate pixel art of entire videos!
The video below is an actual profile running on Trainium3 DMA engines.
We will open-source the entire SKILLS.md later this month. 9:21 PM · Nov 16, 2026 · 52.3K Views19 Replies · 14 Reposts · 279 LikesTrainium3 consists of 8 NeuronCore-v4s, and every 2 NeuronCores share an HBM stack. By default, 2 NeuronCores that share an HBM stack form a Logical NeuronCore (LNC). Users write kernels that map to LNCs, and in LNC=2, it follows the Single-Program Multiple-Data (SPMD) paradigm: NeuronCores in an LNC execute the same kernel program with separate hardware resources except the HBM. In a Neuron Kernel Interface (NKI) kernel, programmers can assign work to NeuronCores in an LNC with the API nl.program_id and synchronize NeuronCores with the barrier mechanism nisa.core_barrier. One of the most important concepts in data movement is the partition dimension (pdim) and the free dimension (fdim). Every tensor has a designated partition dimension, and other dimensions are called free dimensions. In principle, the partition dimension aligns with the dimensions of hardware components, and data can be processed in parallel. We explain the dimensions of each component throughout the article. Here we investigate the achievable HBM bandwidth of Trainium3. In Trainium3’s memory hierarchy, we move data from HBM to SBUF using the API nki.isa.dma_copy. Each NeuronCore comes with 16 main Direct Memory Access (DMA) engines, in charge of moving data between HBM and SBUF. For every data transfer, a main DMA engine ingests a DMA descriptor, which contains the source and destination address information. In Trainium3, there are three modes of generating DMA descriptors: static (None), software-based DGE (swdge), and hardware-based DGE (hwdge). Each mode generates and stores descriptors differently. Source: SemiAnalysisStarting from NeuronCore-v3 (Trainium2), GpsimdE comes with one integrated DMA engine per processor, totaling eight integrated DMA engines. With these integrated DMA engines, programmers can perform data movements in parallel with the main DMA engines, while also enabling indirect access patterns, such as gather and scatter operations. NeuronCore-v3 also comes with two Descriptor Generation Engines (DGE). DGE accelerates descriptor generation with hardware: it frees up GpsimdE to perform other computation, frees up memory space, and accelerates address generation. DGE resembles Tensor Memory Accelerator (TMA) in Nvidia architecture and Tensor Data Mover (TDM) in AMD architecture. TMA focuses on accelerating large data copies at the cost of higher latency, while hardware-based DGE has no performance trade-offs compared to software DGE. However, while TMA is able to perform gather and scatter operations, not even the latest NeuronCore DGE can do so. As a result, NKI constrains DMA copy mode to swdge when performing indirect memory accesses. Source: SemiAnalysisHere we compare the achieved memory bandwidth of a single Trainium3 NeuronCore for the three descriptor modes. Static mode, since descriptors are compiled ahead of time, has the lowest descriptor generation overhead and achieves the highest memory utilization. At the smallest tested message size 64 KiB, static mode achieves 492 GB/s (80% utilization) for load and 544 GB/s (88.8% utilization) for store. Static mode also achieves near peak memory bandwidth at around 256 KiB. Hardware DGE, the default mode of DMA copy, follows closely behind static mode: it achieves 398 GB/s (65% utilization) for load and 476 GB/s (77.7% utilization) for store at 64 KiB message size, likely due to the address generation overhead. The gap narrows as message size increases, and hardware DGE mode matches static mode after 256 KiB. On the other hand, software DGE performs significantly worse than the other two. This likely indicates indirect memory access patterns may suffer great performance loss, as they are restricted to software DGE mode. Trainium3 consists of 8 physical NeuronCores, and while they have individual DMA engines, each pair of NeuronCores shares one HBM stack. Thus, we measure the memory bandwidth achieved by 8 concurrent NeuronCore programs to understand the utilization under full load. Overall, the HBM is able to sustain the high utilization, dropping by only about 3% for larger message sizes. Source: SemiAnalysisIn Trainium3, PSUM and SBUF are arranged in a 2D grid of 128 lanes of 16 KiB / 256 KiB capacity. The 128-lane setup is the partition dimension, and the data is accessed in parallel along the partition dimension. There are two main types of data movement between PSUM and SBUF:SBUF to PSUM: Upon an nki.isa.nc_matmul call, TensorE moves both input matrices from SBUF to PSUMPSUM to SBUF: Epilogue operations such as data type casting, activation, and quantization. These operations are mostly based on the nki.isa.tensor_copy APIThis section focuses on PSUM to SBUF. Two engines have PSUM read access: ScalarE and VectorE. We measure the achieved memory bandwidth for the two engines across different tile shapes, using the full 128 partitions with varied per-partition sizes. Source: SemiAnalysisOur results show that PSUM read bandwidth starts from 453.9 bytes per cycle for ScalarE and 413.9 bytes per cycle for VectorE at 32 KiB message size, and both reach near the theoretical bandwidth of 512 bytes per cycle (4 bytes per cycle per lane, 128 lanes) at around 256 KiB message size. This translates to a 614.4 GB/s bandwidth for each engine. Starting from NeuronCore-v3 (Trainium2), the two engines can perform PSUM reads in parallel. Our benchmarks show that parallel access causes near-zero bandwidth loss, indicating that the PSUM is well designed to sustain parallel access. When both engines are used in parallel, they reach 1024 bytes per cycle. Source: SemiAnalysisSource: SemiAnalysisThe bandwidth gap between the two engines in the smaller message sizes indicates different instruction issue overhead: ScalarE has about 8 cycles of overhead, whereas VectorE has about 16 cycles. Tensor Engine (TensorE) is the hardware unit that executes matrix multiplications. In terms of architecture, TensorE is a systolic array, which consists of a 128-by-128 processing element (PE) grid. The 128 dimension matches the number of partitions in SBUF and PSUM, and since TensorE reads both matrix inputs from SBUF and writes the results to PSUM, this simplifies programming. TensorE applies near-memory accumulation: the output accumulates in PSUM, avoiding a round trip to HBM, and it is especially useful for epilogue operations and consecutive matrix multiplications. This design is also present in Nvidia Blackwell, where the TensorCore output accumulates in TMEM. We invoke TensorE with the API nisa.nc_matmul. For a matrix multiplication of x @ y = z, the input dimensions are as follows:Stationary x. T: [K, M]. Maximum of M (stationary fdim) is 128; TensorE reaches full performance at K=128Moving y: [K, N]. Maximum of N (moving fdim) is 4096. This is because PSUM has 16 KiB per partition, which can hold a maximum of 16384 B / 4B = 4096 FP32 elementsOutput z: [M, N]Note that TensorE requires the stationary matrix x to be transposed, meaning the hardware takes x. T as input but computes x @ y. This is due to TensorE’s systolic array design: the systolic array computes dot products between rows of x and columns of y. In the systolic array, each y column is staggered by one element. Every TensorE matrix multiplication involves two steps: LoadStationary (LS) loads the stationary matrix into the array, and MovingMultiply (MM) performs the calculation. During each cycle of MM, every PE computes a partial sum, passes the y element to the PE on its right, and passes the partial sum to the PE below. Trainium3 systolic array performance model animation. Source: SemiAnalysisWith the understanding of the systolic array, we can model the instruction latency as N+254 cycles. In a matrix multiplication, the lower-right element is the last to complete computation, and it depends on how many cycles it takes to move the lowerleft element of y into the lower-right PE. Focusing on the dynamics of the lower-left element of y, we see there are three stages: fill, stream, and drain. The fill stage refers to the period when the input edge isn’t full due to staggering, which is R-1 cycles, where R represents the number of rows in the PE grid. The stream stage refers to the last row entering the PE grid, and it takes N cycles for the lower-left element to reach the input edge. Finally, the drain stage is when the PEs consume the moving matrix inputs, and it takes C-1 cycles for the lower-left element of y to get to the lower-right PE, where C represents the number of columns in the PE grid. Overall, the latency is (R-1)+N+(C-1)=127+N+127=N+254 cycles. We can also model the initiation interval as approximately N cycles for sufficiently large N. Initiation interval is the time gap between instruction launches when we consecutively launch many of the same instructions. In this case, we model the number of cycles between a series of MM instruction launches. From the perspective of the systolic array, we can continuously stream multiple input matrices y1, y2, … in the same staggered fashion, and the computation of the next MM instruction starts as soon as the next input matrix’s element streams into a PE. In a steady state where we ignore the fill and drain stages, each PE streams through one row of input matrix y for every MM instruction, meaning the initiation interval is N cycles. However, this only holds for large N due to our steady-state assumption. We collect experimental results to verify our modeling. We are able to map the latency results to the formula N+393 with little error, indicating that there’s a roughly 140-cycle overhead for MM instructions, which may include things like writing results to PSUM. Source: SemiAnalysisAs for the initiation interval, experiments show that by adding a constant 6-cycle overhead, we are able to reliably predict the initiation interval for matrix multiplication shapes N >= 64 and M=128. As we suspected, the model breaks down for small N, and we observe the initiation interval to be 30 cycles at N=8, likely dominated by other overheads. Source: SemiAnalysisOur model also predicts that M is irrelevant to both performance metrics, and our experiments corroborate this. At N=512, both latency and initiation interval stay constant across all M sizes. This has great implications for performance. LLM inference decode workloads tend to have small M for matrix multiplications, and M not being the main factor in performance alleviates many difficulties when optimizing decode workloads. Source: SemiAnalysisWe also measure a more realistic scenario, where we change both stationary and moving matrices, so the kernel alternates between executing LS and MM instructions, and the two instructions of different matrix multiplications can overlap. Results show that we reach more than 90% utilization at N=64, and we reach near theoretical throughput for shapes larger than N=128. Source: SemiAnalysisStarting from NeuronCore-v3 (Trainium2), TensorE supports FP8 matrix multiplication. In terms of programming, users set the argument perf_mode to nisa.matmul_perf_mode.double_row, and double row mode supports contraction dimension K=256, 2x the standard K=128. However, the systolic array is still a 128-by-128 PE grid, so under the hood, double row mode shards the input into two tiles along the K dimension and computes them in parallel. During computation, each PE takes in two FP8 elements from the moving matrix and computes two multiply and accumulation operations every cycle. Source: SemiAnalysisAs a result, the latency of FP8 double row mode is near-identical to its BF16 counterpart, and we show this in the experiments below. TensorE can theoretically double the throughput of FP8 matrix multiplication, since the latency is still bounded by the same systolic array grid. In reality, we see FP8 demonstrating near-identical instruction latency and initiation interval as its BF16 counterpart. Source: SemiAnalysisSource: SemiAnalysisHowever, for realistic scenarios of alternating LS and MM instructions, double_row mode FP8 performance is mixed. When comparing the same shapes, FP8 underperforms BF16 until around N=96 and only reaches 2x the compute throughput after around N=256, which makes sense as FP8 is executing at half the N size. If we consider the effective N size, double row mode FP8 only starts showing throughput benefits at N=64. FP8 power throttles more frequently than its BF16 counterpart, indicating that typical performance may be less ideal than our full-rate measurements. Source: SemiAnalysisNeuronCore-v4 (Trainium3) introduces microscaling format (MXFP4, MXFP8) matrix multiplication support with the new API nisa.nc_matmul_mx. Further scaling the FP8 matrix shape, nc_matmul_mx supports the K dimension of 512 (4x the standard) through the quad-MXFP8 data type. Users pass the matrices into the API nisa.quantize_mx to compact the matrices along the K dimension, packing every 4 MXFP8 elements into one quad-MXFP8 element, resulting in the K to be 128. Trainium3 offloads the quantization step to the user, instead of TensorE doing it, and this is different from major MX-supporting hardware such as Nvidia and AMD GPUs. This reduces the quantization overhead during the matrix multiplication instruction but exposes the quantization step to users to optimize. With the quad-MXFP8 data type, how LS loads the stationary matrix and how MM streams the moving matrix behave closer to the standard nc_matmul, except each element is 4-bytes wide. nc_matmul_mx accepts quad-MXFP8 inputs and theoretically has the same performance characteristics as the BF16 nc_matmul, hence 4x the throughput. Realistically, quad-MXFP8 does have similar latency and initiation interval as BF16 nc_matmul, but still suffers from minor overhead, which is understandable given the dequantization step. As for computation throughput, quad-MXFP8 outperforms its BF16 counterpart for most shapes, but it only reaches 4x throughput for N greater than 128. Source: SemiAnalysisSource: SemiAnalysisSource: SemiAnalysisRow tiling mode is another new feature in NeuronCore-v4 (Trainium3) unique to nc_matmul_mx. Row tiling mode allows users to concurrently execute multiple matrix multiplications with smaller K dimensions, improving the utilization of TensorE. TensorE achieves this by splitting up the systolic array along the rows and outputting the results without passing down the partial sums through the whole array. Row tiling mode offers multiple configurations, including tile sizes (32, 128) and (64, 128). A tile represents the cut-up systolic array, so tile size refers to the number of quad elements, and the packed K dimension is essentially the partition size, which we denote as Kp. Theoretically, row tiling mode should offer T times throughput, where T represents the number of tiles. Here we compare the un-tiled, the tiled, and the standard full array configurations. Source: SemiAnalysisOur results show that row tiling mode does improve utilization and achieve higher throughput, and it reaches near the theoretical 2x / 4x boost for N >= 128. Compared to the standard full array configuration, row tiling mode retains about 90% of the full array throughput and closes the gap at N=512. A caveat of row tiling mode is that it might not support certain shapes due to PSUM capacity limits, since the number of output matrix elements doubles / quadruples. We further investigate the power throttling effects on TensorE performance by benchmarking with full chip activated, specifically, 8 matrix multiplication kernels on 8 NeuronCores in a chip. We compare all data types, including BF16, double row FP8, MXFP8, and MXFP4, and we run at the (M, N) = (128, 512) for a typical shape with max K size for each data type. Overall, we see BF16 executing at near max compute throughput, double row FP8 and MXFP4 running at around 90% MFU, and MXFP8 heavily throttled at 68.6% MFU. To set up a non-power throttled comparison, we use AWS power profile tools to apply a clock-limited profile, lowering the max boost clock from 2.4 GHz to 2 GHz. As shown below, all precisions except MXFP8 reach near the max throughput of 2 GHz rate, but are throttled at around 80% of the original MFU. For MXFP8, it reaches 84.5% MFU of 2 GHz rate, boosting the true MFU at 1.9%. This shows power throttling is a critical issue for the MXFP8 matrix multiplication using TensorE. Source: SemiAnalysisTranscendental functions are the math operations used in model activations, and those operations are critical to kernel performance due to their inherent mathematical calculation complexities. By default, ScalarE computes the transcendental functions, and to program ScalarE, we call nisa.activation and pass in the math operation, e.g. nl.gelu, as argument. Starting from NeuronCore-v4 (Trainium3), other engines support small sets of the transcendentals. For example, GpsimdE supports functions like sigmoid, and VectorE supports the exponential function through the new API nisa.exponential. We first benchmark the exponential function, since the exponential function throughput is a great performance bottleneck to FlashAttention operation. Here we compare VectorE and ScalarE to find out how much VectorE boosts the performance. The benchmark setup follows the most common softmax precisions, FP32 input / BF16 output and BF16 input / BF16 output. According to documentation (here and here), both engines have 128 compute lanes, matching the partition dimensions of PSUM and SBUF. For each cycle, ScalarE executes at 1 element per cycle, while VectorE at 2 FP32 elements / 4 BF16 elements per cycle. We sweep through different free dimension sizes while keeping partition dimension to 128, and the element process throughput is as below. Benchmarks show that ScalarE and FP32-input of VectorE quickly nears the theoretical throughput at around fdim=256, while it takes fdim=1024 for BF16-input to get to near 512 elements per cycle. As for instruction latency, ScalarE saturates quickly at fdim=16, after which latency scales with fdim, whereas VectorE saturates at fdim=64 for FP32 inputs and fdim=128 for BF16 inputs. Source: SemiAnalysisSource: SemiAnalysisnisa.exponential API offers many features relevant to FlashAttention, including subtract by max value for stable softmax, and input summation for running exponential sum calculations. We are delighted to see such ergonomic improvements. We further benchmarked activation functions commonly used in LLMs. All activation functions surprisingly perform identically, reaching near max 128 elements-per-cycle performance at fdim=256. Source: SemiAnalysisSource: SemiAnalysisTrainium supports grouping 2 physical NeuronCores into one Logical NeuronCore (LNC). Physically, an LNC maps to two NeuronCores that share an HBM stack. Physical NeuronCores within an LNC have two ways of communicating: exchanging data on SBUF through DMA engines and accessing the shared HBM with a semaphore mechanism.nisa.sendrecv implements the bi-directional data exchange, and it’s essentially a two-rank all-gather operation. sendrecv supports utilizing the main DMA engines and the ones in GpsimdE. sendrecv through GpsimdE (GpSIMD DMA) offers lower latency but has message size restrictions. Our benchmark shows GpSIMD DMA achieves up to 2.6x lower latency at a small message size of 512 bytes, but the speedup diminishes as message size increases, and the two transfer methods cross over at 32 KiB. For the main DMA engine, the latency greatly increases after 128 KiB message size, and the bandwidth nears saturation at 14 MiB, reaching 572 GB/s. We couldn’t increase the message size without errors, which is likely due to the SBUF size being 32 MiB. Source: SemiAnalysisNeuron also supports the all-reduce version, nisa.sendrecv_compute, where we pass in an NKI operator, and the NeuronCores perform a fused all-gather and reduce operation. Here we compare a naive sendrecv + tensor_tensor add setup with sendrecv_compute add. We see minor improvements for smaller message sizes but performance loss at large ones. Source: SemiAnalysisThe shared HBM pattern is an all-gather that uses nl.shared_hbm to access the shared HBM and nisa.core_barrier to synchronize the NeuronCores. Both NeuronCores write their tiles from their own SBUF to the shared HBM, wait for the semaphore, and copy each other’s tiles from the shared HBM to their own SBUF. To understand the semaphore mechanism overhead, we also benchmark a local copy for a comparison. Source: SemiAnalysisOverall, the core barrier semaphore introduces 10-20% latency overhead. Compared to shared HBM + semaphore, sendrecv is the more performant option for doing 2-rank all-gather operations, as sendrecv skips HBM and transfers from SBUF to SBUF. The latency curve shows a peculiar dip around 8 KiB, and we investigate the reason. We hypothesize that the dip is due to the partition size matching the HBM burst write size. Smaller sizes trigger frequent read-modify-write operations, which adds to latency. On the other hand, data transfer time dominates latency for larger sizes. Partition size, rather than message size, appears to be the cause. When we hold the message size constant and vary the number of partitions and partition size, the latency drops 2-3x between partition size 16 bytes and 32 bytes. Source: SemiAnalysisSweeping through partition sizes for the 128-partition configuration, we see latency drops for partition sizes that are multiples of 32. This implies the HBM write
[Article truncated]