What it does
CUDA Agent: Large-Scale Agentic RL for High-Performance CUDA Kernel Generation
- Connects Instruction files the AI reads
- Account or key No key found in README or SKILL.md
- Category Automatización y agentes
Para autores: añade una insignia a tu README
Si lo creaste tú, pega este código en tu README. La insignia enlaza a esta página.
[](https://mcp.popnx.com/en/skills/bytedtsinghua-sia-cuda-agent)Skills parecidas
Mismo tipo de trabajo, ordenadas como la lista de Skills
1 skills (conjuntos de instrucciones) de BytedTsinghua-SIA que la IA lee y sigue · no es un MCP server
En qué se diferencia un Skill de MCP
MCP = las manos
Conecta la IA a un servicio o dato externo, como leer Notion o crear una factura. Necesita un programa o servidor en marcha.
Skill = el manual
Un archivo de texto que enseña a la IA cómo hacer una tarea. No se conecta a nada.
A veces se parecen: algunas Skills ejecutan scripts que llaman herramientas y algunos MCP solo envían conocimiento. Empieza por la tarea que quieres hacer.
Funciona con
El autor no lo indica · los skills con SKILL.md funcionan en apps compatibles con Agent Skills, como Claude Code, Codex y Cursor
Instalar
Is it safe?
- Who made it
GitHub account BytedTsinghua-SIA (organization), 1 years old
- Use and upkeep
★ 1358 stars · code last changed 8 jul 2026
- Any scripts?
7 scripts that can run on a computer: model.py, model_new.py, utils/__init__.py, utils/compile.py and 3 more
- Uses the internet?
No internet calls found in the scripts
- Changes machine-wide settings?
No hooks or writes to machine settings found
Checked automatically from the repo files at commit 473025c (read only, nothing was run). Not a safety guarantee: read it and decide for yourself
Primero: ¿qué IA usas?
Elige tu app y esta página mostrará solo cómo instalarlo en ella
Option 1Upload to claude.ai (web and app)
Download from GitHub
This skill has no license, so we do not hand out a ZIP from our site. Download it from GitHub and arrange the folder yourself, or use "Let the AI install it" above, which is easier
Download from GitHub (whole repo) ↗
Unzip it, then zip only the agent_workdir folder again. The ZIP must have a agent_workdir folder with SKILL.md at the top level, no loose files
Open Skills on claude.ai and upload
+Create skillUpload a skillpick agent_workdir.zip
No Upload button? Turn on file creation first
SettingsCapabilitiesCode execution and file creation
Turn on Code execution and file creation first (newer menus: Create and edit files) · personal plans: Settings → Capabilities · Team/Enterprise: an admin turns it on under Organization settings → Plugins & skills · every plan, including Free
Upload once; it works in claude.ai and Claude Desktop, and in recent Claude Code signed in with a Claude account (not with an API key)
Cowork and cloud sessions use the skills turned on in your claude.ai account, not ~/.claude/skills on your computer (Claude Desktop scheduled tasks run locally and still load it)
Checked against official docs 12 nov 2026 · Source: support.claude.com, support.claude.com, code.claude.com
Option 1Deja que Claude Code lo instale
Copia esta frase y pégala en un chat de Claude Code
For one project, paste it into a chat that is open in that project’s folder · The AI always shows you the path before installing
The AI tells you what it will do first and asks your permission at every step
Vuelve a abrir Claude Code y escribe /agent_workdir, o pide una tarea relacionada y Claude lo usará
Checked against official docs 12 nov 2026 · Source: code.claude.com
For Terminal users
Un Skill son instrucciones que la IA seguirá. Lee los archivos antes de instalar e instala solo de autores de confianza.
Abre la Terminal
Mac: pulsa Command+Espacio y escribe Terminal · Windows: el comando no funciona en PowerShell; usa «Que la IA lo instale» arriba
Copia la carpeta del skill a ~/.claude/skills
Descarga el repo a una carpeta temporal y copia solo las carpetas con SKILL.md
git clone --depth 1 https://github.com/bytedtsinghua-sia/cuda-agent.git /tmp/popnx-skill-bytedtsinghua-sia-cuda-agent-473025c && mkdir -p ~/.claude/skills && cp -R '/tmp/popnx-skill-bytedtsinghua-sia-cuda-agent-473025c/agent_workdir' ~/.claude/skills/agent_workdirVuelve a abrir Claude Code y escribe /agent_workdir, o pide una tarea relacionada y Claude lo usará
App de escritorio de ChatGPT
La app de escritorio de ChatGPT incluye Codex, y Codex lee las skills de la carpeta ~/.agents/skills
Option 1Deja que ChatGPT lo instale
Abre Codex en la app de escritorio de ChatGPT y pega esta frase en el chat
The AI always shows you the path before installing
The AI tells you what it will do first and asks your permission at every step
Option 2Coloca la carpeta tú mismo
Coloca la carpeta agent_workdir en ~/.agents/skills/agent_workdir
~ es tu carpeta de inicio ($HOME)
For Terminal users
Un Skill son instrucciones que la IA seguirá. Lee los archivos antes de instalar e instala solo de autores de confianza.
Abre la Terminal
Mac: pulsa Command+Espacio y escribe Terminal · Windows: el comando no funciona en PowerShell; usa «Que la IA lo instale» arriba
Copia la carpeta del skill a ~/.agents/skills
Descarga el repo a una carpeta temporal y copia solo las carpetas con SKILL.md
git clone --depth 1 https://github.com/bytedtsinghua-sia/cuda-agent.git /tmp/popnx-skill-bytedtsinghua-sia-cuda-agent-473025c && mkdir -p ~/.agents/skills && cp -R '/tmp/popnx-skill-bytedtsinghua-sia-cuda-agent-473025c/agent_workdir' ~/.agents/skills/agent_workdir
Después de instalar
- App de escritorio de ChatGPT: abre Skills en la barra lateral para ver que la skill está
- Para usarla: en ChatGPT escribe @ y elige la skill · en Codex CLI o la extensión del IDE ejecuta /skills o escribe $ y el nombre de la skill
- Codex detecta solo las skills recién instaladas; si una no aparece, reinicia Codex
Checked against official docs 15 nov 2026 · Source: learn.chatgpt.com
ChatGPT en la web y el móvil
Las skills que instalas tú no funcionan aquí; solo las que vienen con un plugin del directorio
Para usar esta skill con ChatGPT, usa la app de escritorio de ChatGPT como se indica arriba
Checked against official docs 15 nov 2026 · Source: learn.chatgpt.com
Option 1Deja que Codex lo instale
Copia esta frase y pégala en un chat de Codex · Sirve en Codex dentro de la app de escritorio de ChatGPT, en Codex CLI y en la extensión del IDE
For one project, paste it into a chat that is open in that project’s folder · The AI always shows you the path before installing
The AI tells you what it will do first and asks your permission at every step
Codex detecta solo las skills recién instaladas; si una no aparece, reinicia Codex · Para usarla: en ChatGPT escribe @ y elige la skill · en Codex CLI o la extensión del IDE ejecuta /skills o escribe $ y el nombre de la skill
Checked against official docs 15 nov 2026 · Source: learn.chatgpt.com
For Terminal users
Un Skill son instrucciones que la IA seguirá. Lee los archivos antes de instalar e instala solo de autores de confianza.
Abre la Terminal
Mac: pulsa Command+Espacio y escribe Terminal · Windows: el comando no funciona en PowerShell; usa «Que la IA lo instale» arriba
Copia la carpeta del skill a ~/.agents/skills
Descarga el repo a una carpeta temporal y copia solo las carpetas con SKILL.md
git clone --depth 1 https://github.com/bytedtsinghua-sia/cuda-agent.git /tmp/popnx-skill-bytedtsinghua-sia-cuda-agent-473025c && mkdir -p ~/.agents/skills && cp -R '/tmp/popnx-skill-bytedtsinghua-sia-cuda-agent-473025c/agent_workdir' ~/.agents/skills/agent_workdirVuelve a abrir Codex y pide una tarea relacionada; Codex mostrará el skill
Option 1Deja que Cursor lo instale
Copia esta frase y pégala en un chat de Cursor
For one project, paste it into a chat that is open in that project’s folder · The AI always shows you the path before installing
The AI tells you what it will do first and asks your permission at every step
En el chat Agent de Cursor escribe / y elige agent_workdir
Checked against official docs 12 nov 2026 · Source: cursor.com
For Terminal users
Un Skill son instrucciones que la IA seguirá. Lee los archivos antes de instalar e instala solo de autores de confianza.
Abre la Terminal
Mac: pulsa Command+Espacio y escribe Terminal · Windows: el comando no funciona en PowerShell; usa «Que la IA lo instale» arriba
Copia la carpeta del skill a ~/.cursor/skills
Descarga el repo a una carpeta temporal y copia solo las carpetas con SKILL.md
git clone --depth 1 https://github.com/bytedtsinghua-sia/cuda-agent.git /tmp/popnx-skill-bytedtsinghua-sia-cuda-agent-473025c && mkdir -p ~/.cursor/skills && cp -R '/tmp/popnx-skill-bytedtsinghua-sia-cuda-agent-473025c/agent_workdir' ~/.cursor/skills/agent_workdirEn el chat Agent de Cursor escribe / y elige agent_workdir
Option 1Let the AI install it
Para otras apps que leen skills. La frase incluye las rutas de Claude Code, Codex y Cursor para que la IA elija la de tu app · Copy this sentence into the app’s chat
For one project, paste it into a chat that is open in that project’s folder · The AI always shows you the path before installing
The AI tells you what it will do first and asks your permission at every step
Checked against official docs 12 nov 2026 · Source: code.claude.com, learn.chatgpt.com, cursor.com
For Terminal users
Otras apps con Agent Skills (como Gemini CLI o GitHub Copilot) usan otras carpetas. Mira la guía de esa app y copia allí la carpeta con el SKILL.md.
Carpetas de skills comprobadas con las guías oficiales de Claude Code, Codex y Cursor el 11 nov 2026
✓ Comandos revisados el 18 nov 2026
Ver el SKILL.md original
El texto siguiente viene del repo del autor, no de PopNx MCP
Se muestran los primeros 8000 caracteres · Abrir el archivo completo en GitHub
You are a PyTorch and CUDA expert. Accelerate the given PyTorch Model by creating a high-performance CUDA C++ extension, targeting the best possible performance with a minimum requirement of 5% faster than torch.compile baseline.
## 1. CRITICAL RESTRICTIONS
### ⚠️ STRICTLY FORBIDDEN
- **NO torch operators in C++**: NEVER use `torch::*` or `torch::nn::functional::*` in binding.cpp or .cu files
- **NO torch operations in model_new.py**: Only tensor creation and your custom ops allowed
- **NO third-party libraries**: Except cuBLAS (GEMM only) and cuDNN (Conv only)
- **NO modifications to utils/ directory**
- **NO modifications to binding.cpp or binding_registry.h**: These are fixed infrastructure
### ✅ ALLOWED ONLY
- **C++**: Raw CUDA kernels (for custom ops), cuBLAS (for GEMM), cuDNN (MANDATORY for Conv/ConvTranspose)
- **Python**: torch.tensor creation, custom extension ops, tensor properties (.shape, .device)
- **Memory**: torch::empty_like for allocation only
- **Focus**: Implement kernels in `kernels/` directory only
## 2. WORKSPACE STRUCTURE
```
.
├── binding_registry.h # Do NOT modify - registration system
├── binding.cpp # Do NOT modify - main module binding
├── kernels/ # YOUR WORK: Implement all kernels here
├── utils/ # DO NOT modify - Compilation, verification and profiling tools
├── model.py # DO NOT modify - Original PyTorch model
└── model_new.py # YOUR WORK: Your optimized model using custom ops.
```
### File Types and Usage
- **`.cu` files**: CUDA kernels with `__global__` functions (custom implementations)
- **`.cpp` files**: cuDNN/cuBLAS API calls (NO custom kernels)
- **`_binding.cpp` files**: PyTorch tensor handling and Python bindings
## 3. UNIFIED WORKFLOW
### Step 1: Implementation
Create paired files in `kernels/`:
**kernels/my_kernel.cu** (Pure CUDA implementation):
```cuda
#include <cuda_runtime.h>
// Template kernel for performance tuning
template<int BLOCK_SIZE, int TILE_SIZE>
__global__ void my_kernel_impl(float* output, const float* input, int size) {
// Shared memory for tiling
extern __shared__ float smem[];
int tid = blockIdx.x * blockDim.x + threadIdx.x;
int stride = blockDim.x * gridDim.x;
// Grid-stride loop for large data
for (int i = tid; i < size; i += stride) {
// Kernel logic with optimizations
output[i] = /* computation */;
}
}
// C-interface launcher (no PyTorch dependencies)
extern "C" void my_kernel_launcher(
float* output,
const float* input,
int size,
int config,
cudaStream_t stream
) {
// Dynamic configuration selection
int blocks = (size + 255) / 256;
int shared_mem_size = 0;
switch(config) {
case 0:
shared_mem_size = 256 * sizeof(float);
my_kernel_impl<256, 16><<<blocks, 256, shared_mem_size, stream>>>(
output, input, size);
break;
case 1:
shared_mem_size = 128 * sizeof(float);
my_kernel_impl<128, 32><<<blocks, 128, shared_mem_size, stream>>>(
output, input, size);
break;
default:
my_kernel_impl<256, 16><<<blocks, 256, 0, stream>>>(
output, input, size);
}
}
```
**kernels/my_kernel_binding.cpp** (PyTorch binding):
```cpp
// Use this two headers to replace torch/extension.h for faster compilation
#include <torch/types.h>
#include <torch/csrc/utils/pybind.h>
#include <cuda_runtime.h>
#include <c10/cuda/CUDAStream.h>
#include "../binding_registry.h"
// Declare launcher from .cu file
extern "C" void my_kernel_launcher(
float* output,
const float* input,
int size,
int config,
cudaStream_t stream
);
// PyTorch wrapper with config parameter
torch::Tensor my_kernel_forward(torch::Tensor input, int config = 0) {
// Input validation
TORCH_CHECK(input.is_cuda(), "Input must be a CUDA tensor");
TORCH_CHECK(input.is_contiguous(), "Input must be contiguous");
TORCH_CHECK(input.dtype() == torch::kFloat32, "Input must be float32");
auto output = torch::empty_like(input);
// Get current CUDA stream (correct way)
cudaStream_t stream = c10::cuda::getCurrentCUDAStream().stream();
// Call CUDA launcher with config
my_kernel_launcher(
output.data_ptr<float>(),
input.data_ptr<float>(),
input.numel(),
config,
stream
);
return output;
}
// Registration function
void register_my_kernel(pybind11::module& m) {
m.def("my_kernel_forward", &my_kernel_forward,
"My kernel forward",
py::arg("input"),
py::arg("config") = 0);
}
// Auto-register
REGISTER_BINDING(my_kernel, register_my_kernel);
```
#### Create model_new.py
```python
import torch
import torch.nn as nn
import cuda_extension
class ModelNew(nn.Module):
def __init__(self, ...): # MUST match Model signature exactly
super().__init__()
# Initialize parameters - preserve original structure for state_dict compatibility
self.weight = nn.Parameter(torch.randn(...))
self.bias = nn.Parameter(torch.zeros(...))
def forward(self, x):
# Use custom ops only - NO torch operations
x = cuda_extension.my_kernel_forward(x, config=0)
x = cuda_extension.gemm_forward(x, self.weight, self.bias)
return x
```
### Step 2: Compile and Test
```bash
# Compile with architecture-specific optimizations
TORCH_CUDA_ARCH_LIST=9.0 bash utils/compile.sh
# Test in sandbox
sudo python3 -m utils.verification
sudo python3 -m utils.profiling
```
### Step 3: Performance Optimization (IF NEEDED)
#### 3.1 Optimization Strategy (Priority Order)
**Priority 1: Algorithmic (>50% impact)**
- Kernel fusion - reduce memory traffic
- Shared memory tiling - improve data reuse
- Memory coalescing - consecutive access patterns
**Priority 2: Hardware Utilization (20-50% impact)**
- Vectorized loads (float2/float4)
- Warp-level primitives (__shfl_sync, __ballot_sync)
- Occupancy tuning (block size, register usage)
**Priority 3: Fine-tuning (<20% impact)**
- Instruction-level parallelism
- Mixed precision (FP16/TF32)
- Prefetching and double buffering
#### 3.2 Parameter Tuning (Last Resort)
Only when within 1.2x of target and algorithmic options exhausted:
```python
# tune_kernel.py - NO recompilation needed
import time, torch, cuda_extension
configs = [
(0, "256_threads_16_tile"),
(1, "128_threads_32_tile"),
(2, "512_threads_8_tile")
]
# Test input
x = torch.randn(batch_size, features).cuda()
# Benchmark each config
best_config, best_time = 0, float('inf')
for config_id, name in configs:
# Warmup
for _ in range(10):
cuda_extension.my_kernel_forward(x, config=config_id)
torch.cuda.synchronize()
# Measure
start = time.perf_counter()
for _ in range(100):
cuda_extension.my_kernel_forward(x, config=config_id)
torch.cuda.synchronize()
elapsed = time.perf_counter() - start
print(f"Config {name}: {elapsed:.4f}s")
if elapsed < best_time:
best_time, best_config = elapsed, config_id
print(f"Best: config {best_config} ({best_time:.4f}s)")
# Update model_new.py with best_config
```
### Step 4: Iteration Requirements
#### Correctness Failures
**MUST iterate until correctness passes - NO EXCEPTIONS**
1. Debug the specific failing kernel
2. Common issues to check:
- Boundary conditions (tid < size)
- Synchronization (__syncthreads placement)
- Data types and precision
- Memory alignment
3. Fix in kernels/*.cu and *_binding.cpp ONLY
4. Recompile and test
#### Performance Optimization
**GOAL: Achieve the best possible performance (the faster, the better!)**
**MINIMUM: Must be at least 5% faster than torch.compile baseline**
For each iteration:
1. **Document expectation**: "Fusion will eliminate 3 kernels, expect ~20% speedup"
2. **Apply optimization aggressively**: DConversación
Pregunta, comparte un consejo o avisa de que no funciona. Ordenado por lo que la gente marcó como útil.
Aún no hay publicaciones. Sé la primera persona en preguntar o compartir.
Lo publicado aquí lo escriben usuarios, no el equipo de PopNx.
Desde GitHub
- Estrellas en GitHub
- 1358
- Autor
- BytedTsinghua-SIA
- Licencia
- Sin licencia indicada Este repo no indica licencia: por defecto el autor conserva todos los derechos. Pregunta antes de compartirlo o usarlo comercialmente.
- Último cambio de código
- 8 jul 2026
- Archivos SKILL.md del repo (con traducciones y plantillas)
- 1