lds-optimization

Diagnose LDS bank conflicts and lgkmcnt stalls in FlyDSL GPU kernels.

260|104|Updated Nov 23, 2025
One-click install
npx skills add https://github.com/ROCm/FlyDSL --skill lds-optimization-rocm
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: lds-optimization
Source: https://github.com/ROCm/FlyDSL/tree/main/.claude/skills/lds-optimization
Command: npx skills add https://github.com/ROCm/FlyDSL --skill lds-optimization-rocm

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Optimize LDS (Local Data Share / shared memory) usage in FlyDSL GPU kernels by diagnosing bank conflicts and lgkmcnt stalls, then applying swizzle or padding layouts and increasing write-read distances to hide latency. Use when trace data shows ds_read/ds_write/lgkmcnt bottlenecks.

Core Features & Use Cases

  • Diagnose LDS bottlenecks from trace data and identify bank conflicts, write-read latency, and cross-wave barriers.
  • Apply XOR-based swizzle or padding to break bank alignment and improve throughput.
  • Increase write-read distance to hide write latency and improve overlap with independent work.

Quick Start

Run /kernel-trace-analysis to identify LDS bottlenecks, then apply swizzle or padding and re-run analysis to verify improved stalls.

Frequently Asked Questions about lds-optimization

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I reduce bank conflicts in GPU shared memory?

Bank conflicts in GPU shared memory are reduced by applying XOR-based swizzle or padding layouts to break strict bank alignment, improving memory access throughput across wavefronts.

What causes lgkmcnt stalls in GPU kernels?

Lgkmcnt stalls in GPU kernels are caused by data dependencies waiting on ds_read or ds_write instructions to complete, which can be mitigated by increasing write-read distance to hide latency.

How do I hide LDS write latency in GPU kernels?

LDS write latency is hidden by increasing the distance between write and read instructions, allowing the operation to overlap with independent compute work and reduce cross-wave barriers.

When should I apply swizzle vs padding to optimize local data share?

Apply XOR-based swizzle vs padding to local data share based on trace analysis diagnosing specific bank conflict patterns, ensuring changes maintain correctness while achieving measurable performance gains.

How to diagnose LDS bottlenecks from GPU kernel trace data?

Diagnose LDS bottlenecks from GPU kernel trace data by running kernel-trace-analysis to identify ds_read/ds_write latency, bank conflicts, and cross-wave barriers causing lgkmcnt stalls.

Does optimizing LDS usage require re-running trace analysis to verify performance?

Optimizing LDS usage requires re-running trace analysis to verify improved stalls and confirm that swizzle, padding, or write-read distance changes achieve measurable performance gains without breaking correctness.