Analyzes L3 DDR DMA-channel profiling from VitisAI to determine compute- vs memory-bound execution and recommend tiling/QoS changes, focusing on channels with most backpressure/starvation stall.
Ships in AMD Ross Agentic AI Assistant. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Analyze the L3 DDR DMA-channel profiling that VitisExecutionProvider emits when
ai_analyzer_enhanced_profiling: ["control_instrumentation"] is enabled in runner-options config-file for VART flow. Produce: (1) per-direction
channel throughput and utilization, (2) a compute-bound vs memory-bound verdict per operator,
and (3) prioritized improvement recommendations across five families — cut L3 bytes (tiling /
fusion / precision), hide latency (double-buffering / prefetch), balance channels, relieve L2,
and DDR QoS — always leading with the operators/channels carrying the most backpressure/
starvation stall cycles, because that is where the gain is.
Run it when the user asks about DDR/L3 bandwidth, channel throughput/utilization, stall (backpressure/starvation) analysis, whether layers are compute- or memory-bound, or how to raise channel utilization.
Use ONLY these MCP tools, all of which return computed/summarized results:
get_reports, get_timelines, get_performance_metrics, get_single_timing_dataframe,
get_npu_summary, get_memory_map (for per-buffer ping/pong double-buffer state), and
(optionally, for exact per-channel/per-operator cycle counts) get_summary_data. Do NOT reach
into raw on-disk files — no get_vaiml_artifact, search_mlir, get_make_log, or
get_spilling_reasons. The spill magnitude you need is already in get_npu_summary
(l3_memory_allocation → the Spills entry); you do not need the spilling CSV for this
analysis.
Peak per channel: each running cycle transfers a fixed 64-bit word. On the default
VEK385 embedded platform (1250 MHz) that is 10 GB/s per channel. Other Vitis Versal
embedded platforms run at 1000 MHz → 8 GB/s per channel. Read clock_freq_mhz from the
performance summary and scale peak = 10 GB/s × clock/1250.
Utilization of a channel = running / (running + stall). Achieved BW ≈ peak ×
utilization. Prefer the timeline's own (MB/s) column as the authoritative achieved figure;
use peak only as the ceiling.
Stall splits into two causes, and their meaning DEPENDS ON DIRECTION. The general rule is: backpressure = the channel's destination is busy / cannot accept; starvation = the channel's source cannot supply. A read channel moves L3 DDR → L2 (source = DDR, destination = L2); a write channel moves L2 → L3 DDR (source = L2, destination = DDR). So the two directions flip which side each stall points at:
| Direction | Backpressure stall (destination busy) | Stream starvation stall (source can't supply) |
|---|---|---|
| Read (L3→L2) | L2 busy — L2 memory bank conflicts, or waiting to acquire the write lock on the L2 buffer | L3 DDR memory controller busy and cannot supply data |
| Write (L2→L3) | L3 DDR memory controller busy to accept the data | L2 busy — L2 memory bank conflicts, or waiting to acquire the read lock on the L2 buffer |
The remediation follows the side, not the label. DDR-bound = read starvation or write backpressure → DDR-channel QoS + reduce L3 volume. L2-bound = read backpressure or write starvation → relieve L2 (spill/tiling/L2-chaining, bank-conflict/lock mitigation). Do NOT assume "backpressure = L2" — that only holds for reads; for writes it is the DDR side.
Channels: each NPU column has 2 read + 2 write channels to DDR, each with QoS parameters set through the Vitis embedded platform. QoS is the lever for the DDR-bound case (read starvation / write backpressure).
Platform cap: the DDR controller has a fixed bytes/sec ceiling for the whole platform. QoS only redistributes within that cap — it cannot exceed it. So the primary lever for a bandwidth-bound model is reducing L3 transfers (weights + spill), which is what the tiling section targets.
get_performance_metrics → summary (one row). Aggregate (sum over all channels of a
direction) channel counters: peak_read_total_ch_running_cycles, …_stall_cycles,
…_backpressure_stall_cycles, …_starvation_stall_cycles, and the peak_write_total_ch_*
equivalents; plus clock_freq_mhz, batch_count, total_gmacs, average_npu_time_usec,
average_inference_time_usec. These peak_*_total_ch_* fields are the whole-direction
aggregate, not a single channel.
operators table: per op-type value_usec (execution time), count, percent,
cycles_per_count, category (npu / cpu / host_profiling).get_single_timing_dataframe(folder, timeline=<NPU>, inference=0) — one row per operator
instance. Carries Name, Type, Execution Time.μs / .Cycles, and the per-op
min-throughput channel: L3 Throughput Min Read.(MB/s),
L3 Throughput Min Read.Backpressure Stall (%), L3 Throughput Min Read.Starvation Stall (%),
L3 Throughput Min Read.Column:Channel (and the L3 Throughput Min Write.* set). This ties
each operator to its worst channel with per-op stall % — the core of the compute/memory verdict
and the per-channel attribution, without needing get_summary_data. Large table: dump with
format="parquet"/csv + output_dir and aggregate by Type; report totals and top-N.get_npu_summary — total_l3_allocated, total_l3_transfers, l3_memory_allocation
(per class: Spills, Weights, IFM, OFM with size_in_bytes), gmacs_per_operator
(which op-types carry compute), total_gmacs. Large payload — read only those fields.get_memory_map(folder, level="L2") — one row per buffer. Two uses here:
double_buffer = ping / pong (DMA overlaps compute) vs single
(no overlap → compute waits on the transfer). force_single_buffer true = pinned single,
cannot ping/pong as-is.size per be_layer_name (and by buf_type) to get each
operator's total L2 footprint and its buffer granularity (few coarse buffers vs many
fine ones). This is the MCP-visible proxy for how much L2 / how many stamps an operator got.be_layer_name (join key to the operator/layer), buf_type
(IFM / OFM / WTS / HEAP_STACK), offset, is_l2_no_spill. partition_memory_size is often
0 — the tool does NOT give L2 capacity, so treat capacity as external context (see the stamp
note in family D).level="L2"; L3 rows do not
carry meaningful double-buffer state. Large table — dump with format="parquet"/csv +
output_dir and aggregate/filter to the layers of interest (never dump raw rows).get_summary_data (optional, large) — data[].perModelCharts[].peakReadBwSummary /
peakWriteBwSummary. Exact per-channel and per-operator cycle counts:
chRunningCycles[], chBackpressureStallCycles[], chStreamStarvationStallCycles[] (each a
{name:"Column N Channel M", cycles} list); the totalCh{Running,Stall,Backpressure,Starvation}Cycles
scalars (== the perf-metrics aggregates); and operator{Running,Backpressure,StreamStarvation}StallCycles[]
(per op-type {name, cycles, elements}). Use only when the user wants exact per-channel or
per-operator cycle counts; otherwise the timeline's per-op stall % is enough.An ai_analyzer_enhanced_profiling capture usually instruments one direction. Detect it: if
peak_write_total_ch_backpressure_stall_cycles == -1 (or the running/stall totals are 0), the
write channels were not captured in this folder — and vice versa for reads. Say so plainly and,
if the user wants both directions, ask for the sibling capture (e.g. a read_* folder alongside
a write_* folder). Never present the empty direction as "no stalls".
get_reports → get_timelines(folder, report_id) on the
HARDWARE/SIMULATED timing report; the NPU timeline is the non-CPU one (e.g. vaiml_par_0/0).get_performance_metrics.summary). For each captured
direction compute utilization = running/(running+stall) and achieved BW = peak × utilization. Report which cause dominates the stall: compare …_backpressure_stall_cycles
vs …_starvation_stall_cycles, then translate to a side using the direction table above:
read starvation → DDR, read backpressure → L2; write backpressure → DDR, write starvation →
L2. State the dominant side (DDR-bound vs L2-bound), not just the raw label.get_single_timing_dataframe). Aggregate by
Type: sum Execution Time.μs, and take the mean read/write Backpressure % and
Starvation % and (MB/s). Join gmacs_per_operator from get_npu_summary to know which
types carry MACs. Classify each op-type:
get_npu_summary). Report the re-fetch ratio
total_l3_transfers / total_l3_allocated (>1 means bytes cross DDR repeatedly — tiling can
reclaim it) and the l3_memory_allocation split (Spills / Weights / IFM / OFM). This tells
you which read category dominates and therefore which tiling lever matters most.get_memory_map(folder, level="L2"), then for each high-stall operator match its layer via
be_layer_name and inspect the buffers on the stalling direction: the IFM/WTS buffers
for any read-side stall (read starvation or read backpressure), the OFM buffer for any
write-side stall (write backpressure or write starvation). A buffer with
double_buffer == "single" on the stalling side is a prime cause of that stall — the
compute cannot overlap with its transfer. Converting it to ping/pong hides the transfer behind
compute and removes stall cycles without reducing bytes. Flag each such buffer with its op,
buf_type, and size. If force_single_buffer == true, note it is pinned single (something —
often an L2-capacity or spill constraint — is preventing double-buffering, so freeing L2 is a
prerequisite). Rank these by the stalling op's absolute stall cycles.size per be_layer_name from the same get_memory_map(level="L2") call
to get each operator's total L2 footprint and buffer granularity (count × size). Compare
the high-stall op against a low-stall neighbor: a markedly smaller total L2 / coarser (fewer,
larger) buffers signals it is under-stamped (too few L2 write ports to absorb the stream)
— the family-D "more stamps / finer buffers" lever. Do NOT read stamp count from the
mapped-graph Tiling entry count; it is unreliable (see family D).Give concrete, prioritized suggestions, each tied to a number from the tools above. First pick the right family from the stall signal, then the specific lever:
First translate each stall to a side with the direction table (read starvation / write backpressure = DDR; read backpressure / write starvation = L2), then:
| Signal (from the tools) | Side | Lever family |
|---|---|---|
| Read starvation or write backpressure high, and MB/s near peak | DDR, volume-saturated | A cut L3 bytes + E QoS |
| Read starvation or write backpressure high, but MB/s low | DDR, latency-limited | B hide latency + C balance + E QoS |
| Read backpressure or write starvation high | L2 (bank conflict / lock) | A cut spill/L2-chaining + D relieve L2 (+ B) |
| Some channels idle while others saturate | channel imbalance | C spread load |
| Low total stall + carries GMACs | genuinely compute-bound | none — leave it |
When near the platform bytes/sec cap (re-fetch ratio ≫ 1, MB/s near peak). Map the
l3_memory_allocation split to the lever, and always state the tradeoff:
vai-custom-op-candidates
skill finds these fusion chains.When starvation is high but MB/s is well under peak (latency-limited, not saturated).
single-buffered buffers on
the stalling side to ping/pong so the DMA overlaps compute. Often the fastest win for a
latency-limited op (low MB/s), where cutting bytes would not help. List each candidate:
operator, buf_type (IFM/WTS for a read-side stall, OFM for a write-side stall), size,
current double_buffer state. Tradeoff: ping/pong doubles that buffer's L2 footprint, so it
competes with spill — when L2 is saturated, pair it with L2-chaining/tiling that frees L2, or
apply it on the read side. If force_single_buffer == true, the buffer is pinned single and
the underlying L2/spill constraint must be lifted first.When the per-channel arrays (get_summary_data) or per-op Column:Channel show some channels
saturated while others sit idle.
When the L2 side is the limiter — read backpressure (L2 can't accept, write-lock wait) or write starvation (L2 can't supply, bank conflict / read-lock wait).
Tiling entry count (that is per-tile shapes, not
stamps, and misreads badly). Instead use get_memory_map(level="L2"): aggregate size per
be_layer_name for the high-stall operator and compare its total L2 footprint and buffer
granularity against a well-behaved (low-stall) neighbor. An L2-bound op with markedly
smaller total L2 / coarser (fewer, larger) buffers than its peers is under-stamped.partition_memory_size = 0, so capacity is not measured.For the DDR-bound case only — read starvation or write backpressure (both = the L3 DDR controller is the limiter).
Column:Channel per op, or
get_summary_data per-channel arrays): read channels high in starvation, write channels high in
backpressure.Lead with a one-line verdict (compute- vs memory-bound overall, and the dominant stall cause per direction). Then: a channel utilization/stall table per captured direction; a per-op-type table (exec µs, GMACs?, read starv %, write bp %, MB/s, verdict) sorted by execution time; for the top-stall operators, a ping/pong column or note (single vs ping/pong on the stalling-side buffer); then a prioritized recommendation list drawn from families A–E (pick each via the signal→lever table) led by the highest absolute-stall operators/channels. Quote concrete numbers from the tools; use tables for per-op and per-channel rows.
peak_*_total_ch_* are aggregates over all channels of a direction, not one peak channel.(MB/s) column and flag any large disagreement.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
vitisai, dma-analysis, bandwidth-profiling, memory-bound, compute-bound, tiling
50 skills in this plugin
/hls-architectConvert input code to a multi-stage HLS dataflow, validate with the other hls skills, then hand off to optimize./hls-array-to-streamAnalyze whether a given C/C++ code snippet follows the recommended coding style for array-to-stream conversion in Vitis HLS. Keywords: array, stream, HLS, pragma, ap_fifo, axis, interface/hls-burst-inferenceAnalyze whether burst inference optimization can be applied to a given C/C++ code snippet in Vitis HLS. Keywords: burst, HLS, pragma, m_axi, AXI, memory, optimization/hls-component-basic-infoGet Vitis HLS component basic informations for a given HLS component. The basic informations includes component name, source files, testbench files, include paths and top function/hls-cosim-reportGet Vitis HLS cosimulation report information for a given HLS component./hls-dataflowAnalyze whether a given C/C++ code snippet contains a canonical dataflow region for Vitis HLS. Keywords: dataflow, HLS, pragma, canonical, stream, PIPO, hls::task/amd-ross-agentic-ai-assistant:vai-peak-bandwidth-analysisfrom AMD Ross Agentic AI Assistant
npx claudepluginhub xilinx/ross-ai-assistant --plugin amd-ross-agentic-ai-assistantOther plugins' skills for the same job