Skip to content

Challenge Creation Cron #19

Challenge Creation Cron

Challenge Creation Cron #19

name: Challenge Creation Cron
on:
schedule:
- cron: "0 2 * * 2,4,6" # Monday, Wednesday, Friday at 6 PM PST
workflow_dispatch: {} # Allow manual trigger
jobs:
create-challenge:
runs-on: ubuntu-latest
timeout-minutes: 30
permissions:
contents: write
pull-requests: write
issues: write
id-token: write
actions: read
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install dependencies
run: |
pip install pre-commit requests websocket-client
pre-commit install
- name: Fetch open PRs
id: open-prs
env:
GH_TOKEN: ${{ github.token }}
run: |
{
echo "open_prs<<OPEN_PRS_EOF"
gh pr list --state open --json number,title,headRefName --template '{{range .}}PR #{{.number}}: {{.title}} (branch: {{.headRefName}}){{"\n"}}{{end}}'
echo "OPEN_PRS_EOF"
} >> "$GITHUB_OUTPUT"
- name: Run Claude Code
id: claude
uses: anthropics/claude-code-action@v1
env:
SERVICE_URL: ${{ secrets.LEETGPU_SERVICE_URL }}
LEETGPU_API_KEY: ${{ secrets.LEETGPU_API_KEY }}
with:
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
claude_args: "--model claude-sonnet-4-6"
settings: |
{
"permissions": {
"allow": ["Bash", "Read", "Write", "Edit", "Glob", "Grep", "WebFetch", "WebSearch", "Task"]
}
}
prompt: |
Read CLAUDE.md and follow the Creation Workflow to create and validate (with `run_challenge.py`) a new LeetGPU coding challenge, then open a PR.
Before writing any code, think hard about what would make a genuinely interesting GPU programming challenge. List existing challenges (ls challenges/*/), study what's already covered, and brainstorm problems that would teach people something new about GPU programming.
IMPORTANT — CHECK FOR CONFLICTS WITH OPEN PRs:
The following open PRs already exist. You MUST avoid picking a challenge number or topic that conflicts with any of these:
${{ steps.open-prs.outputs.open_prs }}
Pick the next available challenge number that is NOT already taken by a merged challenge or an open PR. Also avoid creating a challenge on the same topic as any pending PR, even if the number differs.
THEME — REAL-WORLD INFERENCE KERNELS:
Focus on challenges inspired by real-world ML inference workloads. Think about the building blocks of modern neural networks (transformers, diffusion models, LLMs, vision models) and the GPU kernels that make them fast. Good examples:
- Fused inference kernels: fused SwiGLU/GeGLU MLP blocks, flash attention, paged attention, speculative decoding verification, quantized matmul (INT8/INT4), fused QKV projection, KV-cache updates
- Sequence/token operations: top-k/top-p sampling, beam search step, KV-cache rotation, causal masking
- Model architecture blocks: full transformer decoder block (like the existing GPT-2 challenge), mixture-of-experts routing, LoRA forward pass
- Online/streaming algorithms: online softmax, streaming attention (process new queries without storing entire rows), continuous batching, prefix caching
Look at `challenges/medium/74_gpt2_block/` as the gold standard for this style of challenge. The solver should implement a meaningful, self-contained inference building block — not a toy operation.
HARD RULES:
- Do NOT create trivial element-wise challenges. We have way too many (sigmoid, relu, silu, clipping, etc). If your idea is just "apply f(x) to every element", pick something else.
- Do NOT duplicate existing challenges — check both the merged challenges in the repo AND the open PRs listed above.
- Do NOT use a challenge number that is already claimed by an open PR.
- Prefer medium or hard difficulty. Only create easy if the topic involves a non-trivial GPU concept (not just a map operation).
- The challenge should require the solver to think about memory access patterns, synchronization, work distribution, or algorithm design — not just write a one-line kernel.
Before opening the PR, verify every item in the "Checklist" section of CLAUDE.md. Run `pre-commit run --all-files` to lint.