Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions ci/baselines/perf/dxa.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,17 @@
"configs": "-DVX_CFG_EXT_DXA_ENABLE -DVX_CFG_NUM_THREADS=4",
"driver": "rtlsim"
},
"dxa:perf_gate-wgmma-dxa-lsu2:rtlsim": {
"32": {
"cycles": 39426,
"instrs": 6840
},
"app": "sgemm_tcu_wg_dxa",
"args": "-m 128 -n 128 -k 64",
"config_hash": "f49d8ef4553b4dca",
"configs": "-DVX_CFG_ISSUE_WIDTH=2 -DVX_CFG_EXT_TCU_ENABLE -DVX_CFG_TCU_WGMMA_ENABLE -DVX_CFG_EXT_DXA_ENABLE -DWGMMA_NRC=32 -DVX_CFG_NUM_ALU_BLOCKS=1 -DVX_CFG_NUM_LSU_BLOCKS=2 -DVX_CFG_NUM_FPU_BLOCKS=1 -DVX_CFG_NUM_WARPS=8 -DVX_CFG_NUM_THREADS=32",
"driver": "rtlsim"
},
"dxa:perf_gate-wgmma-dxa-mcast-nt16:rtlsim": {
"32": {
"cycles": 81041,
Expand Down
14 changes: 7 additions & 7 deletions ci/baselines/synthesis/beacon/core.json
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@
"dut": "lmem",
"result": {
"bram": 16.0,
"build_time_s": 15,
"build_time_s": 25,
"deep_endpoints": 0,
"deepest_paths": [
"9 lmem_unit/g_data_store_0.bank/g_amo.amo_old_r[0] -> lmem_unit/g_data_store_0.bank/g_dual_port.lmem_store/g_bram.g_wren.ram.wd[0]",
Expand All @@ -281,27 +281,27 @@
"9 lmem_unit/g_data_store_0.bank/g_amo.amo_old_r[0] -> lmem_unit/g_data_store_0.bank/g_dual_port.lmem_store/g_bram.g_wren.ram.wd[9]"
],
"dsp": 0,
"endpoints": 17366,
"endpoints": 17390,
"env": {
"beacon": "beacon 134d03b9e",
"circt": "CIRCT 90c5fd313",
"device": "xcu55c-fsvh2892-2L-e",
"xlen": 32
},
"ff": 14361,
"ff": 14407,
"fix_levels": 12,
"interfaces": {},
"lut": 18880,
"lut": 18949,
"lutram": 726,
"max_levels": 9,
"pred_fmax_mhz": 324.3,
"pred_fmax_mhz": 326.2,
"risk_endpoints": 0,
"tied_bits": 17,
"tied_ports": [
{
"bits": 17,
"port": "dma_req_buf.data_in",
"width": 607
"port": "dma_rd_buf.data_in",
"width": 31
}
],
"units": {
Expand Down
12 changes: 6 additions & 6 deletions ci/baselines/synthesis/beacon/tensor.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
"dut": "tensor",
"result": {
"bram": 114.5,
"build_time_s": 115,
"build_time_s": 150,
"deep_endpoints": 3267,
"deepest_paths": [
"24 g_cores_0.tcu_unit/g_blocks_0.tcu_block/tcu_core/g_i_0.g_j_0.pe/fedp/pipe_acc/g_pipe.g_no_reset.pipe[39] -> g_cores_0.tcu_unit/g_blocks_0.tcu_block/tcu_core/g_i_0.g_j_0.pe/fedp/pipe_norm_round/g_pipe.g_no_reset.pipe.d[0]",
Expand All @@ -83,21 +83,21 @@
"24 g_cores_0.tcu_unit/g_blocks_0.tcu_block/tcu_core/g_i_0.g_j_0.pe/fedp/pipe_acc/g_pipe.g_no_reset.pipe[39] -> g_cores_0.tcu_unit/g_blocks_0.tcu_block/tcu_core/g_i_0.g_j_0.pe/fedp/pipe_norm_round/g_pipe.g_no_reset.pipe.d[9]"
],
"dsp": 267,
"endpoints": 170268,
"endpoints": 170251,
"env": {
"beacon": "beacon 134d03b9e",
"circt": "CIRCT 90c5fd313",
"device": "xcu55c-fsvh2892-2L-e",
"xlen": 32
},
"ff": 161727,
"ff": 161725,
"fix_levels": 12,
"interfaces": {},
"lut": 260500,
"lut": 260100,
"lutram": 12675,
"max_levels": 24,
"pred_fmax_mhz": 261.3,
"risk_endpoints": 200,
"risk_endpoints": 201,
"tied_bits": 4,
"tied_ports": [
{
Expand Down Expand Up @@ -139,7 +139,7 @@
"g_cores_*_g_lsu_mem_path_*_mem_path/g_coalescing_mem_coalescer/req_ibuf/allocator": 11,
"g_cores_*_g_lsu_mem_path_*_mem_path/lsu_scheduler/mem_scheduler/g_req_queue_rw_req_queue/g_ebN_fifo_queue": 9,
"g_cores_*_g_lsu_mem_path_*_mem_path/lsu_scheduler/mem_scheduler/req_ibuf/allocator": 10,
"g_cores_*_mem_unit/g_lmem_dma_dxa_completion_detect/compl_fifo/pending_size": 8,
"g_cores_*_mem_unit/dxa_completion_detect/compl_fifo/pending_size": 8,
"g_cores_*_mem_unit/lmem_unit/g_data_store_*_bank/g_single_port_lmem_store": 9,
"g_cores_*_tcu_shared/wgmma": 9,
"g_cores_*_tcu_shared/wgmma/tbuf/bbuf": 16,
Expand Down
12 changes: 6 additions & 6 deletions ci/baselines/synthesis/beacon_asic/core.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,16 +68,16 @@
"configs": "-DVX_CFG_NUM_THREADS=16 -DVX_CFG_ISSUE_WIDTH=2 -DVX_CFG_EXT_A_ENABLE",
"dut": "lmem",
"result": {
"build_time_s": 15,
"cells": 120296,
"endpoints": 18134,
"build_time_s": 25,
"cells": 120509,
"endpoints": 18158,
"env": {
"beacon": "beacon 134d03b9e",
"circt": "CIRCT 90c5fd313",
"pdk": "asap7",
"xlen": 32
},
"ff": 23721,
"ff": 23767,
"fmax_mhz": 1692.0,
"macros": 32,
"max_stages": 15,
Expand All @@ -88,8 +88,8 @@
"tied_ports": [
{
"bits": 17,
"port": "dma_req_buf.data_in",
"width": 607
"port": "dma_rd_buf.data_in",
"width": 31
}
]
}
Expand Down
8 changes: 4 additions & 4 deletions ci/baselines/synthesis/beacon_asic/tensor.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,16 @@
"configs": "-DVX_CFG_NUM_THREADS=8 -DVX_CFG_NUM_WARPS=8",
"dut": "tensor",
"result": {
"build_time_s": 85,
"cells": 838075,
"endpoints": 89487,
"build_time_s": 130,
"cells": 837473,
"endpoints": 89470,
"env": {
"beacon": "beacon 134d03b9e",
"circt": "CIRCT 90c5fd313",
"pdk": "asap7",
"xlen": 32
},
"ff": 166953,
"ff": 166951,
"fmax_mhz": 977.5,
"macros": 34,
"max_stages": 33,
Expand Down
23 changes: 23 additions & 0 deletions ci/testcases/dxa.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -662,6 +662,22 @@ tests:
configs: -DVX_CFG_ISSUE_WIDTH=4 -DVX_CFG_EXT_TCU_ENABLE -DVX_CFG_TCU_WGMMA_ENABLE -DVX_CFG_EXT_DXA_ENABLE -DWGMMA_NRC=16 -DVX_CFG_NUM_ALU_BLOCKS=1 -DVX_CFG_NUM_LSU_BLOCKS=1 -DVX_CFG_NUM_FPU_BLOCKS=1
# Not warp-width swept: a warp-group MMA is defined over a 32-lane warp.
shape: {threads: 32, warps: 8}
# Two LSU blocks: the TCU's operand reads use the local memory's second bank
# port and run beside the DXA's writes.
- id: model_parity-wgmma-dxa-lsu2
check: model_parity
via: blackbox
app: sgemm_tcu_wg_dxa
args: -m 128 -n 128 -k 64
configs: -DVX_CFG_ISSUE_WIDTH=2 -DVX_CFG_EXT_TCU_ENABLE -DVX_CFG_TCU_WGMMA_ENABLE -DVX_CFG_EXT_DXA_ENABLE -DWGMMA_NRC=32 -DVX_CFG_NUM_ALU_BLOCKS=1 -DVX_CFG_NUM_LSU_BLOCKS=2 -DVX_CFG_NUM_FPU_BLOCKS=1
shape: {threads: 32, warps: 8}
- id: perf_gate-wgmma-dxa-lsu2
check: perf_gate
via: blackbox
app: sgemm_tcu_wg_dxa
args: -m 128 -n 128 -k 64
configs: -DVX_CFG_ISSUE_WIDTH=2 -DVX_CFG_EXT_TCU_ENABLE -DVX_CFG_TCU_WGMMA_ENABLE -DVX_CFG_EXT_DXA_ENABLE -DWGMMA_NRC=32 -DVX_CFG_NUM_ALU_BLOCKS=1 -DVX_CFG_NUM_LSU_BLOCKS=2 -DVX_CFG_NUM_FPU_BLOCKS=1
shape: {threads: 32, warps: 8}
# Sparse WGMMA consumer fed by a DXA producer pipeline.
- id: model_parity-wgmma-sp-dxa
check: model_parity
Expand All @@ -672,6 +688,13 @@ tests:
# several times the size, and a hosted CI runner cannot build it in a job.
configs: -DVX_CFG_ISSUE_WIDTH=4 -DVX_CFG_EXT_TCU_ENABLE -DVX_CFG_TCU_WGMMA_ENABLE -DVX_CFG_TCU_SPARSE_ENABLE -DVX_CFG_EXT_DXA_ENABLE -DWGMMA_NRC=32 -DVX_CFG_NUM_ALU_BLOCKS=1 -DVX_CFG_NUM_LSU_BLOCKS=1 -DVX_CFG_NUM_FPU_BLOCKS=1
shape: {threads: 32, warps: 8}
- id: model_parity-wgmma-sp-dxa-lsu2
check: model_parity
via: blackbox
app: sgemm_tcu_wg_sp_dxa
args: -m 128 -n 128 -k 128
configs: -DVX_CFG_ISSUE_WIDTH=2 -DVX_CFG_EXT_TCU_ENABLE -DVX_CFG_TCU_WGMMA_ENABLE -DVX_CFG_TCU_SPARSE_ENABLE -DVX_CFG_EXT_DXA_ENABLE -DWGMMA_NRC=32 -DVX_CFG_NUM_ALU_BLOCKS=1 -DVX_CFG_NUM_LSU_BLOCKS=2 -DVX_CFG_NUM_FPU_BLOCKS=1
shape: {threads: 32, warps: 8}
- id: perf_gate-wgmma-sp-dxa
check: perf_gate
via: blackbox
Expand Down
6 changes: 3 additions & 3 deletions docs/designs/dxa_async_copy_multicast.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,14 +135,14 @@ queue out to `NUM_DXA_UNITS` workers.
walk replays each receiver's writes at `+r·smem_stride` — **serial**,
`popcount(mask)` beats/word — and the last write per receiver sets
`attr = {notify, bar_addr + (idx<<NB_BITS)}`.
9. **LMEM + completion.** Writes go through the `VX_mem_unit` LMEM-DMA
priority arbiter (DXA = idx 0, TCU = idx 1). `VX_dxa_completion` snoops
9. **LMEM + completion.** Writes go to the LMEM's DMA row-write port; the
TCU reads on the row-read port. `VX_dxa_completion` snoops
the bank fire, reads the attr, and releases barriers via `txbar_bus_if`;
software `arrive_and_wait` unblocks the consumer.

**K-major / TCU tie-in.** `dest_kmajor` produces the transposed SMEM
layout `smem[i0·tile1 + i1]` that the WGMMA B-tile path consumes directly
from LMEM (the DXA and TCU share the LMEM-DMA port). K-major drains ~8×
from LMEM (on the LMEM's DMA row-read port). K-major drains ~8×
slower (1 element/beat) but is amortized over many WGMMA micro-ops.

---
Expand Down
8 changes: 4 additions & 4 deletions docs/designs/mlp_optimizations.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Every MLP feature of Phase 1 and Phase 2, plus the earlier features this design
| P1 | [Targeted fences](#targeted-fences) | Device-scope token for memory fences; I/O fences drain without a walk | `3f27ba402`, `18b6fe521` | none | on | N | printf 13.6×, fence −55% | n/m |
| P1 | [CP DMA through the LLC](#command-processor-dma-through-the-llc) | The command processor's DMA is a client of the shared LLC | `1d3db49b6`, `cc7bb17cc`, `bbad636e3`, `f93df327f`, default `60d79470a` | `VX_CFG_CP_LLC_CLIENT` | on (acts only with one shared LLC) | N | multikernel −42.7%, dogfood −30% | est. +2–3k LUT (not synthesized) |
| P1 | [Dcache read merge](#dcache-read-merge) | Same-word reads of one LSU block share one bank access | `4e1d2a7ec`, `2342ffdcd`, port 0 `d6be497d7` | `VX_CFG_DCACHE_READ_MERGE` | on | N | sgemm −6.5% to −17.2% | n/m |
| P1 | [LMEM DMA round-robin](#local-memory-dma-round-robin) | DXA writes and TCU reads share the LMEM DMA port round-robin | `c96140253` | none | on | N | WGMMA+DXA −10.2%, sparse −11.6% | 1 bit |
| P1 | [LMEM DMA round-robin](#local-memory-dma-round-robin) | DXA writes and TCU reads alternate round-robin where they share a bank port (one LSU block) | `c96140253` | none | on | N | WGMMA+DXA −10.2%, sparse −11.6% | 1 bit |
| P1 | [Per-block LSU memory paths](#per-block-lsu-memory-paths) | Each LSU block owns its memory path; TCU blocks their metadata ports | `8e2aa619c`, `304e0db17`, `8410590f4`, `47844854f`, `fc0a35bb4`, `0c603f49b` | none | on | N | cycle-identical; bandwidth scales with blocks | n/m |
| P1 | [Non-power-of-two warps per slice](#non-power-of-two-gpu-shapes) | %, / and * instead of bit slices in OPC, IPDOM, mhartid | `e311957d9`, `365895a61` | none | on | N | enables 48-warp rtx5080 | pow2 netlists unchanged |
| P1 | [Many AXI transactions in flight](#many-axi-transactions-in-flight) | AXI limit removed, responses routed by ID | `45e6a2356` | none | on | N | xrtsim 4-core sgemv 1.30× | n/m |
Expand Down Expand Up @@ -449,7 +449,7 @@ Atomics with `.aq`/`.rl` get these steps around them. All of it is skipped when
- A request retires before the next one starts, so the banks see every lane in program order.
- With several LSU blocks, a second, read-only engine uses the banks' second port (`VX_1rw1r_ram`), so two warps' reads go through each cycle. Stores and atomics use the first engine alone and are ordered against every read.
- Each block's response leaves from its own register; the response queue is bypassed when it is empty, so no latency is added.
- The DMA port (DXA writes, TCU reads) takes whole bank rows, in the cycle after its request is seen.
- Two DMA ports, one for row writes (DXA) and one for row reads (TCU), take whole bank rows, in the cycle after the request is seen. With several LSU blocks a row read uses the banks' second port, so a DXA write and a TCU read go through in the same cycle; with one LSU block the banks are single-ported and the two alternate. A read of the row written in the same cycle returns undefined data: the kernel's barrier keeps a stage from being read while the DXA fills it.
- SimX (`LocalMem`) models the same passes, engines and response registers.

**Gain:**
Expand Down Expand Up @@ -490,9 +490,9 @@ Atomics with `.aq`/`.rl` get these steps around them. All of it is skipped when

![LMEM DMA round-robin](../assets/img/mlp_lmem_round_robin.svg)

**Problem.** Two clients share the local-memory DMA port: the DXA engine, which writes tiles into shared memory, and the tensor core, which reads WGMMA operands from it. The DXA had fixed priority. One tiled-scatter transfer held the port for about 540 cycles, and a tensor-core batch caught behind it stalled for about 510. That stall delayed the warpgroup barrier, and the barrier delayed the next DXA request.
**Problem.** Two clients share the local-memory banks: the DXA engine, which writes tiles into shared memory, and the tensor core, which reads WGMMA operands from it. The DXA had fixed priority. One tiled-scatter transfer held the port for about 540 cycles, and a tensor-core batch caught behind it stalled for about 510. That stall delayed the warpgroup barrier, and the barrier delayed the next DXA request.

**How it works.** The port grants round-robin, so a tensor-core read waits at most one DXA write. It costs one bit of state, and a single-client configuration is unchanged.
**How it works.** Where the two share a bank port (one LSU block), it grants round-robin, so a tensor-core read waits at most one DXA write. It costs one bit of state, and a single-client configuration is unchanged. With several LSU blocks the TCU reads on the banks' second port and never waits for the DXA.

**Gain (rtlsim):** WGMMA with DXA −10.2%, sparse WGMMA with DXA −11.6%.

Expand Down
11 changes: 4 additions & 7 deletions hw/rtl/VX_gpu_pkg.sv
Original file line number Diff line number Diff line change
Expand Up @@ -2072,13 +2072,13 @@ package VX_gpu_pkg;
logic eop;
} lsu_rsp_data_t;

// DXA lmem tag and attr widths for DMA arb.
// DXA lmem tag and attr widths on the LMEM DMA row-write port.
localparam DXA_LMEM_ATTR_W = (BAR_ADDR_W + 1);
localparam DXA_LMEM_ENGINE_TAG_W = UUID_WIDTH + 1;
localparam DXA_LMEM_TAG_W = DXA_LMEM_ENGINE_TAG_W + NC_BITS;
localparam DXA_LMEM_OUT_TAG_W = DXA_LMEM_TAG_W + arb_sel_bits(`VX_CFG_NUM_DXA_CORES, 1);

// TCU lmem tag and attr widths for DMA arb.
// TCU lmem tag and attr widths on the LMEM DMA row-read port.
// Masters into the TCU LMEM port: BLOCK_SIZE abufs + 1 shared bbuf.
// (Sparse metadata does not fetch from LMEM — it preloads into the
// VX_tcu_sp_meta SRAM via TCU_LD ahead of the MMA dispatch.)
Expand All @@ -2093,11 +2093,8 @@ package VX_gpu_pkg;
localparam LMEM_DMA_DATA_SIZE = `VX_CFG_LMEM_NUM_BANKS * LSU_MEM_WORD_SIZE;
localparam LMEM_DMA_ADDR_WIDTH = `VX_CFG_LMEM_LOG_SIZE - `CLOG2(`VX_CFG_LMEM_NUM_BANKS * LSU_MEM_WORD_SIZE);
localparam LMEM_DMA_ATTR_W = `MAX(DXA_LMEM_ATTR_W, TCU_LMEM_ATTR_W);
localparam LMEM_DMA_DXA_IDX = 0;
localparam LMEM_DMA_TCU_IDX = LMEM_DMA_DXA_IDX + `VX_CFG_EXT_DXA_ENABLED;
localparam LMEM_DMA_INPUTS = `VX_CFG_EXT_DXA_ENABLED + `VX_CFG_TCU_WGMMA_ENABLED;
localparam LMEM_DMA_IN_TAG_MAX = `MAX(DXA_LMEM_OUT_TAG_W, TCU_LMEM_TAG_W);
localparam LMEM_DMA_TAG_WIDTH = LMEM_DMA_IN_TAG_MAX + arb_sel_bits(LMEM_DMA_INPUTS, 1);
localparam LMEM_DMA_WR_TAG_W = DXA_LMEM_OUT_TAG_W; // DXA row writes
localparam LMEM_DMA_RD_TAG_W = TCU_LMEM_TAG_W; // TCU row reads

// Alignment of every CTA's LMEM slot, and so of its LMEM base. A DMA agent
// moves whole bank rows: a block-major WGMMA operand must start one, and
Expand Down
Loading
Loading