prefetch-data-load

Introduce loop-carried prefetch to overlap data loads with compute in FlyDSL GPU kernel loops.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Overlaps data load latency with compute in FlyDSL kernel loops by introducing loop-carried prefetch patterns.

Core Features & Use Cases

  • Prefetch first iteration data and issue async loads for the next iteration
  • Use scf.for with init= to carry prefetched data across iterations
  • Overlap data loads with MFMA/compute to hide memory latency

Quick Start

Apply the prefetch optimization to a FlyDSL kernel loop by preloading the first iteration, issuing async loads for the next iteration inside the loop, and swapping buffers with loop-carried values.

Frequently Asked Questions about prefetch-data-load

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

FAQPage Schema
How do I overlap GPU memory latency with compute in FlyDSL kernel loops?

You can overlap GPU memory latency with compute in FlyDSL by introducing loop-carried prefetch patterns using scf.for with init values to issue async buffer_load operations for the next iteration while processing MFMA compute on current data.

How does loop-carried prefetch work with scf.for in FlyDSL?

Loop-carried prefetch with scf.for works by preloading first iteration data, issuing async next-iteration loads inside the loop, and swapping raw MLIR ir.Value buffers at the loop tail to hide memory latency behind compute.

Can I use prefetch data load patterns for kernels where buffer_load feeds into MFMA operations?

Yes, prefetch data load patterns apply specifically to FlyDSL kernels where buffer_load results feed into MFMA or compute operations, allowing next-iteration loads to be issued asynchronously and swapped into current data.

What is the best way to manage VGPR budget when implementing data prefetch in GPU kernels?

Managing VGPR budget when implementing data prefetch requires mindful planning of loop-carried init values in scf.for to avoid register spills, as carrying prefetched buffer_load data across iterations increases register pressure.

Why does my FlyDSL kernel loop need to unwrap values to raw MLIR ir.Value for prefetching?

Unwrapping values to raw MLIR ir.Value is required for prefetching in FlyDSL because the loop-carried scf.for init values must be swapped at the loop tail to properly exchange current and next-iteration async load buffers.