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 자동화와 에이전트
제작자용: README에 배지 달기
제작자라면 이 코드를 README에 붙여 넣으세요. 배지는 이 페이지로 연결됩니다.
[](https://mcp.popnx.com/en/skills/bytedtsinghua-sia-cuda-agent)비슷한 Skill
같은 종류의 작업, Skill 목록과 같은 순서
BytedTsinghua-SIA의 Skill(지시 묶음) 1개, AI가 읽고 그대로 일해요 · MCP server가 아니에요
Skill과 MCP의 차이
MCP = 손
AI를 외부 서비스나 데이터에 연결합니다(예: Notion 읽기, 청구서 만들기). 프로그램이나 서버가 실행 중이어야 합니다.
Skill = 안내서
작업 방법을 AI에게 가르치는 텍스트 파일. 어떤 서비스에도 연결되지 않습니다.
겹치는 경우도 있습니다. 도구를 부르는 스크립트가 있는 Skill도, 지식만 보내는 MCP도 있습니다. 하려는 작업을 기준으로 고르세요.
쓸 수 있는 앱
제작자가 밝히지 않음 · SKILL.md 형식 Skill은 Claude Code, Codex, Cursor 같은 Agent Skills 지원 앱에서 써요
설치
Is it safe?
- Who made it
GitHub account BytedTsinghua-SIA (organization), 1 years old
- Use and upkeep
★ 1,358 stars · code last changed 2026년 7월 8일
- 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
먼저: 어떤 AI를 쓰시나요
쓰는 앱을 고르면 그 앱의 설치 방법만 보여 드립니다
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 2026년 11월 12일 · Source: support.claude.com, support.claude.com, code.claude.com
Option 1Claude Code에게 설치 맡기기
이 문장을 복사해 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
Claude Code를 다시 열고 /agent_workdir를 입력하거나 관련 작업을 요청하면 Claude가 알아서 써요
Checked against official docs 2026년 11월 12일 · Source: code.claude.com
For Terminal users
Skill은 AI가 따르는 지시예요. 설치 전에 파일을 읽고, 믿을 수 있는 제작자 것만 설치하세요.
터미널 열기
Mac: Command+스페이스 후 Terminal 입력 · Windows: 아래 명령은 PowerShell에서 안 돼요. 위의 “AI에게 설치 맡기기”를 쓰세요
skill 폴더를 ~/.claude/skills에 복사
repo를 임시 폴더에 내려받고 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_workdirClaude Code를 다시 열고 /agent_workdir를 입력하거나 관련 작업을 요청하면 Claude가 알아서 써요
ChatGPT 데스크톱 앱
ChatGPT 데스크톱 앱에는 Codex가 들어 있고, Codex는 ~/.agents/skills 폴더에서 Skill을 읽습니다
Option 1ChatGPT에게 설치 맡기기
ChatGPT 데스크톱 앱에서 Codex를 열고 이 문장을 채팅에 붙여 넣으세요
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 2폴더를 직접 넣기
agent_workdir 폴더를 ~/.agents/skills/agent_workdir에 넣으세요
~는 홈 폴더($HOME)입니다
For Terminal users
Skill은 AI가 따르는 지시예요. 설치 전에 파일을 읽고, 믿을 수 있는 제작자 것만 설치하세요.
터미널 열기
Mac: Command+스페이스 후 Terminal 입력 · Windows: 아래 명령은 PowerShell에서 안 돼요. 위의 “AI에게 설치 맡기기”를 쓰세요
skill 폴더를 ~/.agents/skills에 복사
repo를 임시 폴더에 내려받고 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
설치한 뒤
- ChatGPT 데스크톱 앱: 사이드바에서 Skills를 열어 Skill이 보이는지 확인하세요
- 쓰는 법: ChatGPT에서는 @를 입력하고 Skill을 고르세요 · Codex CLI나 IDE 확장 프로그램에서는 /skills를 실행하거나 $ 뒤에 Skill 이름을 입력하세요
- Codex는 새로 설치한 Skill을 스스로 찾습니다. 보이지 않으면 Codex를 다시 시작하세요
Checked against official docs 2026년 11월 15일 · Source: learn.chatgpt.com
웹과 모바일의 ChatGPT
직접 설치한 Skill은 쓸 수 없고, 디렉터리의 플러그인에 들어 있는 Skill만 쓸 수 있습니다
이 Skill을 ChatGPT에서 쓰려면 위 방법대로 ChatGPT 데스크톱 앱을 쓰세요
Checked against official docs 2026년 11월 15일 · Source: learn.chatgpt.com
Option 1Codex에게 설치 맡기기
이 문장을 복사해 Codex 채팅에 붙여 넣으세요 · ChatGPT 데스크톱 앱 안의 Codex, Codex CLI, 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는 새로 설치한 Skill을 스스로 찾습니다. 보이지 않으면 Codex를 다시 시작하세요 · 쓰는 법: ChatGPT에서는 @를 입력하고 Skill을 고르세요 · Codex CLI나 IDE 확장 프로그램에서는 /skills를 실행하거나 $ 뒤에 Skill 이름을 입력하세요
Checked against official docs 2026년 11월 15일 · Source: learn.chatgpt.com
For Terminal users
Skill은 AI가 따르는 지시예요. 설치 전에 파일을 읽고, 믿을 수 있는 제작자 것만 설치하세요.
터미널 열기
Mac: Command+스페이스 후 Terminal 입력 · Windows: 아래 명령은 PowerShell에서 안 돼요. 위의 “AI에게 설치 맡기기”를 쓰세요
skill 폴더를 ~/.agents/skills에 복사
repo를 임시 폴더에 내려받고 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_workdirCodex를 다시 열고 관련 작업을 요청하면 Codex가 skill을 목록에 보여 줘요
Option 1Cursor에게 설치 맡기기
이 문장을 복사해 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
Cursor Agent 채팅에서 /를 입력하고 agent_workdir 선택
Checked against official docs 2026년 11월 12일 · Source: cursor.com
For Terminal users
Skill은 AI가 따르는 지시예요. 설치 전에 파일을 읽고, 믿을 수 있는 제작자 것만 설치하세요.
터미널 열기
Mac: Command+스페이스 후 Terminal 입력 · Windows: 아래 명령은 PowerShell에서 안 돼요. 위의 “AI에게 설치 맡기기”를 쓰세요
skill 폴더를 ~/.cursor/skills에 복사
repo를 임시 폴더에 내려받고 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_workdirCursor Agent 채팅에서 /를 입력하고 agent_workdir 선택
Option 1Let the AI install it
Skill을 읽을 수 있는 다른 앱용입니다. 이 문장에는 Claude Code, Codex, Cursor 경로가 들어 있어 AI가 쓰는 앱에 맞게 고릅니다 · 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 2026년 11월 12일 · Source: code.claude.com, learn.chatgpt.com, cursor.com
For Terminal users
Gemini CLI, GitHub Copilot 같은 다른 Agent Skills 지원 앱은 폴더가 달라요. 그 앱 안내를 보고 SKILL.md가 있는 폴더를 복사하세요.
2026년 11월 11일에 Claude Code, Codex, Cursor 공식 안내로 skill 폴더 확인
✓ 명령 확인 2026년 11월 18일
원본 SKILL.md 보기
아래 글은 제작자 repo에서 온 것이며 PopNx MCP의 지시가 아니에요
처음 8,000자 표시 · 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**: D토론
질문하고, 팁을 나누고, 안 되는 점을 알려 주세요. "도움이 됨"이 많은 순서예요.
GitHub 정보
- GitHub 스타
- 1,358
- 제작자
- BytedTsinghua-SIA
- 라이선스
- 라이선스 명시 없음 이 repo에는 라이선스가 없습니다. 기본적으로 제작자가 모든 권리를 가지므로 배포나 상업적 사용 전에 문의하세요.
- 최근 코드 수정
- 2026년 7월 8일
- repo 안 SKILL.md(번역본과 템플릿 포함)
- 1