Skip to main content

Plan: measuring the local memory bandwidths on GB10 (registration)

Plan, not a result. Registered before any code or capture, for the ROADMAP.md item "Measure non_mma_issue_rate_per_sm_gips and the local memory rates that are still estimated, on every profile", local memory part, GB10 first. It produces measurements only: no core, profile or rule changes here. The RTX 4070 follows by the same text under the quiet desktop gate.

Why​

The core charges every spill byte (L1, L2 and DRAM tiers alike) to one local pipe at spill.local_mem_l1_hit_bw_per_sm_gbps (sim.rs, Machine::local_bw: the throughput term local_bytes x local_users / local_bw and the chain term chain_local_bytes / local_bw). In profiles/gb10-0.23.0.json that field is still an estimate (150 GB/s per SM, m2_estimated), and so is local_mem_l1_miss_bw_per_sm_gbps (40), which the core does not read. They are the local memory rates the roadmap item names.

What is known about their effect, so that this plan is not read as fixing more than it can:

  • Not the spill boundary residual. The re-check's spill_l1_boundary residual (+67.6% on GB10, +38.0% on the RTX 4070 at f34727f) does not come from this field: multiplying both local bandwidths by 2, 3, 4 or 6 left all four predictions unchanged (4 checked all four factors; 7 repeated the factor 4). It comes from which carveout curve the core reads for that kernel.
  • A bounded effect elsewhere. On the archived v0.2 holdout IRs (17 cases and 552 configurations per architecture, bundled gb10.json and rtx4070.json), scaling both bandwidths by 0.5 and 2 changed the nominal prediction of 12 to 20 configurations per group, all spilling large tiles, by up to +9.9% and -4.9%, and changed no case's fastest configuration (CPU only, opened data, reported to the lead and not committed).

So a measured value can move the absolute time of spilling configurations by up to about 10% and is not expected to change rankings on the v0.2 set.

What is measured​

A new mode, local-bw: one CTA per SM on every SM, each thread reading (or writing) its own local frame, a runtime-indexed local array, so the compiler emits real LDL/STL. As in spill-latency, all lanes of a warp use the same frame offset, which is how ptxas spill reloads (LDL [R1 + imm]) address the frame, so one warp instruction moves 32 consecutive words. Each step issues 8 independent accesses at offsets base + k x stride (k = 0 to 7) and then advances base by a constant, so no access waits for another; the values are folded into 8 accumulators written once at the end.

The rate of a point is the bytes moved by all SMs (warps x 32 x 8 x width per step per SM) over the launch time, per SM, in GB/s.

QuantityOp and widthFootprint per SMCompared with
L1 load bandwidthLDL 4 Bat most 32 KiBlocal_mem_l1_hit_bw_per_sm_gbps
L1 store bandwidthSTL 4 Bsamereported
L1 load, wideLDL.128 16 Bsamereported
L2 load bandwidthLDL 4 Bat least 512 KiBlocal_mem_l1_miss_bw_per_sm_gbps

Points (warps_per_sm, frame_bytes_per_thread):

  • L1 curve, for 4 B loads and stores: (1, 128), (2, 128), (4, 128), (8, 128), (16, 64), (32, 32): 4 to 32 KiB per SM, so the tier stays the same as warps grow. For 16 B loads: (1, 128), (2, 128), (4, 128), (8, 128), 4 to 32 KiB per SM (amended, see below).
  • Frame check in L1: 8 warps at frames 32 and 64 B (8 and 16 KiB per SM), next to the curve's (8, 128) point, 4 B loads.
  • L2 tier, 4 B loads: (16, 1024), (8, 2048) and (4, 4096), 512 KiB per SM. The last is the spill-latency 4 KiB frame at 128 threads, whose reload points behave as L2 spills.

The tiers are set by footprint, not by l1_to_l2_spill_threshold_by_carveout. The GB10 carveout probe found that the spill-latency kernel's frames stay near their L1 level at 96 to 160 KiB per SM, past the pointer chase's cliff at about 102 KiB (design.md 9.2). Nothing between 32 KiB and 512 KiB per SM is measured, and the L2 tier sits more than three times above that range.

The shared memory carveout is set to the maximum L1 on every local-bw kernel. Before any capture, the assembler output of every kernel instance is checked: 8 LDL (or STL) of the stated width per step, no other local access in the loop, and the frame not promoted to registers. A kernel that fails is fixed before the capture; the check is reported with the result.

Amendment (before any capture)​

The registration as first merged (5b11539) gave the 16 B load curve the same points as the 4 B curves, including (16, 64) and (32, 32). The assembler check required before any capture showed that these two cannot be built as registered: a 64 B or 32 B frame holds only 4 or 2 16-byte elements, so the 8 accesses of a step repeat addresses, and ptxas merges the repeated local loads; the loop has 4 and 2 LDL.128 instead of 8. Eight distinct 16-byte addresses need a frame of at least 128 B, which at 16 and 32 warps would put the footprint at 64 and 128 KiB per SM, above the L1 tier's 32 KiB.

So the 16 B load curve keeps 1, 2, 4 and 8 warps, all with 128 B frames (4 to 32 KiB per SM), and reading 2 judges its saturation on its two largest warp counts, 4 and 8. A volatile local load could force the repeated loads but may change how they are cached, so it is not used. This curve is reported only and backs no profile field; nothing else changes. This was found by the assembler check, with no capture taken and no data seen.

The local memory allocation​

On GB10 the level of the spill-latency reload points at 2 and 4 KiB frames moves with the local memory allocation: an allocation keeps its level and a new one draws a new level (the allocation diagnostic; design.md 9.2). The adopted spill-latency design reads such points across allocations (registration), and this plan reads every point the same way:

  • N = 15 allocations per process, each in a new context (cudaDeviceReset) at the default stack limit; 15 samples and 3 warm-ups per allocation; the first allocation is the process's first context.
  • A point's estimate in a process is the mean of its 15 per-allocation medians. allocation_span, the range of the per-allocation medians over their median, is kept per point, with every allocation's launches in launch order.
  • Every point is read in every allocation, the L1 tier included, so the allocation effect is measured for both tiers rather than assumed.

Launch protocol​

As every scheduled mode (long-launch-capture.md): a pilot sizes each point's steps in the first allocation, the schedule is frozen, every real launch (225 per point and process) is at least 1.0 ms, and --clock-probe records the SM clock around every point. The L1 points are sized until their fastest launch reaches 1.25 ms. The L2 points are sized to 2.0 ms, as the adopted spill-latency design sizes its reload points, because their level is expected to move between allocations and a length sized in a slow allocation can fall under the floor in a fast one. Spark 1 under the GPU lock after the quiet-host gate, three processes in one session, each host-checked; a failed host check voids that process, replaced once.

Frozen reading​

Per point, the value is the median over the three processes of their estimates. In this order:

  1. Capture rules. Rules 1 and 2 per process and allocation on launch_ns_samples, and rule 3 over the three processes, with the usual tolerances. A point that fails a rule is reported and gets no reading below that uses it.
  2. Saturation (each L1 curve). The curve's value is the largest value over its warp counts. It is saturated when the two largest warp counts are within 3% of each other; otherwise the value is a lower bound and is reported as one.
  3. Frame independence in L1. The three 8-warp 4 B load points (frames 32, 64 and 128 B) are within 5% of their median. Otherwise the L1 values are reported as not attributable to L1 alone.
  4. Tiers. The L2 value (the largest of its three points) at most 0.8 times the L1 4 B load value: the tiers are separate. Otherwise they are reported as not separated at these footprints.
  5. Allocation. A point is allocation-independent when its allocation_span is at most 5% in at least 2 of the 3 processes; otherwise allocation-dependent, flagged, and its uncertainty covers half its pooled span, as in the adopted spill-latency design.
  6. One rate for loads and stores. The L1 store value within 10% of the L1 4 B load value. Otherwise one local rate for both is reported as not supported; that is a question for the core (issue #21), not for this plan.

The measured values are reported against the two estimated fields; whether and how they enter a profile is a separate change.

Reported without a verdict​

  • The values against the estimates (150 and 40 GB/s per SM) and against smem_bw_per_sm_gbps of the same profile (321 GB/s per SM).
  • Per-cycle values and the SM clock.
  • The prediction change on the archived v0.2 holdout IRs with the measured values in place of the estimates, as above (post-hoc, opened data).

Not covered​

  • The local memory latencies (local_mem_l1_hit_latency_ns, local_mem_l1_miss_latency_ns); reload latency on the chain is measured by spill-latency.
  • More than one CTA per SM, and footprints between 32 and 512 KiB per SM.
  • How the core should use two tiers or separate load and store rates.

Owners: measurement 7; review 6; spill evidence 4 and 8.