tilelang-cuda-synchronization

Enforce safe synchronization in TileLang CUDA kernels using T.sync_threads().

6|1|Updated Apr 19, 2026
One-click install
npx skills add https://github.com/xchang1121/AutoResearch-CC-hook --skill tilelang-cuda-synchronization
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tilelang-cuda-synchronization
Source: https://github.com/xchang1121/AutoResearch-CC-hook/tree/main/skills/tilelang-cuda/guides/tilelang-cuda-synchronization
Command: npx skills add https://github.com/xchang1121/AutoResearch-CC-hook --skill tilelang-cuda-synchronization

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

TileLang CUDA synchronization enforces safe, deadlock-free execution by standardizing how threads coordinate at synchronization points and by avoiding risky patterns that lead to stalls.

Core Features & Use Cases

  • Clear guidelines for using T.sync_threads() to synchronize all threads
  • Prevents common deadlock scenarios in shared-memory kernels
  • Recommendations for using built-in reductions and memory operations to maintain correctness

Quick Start

Apply T.sync_threads() after all threads write to shared data to ensure a safe, deterministic synchronization point.

Frequently Asked Questions about tilelang-cuda-synchronization

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

FAQPage Schema
How do I prevent thread deadlocks in CUDA shared memory kernels?

To prevent thread deadlocks in CUDA shared memory kernels, enforce safe synchronization rules by applying T.sync_threads() after all threads write to shared data, ensuring deterministic progress.

What causes data race conditions in TileLang CUDA kernels?

Data race conditions in TileLang CUDA kernels are caused by risky patterns like conditional synchronization and manual reductions. Using standard built-in synchronization primitives and built-in reductions prevents these data races.

When do I need to use T.sync_threads() in multi-thread collaboration?

You need to use T.sync_threads() in multi-thread collaboration whenever threads write to shared memory that other threads read from, establishing a safe barrier to guarantee deterministic progress and avoid stalls.

Can I use conditional synchronization for manual reductions in TileLang?

Conditional synchronization and manual reductions are not supported for TileLang CUDA kernels. You must use standard built-in reductions and memory operations to maintain correctness and avoid deadlock scenarios.

Why does my TileLang kernel stall at synchronization points?

Your TileLang kernel stalls at synchronization points because conditional synchronization creates deadlock scenarios. Standardizing thread coordination with explicit T.sync_threads() prevents these stalls and guarantees deterministic progress.