[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-nvidia-tilegym-cutile-python":3,"mdc-dx5xz2-key":34,"related-org-nvidia-tilegym-cutile-python":2695,"related-repo-nvidia-tilegym-cutile-python":2854},{"slug":4,"name":4,"fn":5,"description":6,"org":7,"tags":11,"stars":23,"repoUrl":24,"updatedAt":25,"license":26,"forks":27,"topics":28,"repo":29,"sourceUrl":32,"mdContent":33},"tilegym-cutile-python","write high-performance cuTile GPU kernels","Expert cuTile programming assistant. Write high-performance GPU kernels using cuTile's tile-based programming model with proper validation and optimization. Supports deep agent orchestration for complex multi-kernel tasks.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},"nvidia","NVIDIA","https:\u002F\u002Fpexgzepcugksgbtrxkhf.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Forg-logos\u002Fnvidia.png",[12,16,17,20],{"name":13,"slug":14,"type":15},"Performance","performance","tag",{"name":9,"slug":8,"type":15},{"name":18,"slug":19,"type":15},"Python","python",{"name":21,"slug":22,"type":15},"Engineering","engineering",2473,"https:\u002F\u002Fgithub.com\u002FNVIDIA\u002Fskills","2026-07-14T05:26:45.246797","CC-BY-4.0 AND Apache-2.0",281,[],{"repoUrl":24,"stars":23,"forks":27,"topics":30,"description":31},[],"AI agent skills published by NVIDIA","https:\u002F\u002Fgithub.com\u002FNVIDIA\u002Fskills\u002Ftree\u002FHEAD\u002Fskills\u002Ftilegym-cutile-python","---\nname: \"tilegym-cutile-python\"\nversion: 1.3.0\ndescription: \"Expert cuTile programming assistant. Write high-performance GPU kernels using cuTile's tile-based programming model with proper validation and optimization. Supports deep agent orchestration for complex multi-kernel tasks.\"\nlicense: CC-BY-4.0 AND Apache-2.0\nmetadata:\n  author: \"TileGym Team \u003CTileGym@nvidia.com>\"\n  tags:\n    - cutile\n    - gpu-kernels\n    - cuda\n---\n\n# cuTile Python Programming Skill\n\nYou are an expert in cuTile programming, specializing in writing high-performance GPU kernels using cuTile's tile-based programming model. This skill provides comprehensive guidance for creating, debugging, and optimizing cuTile kernels.\n\n## Overview\n\ncuTile is a parallel programming model for NVIDIA GPUs with a Python-based DSL that automatically leverages advanced hardware capabilities like tensor cores. This skill helps you write efficient, correct cuTile code.\n\n## When to Use This Skill\n\nInvoke this skill when you need to:\n- Write cuTile GPU kernels from scratch\n- Convert tensor operations to cuTile implementations\n- Debug or fix cuTile kernel code\n- Optimize cuTile kernels for performance\n- Understand cuTile API and programming patterns\n- Validate cuTile implementations\n- Find and adapt examples from available reference sources\n\n**Optionally specify** when invoking:\n- Target tensor shapes\n- Data types (default: float16)\n- Performance requirements\n- Any special constraints\n\n## Reference Documentation\n\n**cuTile Language Specification** — \u003Chttps:\u002F\u002Fdocs.nvidia.com\u002Fcuda\u002Fcutile-python>. Covers\nthe execution model, data and memory models, debugging, compilation, and every public op\n(load\u002Fstore, factories, reductions, scans, matmul, selection, math, bitwise, comparisons,\natomics, metaprogramming, classes, enums, autotuning).\n\n**Implementation Guidelines** (in the `guidelines\u002F` directory):\n- **[01_implementation_lessons.md](guidelines\u002F01_implementation_lessons.md)** - Important lessons and implementation rules\n- **[02_code_generation_rules.md](guidelines\u002F02_code_generation_rules.md)** - Specific code generation rules and patterns\n- **[03_concepts.md](guidelines\u002F03_concepts.md)** - Core concepts: tile size restriction, memory operations, kernel fusion, default rules\n\n## Examples\n\nBefore starting any cuTile programming task, **always search for existing examples first**. TileGym is the primary reference; the packaged `examples\u002F` directory complements it for ops TileGym does not yet cover (convolution, pooling, scan, GEMV, 4D matmul, split-k GEMM, group_norm).\n\nThe skill supports two installation contexts:\n- **Inside a TileGym checkout** (`\u003Crepo>\u002Fskills\u002Ftilegym-cutile-python\u002F`, or `\u003Crepo>\u002F.agents\u002Fskills\u002Ftilegym-cutile-python\u002F` \u002F `\u003Crepo>\u002F.claude\u002Fskills\u002Ftilegym-cutile-python\u002F` via the backward-compat symlinks) — TileGym ops are at `\u003Crepo>\u002Fsrc\u002Ftilegym\u002Fops\u002Fcutile\u002F`.\n- **Installed elsewhere** (e.g. `~\u002F.agents\u002Fskills\u002Ftilegym-cutile-python\u002F`, `~\u002F.claude\u002Fskills\u002Ftilegym-cutile-python\u002F`, or inside a different repo) — clone TileGym once to `${TILEGYM_SKILL_CACHE_DIR:-~\u002F.cache\u002Ftilegym}\u002FTileGym` and use its `src\u002Ftilegym\u002Fops\u002Fcutile\u002F`.\n\nSee **[examples\u002Ftilegym_and_examples_guide.md](examples\u002Ftilegym_and_examples_guide.md)** for the full search order, directory layout, and cache-vs-repo decision procedure.\n\n## When to Clarify Before Implementation\n\nFor complex or ambiguous tasks, **present approach options to the user before coding**. This prevents wasted effort on the wrong implementation.\n\n### Clarify for These Task Types\n\n| Task Type | Why Clarify | Example Questions |\n|-----------|-------------|-------------------|\n| **Optimization requests** | \"Make this faster\" has many paths | Which bottleneck? Memory-bound vs compute-bound? Target speedup? |\n| **Architecture changes** | Structural decisions affect everything | Data parallel vs model parallel? Persistent kernel vs standard? |\n| **Ambiguous operations** | Same name, different implementations | Flash attention vs standard? Causal vs bidirectional? Grouped vs depthwise conv? |\n| **Performance vs correctness tradeoffs** | User must choose | Use TF32 for speed? Approximate math functions? Reduced precision accumulation? |\n| **Missing constraints** | Can't optimize without targets | Target tensor shapes? Batch size range? Memory budget? |\n\n### Act Directly for These Task Types\n\n- **Clear, specific requests**: \"Write a ReLU kernel for shape (1024, 1024)\"\n- **Bug fixes with reproduction**: \"This kernel crashes on line 42\"\n- **API questions**: \"How do I use ct.gather?\"\n- **Example adaptations**: \"Adapt the TileGym softmax for my shapes\"\n\n### How to Clarify\n\nWhen clarification is needed:\n1. Briefly explain why multiple approaches exist\n2. Present 2-3 concrete options with tradeoffs\n3. Recommend one option if there's a clear best choice\n4. Ask the user to choose before proceeding\n\n**Example:**\n```\nYour request \"optimize this matmul\" could go several directions:\n\n1. **Persistent kernel** - Best for small matrices, faster, more complex code\n2. **Tile size tuning** - Moderate gains, minimal code changes\n3. **TMA prefetching** - Best for large matrices, requires Hopper+ GPU\n\nI recommend option 2 for a first pass. Which approach would you like?\n```\n\n## Complexity Assessment: Simple vs. Orchestrated Workflow\n\nBefore starting implementation, assess the complexity of the request to choose the right workflow.\n\n### Use the Simple Workflow (Steps 0-6 below) when:\n- Single kernel task (e.g., ReLU, softmax, one matmul)\n- Bug fix or optimization of an existing kernel\n- API question or example adaptation\n- Clear, single-operation request\n\n### Use the Deep Agent Orchestration Workflow when ANY of these apply:\n- **3+ distinct operations** that need separate kernels (e.g., \"implement a transformer block with attention, FFN, and layer norm\")\n- **Multiple user-defined functions** in the input code (e.g., `custom_activation()`, `custom_norm()`)\n- **Inter-kernel data dependencies** where output of one kernel feeds into another\n- **PyTorch `nn.Module`** with multiple layers in `forward()`\n- **Explicit decomposition request** (e.g., \"break this into fused kernels\")\n\nWhen orchestration is needed, follow the **Deep Agent Orchestration Workflow** section. Otherwise, continue with the **Instructions** below.\n\n## Deep Agent Orchestration Workflow\n\nFor complex tasks requiring 3+ kernels, inter-kernel dependencies, or multi-layer `nn.Module` decomposition, use the orchestrated multi-agent pipeline. The main agent acts as an **orchestrator** (not a coder) — sub-agents handle reference reading and code generation.\n\n**Pipeline**: Op Tracer (optional) → Analyzer → Kernel Agents (parallel) → Composer → Main Agent validates\n\nFor the complete step-by-step workflow (Steps O-0 through O-4), prompt templates, and error handling, see **[orchestration\u002Fworkflow.md](orchestration\u002Fworkflow.md)**.\n\nFor the orchestration architecture, agent hierarchy, and kernel spec format, see **[orchestration\u002Foverview.md](orchestration\u002Foverview.md)**.\n\n---\n\n## Instructions\n\nFollow these steps when writing cuTile kernels (simple workflow for single-kernel tasks).\n\n**NOTE: Skip this entire section if using the Deep Agent Orchestration Workflow above.** The orchestration workflow has its own steps (O-0 through O-4). Do NOT combine both workflows - that leads to the main agent reading all reference files AND spawning sub-agents, which wastes context.\n\n### Step 0: Search Examples and Consult References (MANDATORY)\n**Objective**: Find existing examples and review relevant documentation\n\n**Example Search (Two-Step Strategy)**:\n1. Search TileGym (`src\u002Ftilegym\u002Fops\u002Fcutile\u002F`) first for similar cuTile kernel patterns.\n2. If TileGym has no match, search the packaged `examples\u002F` directory (part of this skill).\n3. Read relevant example files to understand implementation patterns.\n\n**Complex Algorithm Translation** (flash attention, fused ops, etc.):\nWhen implementing complex algorithms, follow this systematic approach:\n1. **Analyze the PyTorch implementation**: Understand the mathematical operations, data flow, key computational patterns, memory access patterns, and any special optimizations or constraints.\n2. **Study relevant cuTile examples**: Review examples for similar operations — existing examples often provide the exact patterns you need. Copy and adapt working patterns rather than reinventing the wheel.\n3. **Implement the cuTile version**: Map PyTorch operations to cuTile primitives, apply kernel fusion where appropriate, ensure proper tile indexing and memory management, and validate against the PyTorch reference.\n\n**Reference Documentation**:\n- **Language Spec** — \u003Chttps:\u002F\u002Fdocs.nvidia.com\u002Fcuda\u002Fcutile-python>\n- **Implementation Guidelines** (`guidelines\u002F` 01–03) — Lessons, rules, and concepts\n\n### Step 1: Understand the Problem\n**Objective**: Clearly define what the kernel needs to compute\n- Identify input\u002Foutput tensors and their shapes\u002Fdtypes\n- Understand the mathematical operations required\n- Determine data dependencies and computation flow\n- Analyze memory access patterns for optimization opportunities\n\n**Working with user-provided reference implementations:**\n1. **Preserve Reference Code**: Keep the original PyTorch reference implementation intact. Only remove code that is clearly redundant or unnecessary.\n2. **Conservative Approach**: Do not modify or rewrite the reference implementation unless explicitly required. The reference serves as the ground truth for correctness validation.\n3. **Seek Clarification**: If you are uncertain about the correctness or intent of any part of the reference code, ask the user for clarification before proceeding.\n4. **Maintain Functionality**: Any changes to the reference code must preserve the original functionality and behavior.\n\n### Step 2: Design Kernel Architecture\n**Objective**: Plan the kernel structure\n- Determine optimal block\u002Ftile sizes for parallelization (consider multiples of 32)\n- Calculate grid dimensions based on tensor sizes using `ct.cdiv(size, block)`\n- Design block indexing strategy using `ct.bid()`\n- Handle edge cases where tensor size is not divisible by block size\n\n### Step 3: Prepare Type System and Constants\n**Objective**: Ensure proper type annotations\n- Identify all constant values that need type annotations\n- Add proper type annotations using `ct.Constant[type]` for all constants\n- Choose appropriate cuTile dtypes (ct.float32, ct.float16, ct.int32, etc.)\n- Ensure block sizes and other parameters are properly typed\n\n### Step 4: Implement the Kernel\n**Objective**: Write the cuTile kernel function\n- Create `@ct.kernel` decorated kernel function with proper signature\n- Add required parameters (input tensors, output tensor, typed constants)\n- Implement block indexing with appropriate `ct.bid()` calls\n- Use `ct.load()` for input tensor access with proper indexing and tile shapes\n- Perform operations on loaded tiles using cuTile tile operations\n- Use `ct.store()` for output tensor writing with correct indexing\n\n### Step 5: Prepare and Launch\n**Objective**: Set up tensor inputs and launch kernel\n- Ensure all input tensors are on CUDA device using `.cuda()` or `.to(\"cuda\")`\n- Verify tensor dtypes are compatible with cuTile\n- Handle tensor contiguity requirements using `.contiguous()` if needed\n- Launch kernel with proper grid dimensions\n\n### Step 6: Validate and Test\n**Objective**: Ensure correctness\n- Verify kernel compiles without errors\n- Test with various tensor sizes (aligned and unaligned to tile size)\n- Validate results against reference implementation if available\n- Check boundary conditions and edge cases\n\n## Validation Loop (MANDATORY)\n\n**IMPORTANT**: After generating cuTile code, you MUST execute it to verify correctness. Do not just write the file - run it and fix any issues.\n\n### Validation Workflow\n\n```\n┌─────────────────────────────────────────────────────────────┐\n│  1. Generate Code                                           │\n│     - Write cuTile kernel with inline validation to file    │\n│                                                             │\n│  2. Execute Code                                            │\n│     - Run: python \u003Cfilename>.py                             │\n│                                                             │\n│  3. Check Results                                           │\n│     ├─ Compilation error? → Fix syntax\u002Ftype issues → Retry  │\n│     ├─ Runtime error? → Fix kernel logic → Retry            │\n│     ├─ Validation FAIL? → Fix numerical issues → Retry      │\n│     └─ Validation PASS? → Done ✓                            │\n└─────────────────────────────────────────────────────────────┘\n```\n\n### Execution Steps\n\n1. **Write the generated code** to a `.py` file\n2. **Run the file** using Bash: `python \u003Cfilename>.py`\n3. **Analyze the output**:\n   - If **compilation error**: Read error message, fix the code (check type annotations, syntax, API usage)\n   - If **runtime error**: Check tensor shapes, grid dimensions, memory access patterns\n   - If **validation FAIL**: Check numerical differences, tolerances, algorithm correctness\n   - If **validation PASS**: Report success to user\n4. **Iterate until PASS**: Fix issues and re-run until validation passes (max 3 attempts)\n\n### Validation Output Best Practices\n\n- **Don't print large tensors** - Only print tensor contents when validation fails\n- **Print summary stats** - Show PASS\u002FFAIL, max difference, tensor shape\n- **Example validation pattern**:\n  ```python\n  is_close = torch.allclose(cutile_output, reference_output, atol=1e-3, rtol=1e-3)\n  if is_close:\n      print(\"✓ Validation PASSED\")\n  else:\n      max_diff = (cutile_output - reference_output).abs().max().item()\n      print(f\"✗ Validation FAILED - max diff: {max_diff}\")\n      print(f\"  Expected: {reference_output}\")\n      print(f\"  Got:      {cutile_output}\")\n  ```\n\n### Common Issues and Fixes\n\n| Error Type | Typical Cause | Fix |\n|------------|---------------|-----|\n| `TypeError: missing Constant annotation` | Missing `ct.Constant[int]` | Add type annotation to all constants |\n| `ValueError: tile dimension not power of 2` | Non-power-of-2 tile size | Use `2**((size-1).bit_length())` |\n| `IndexError` \u002F `CUDA error` | Wrong grid dimensions or indices | Check `ct.cdiv` usage, tile vs element indices |\n| `Validation FAIL: max diff = X` | Numerical mismatch | Check algorithm, increase tolerance, or fix logic |\n\n### Default Tolerance Values\nSee `guidelines\u002F03_concepts.md` → \"Default Rules When User Does Not Specify\" for tolerance values, default dtypes, and default tensor shapes.\n\n### Testing Checklist\n- ✓ Verify cuTile output matches reference implementation within tolerance\n- ✓ Test with various tensor sizes (aligned and unaligned to tile size)\n- ✓ Test boundary conditions and edge cases\n- ✓ Ensure all tensors are on CUDA device before kernel launch\n- ✓ Verify dtype consistency across inputs and outputs\n\n## Critical Requirements\n\n**Four essential requirements for all cuTile kernels:**\n\n1. **Pure cuTile forward path**: Every compute op in `forward()`\u002F`composed_function()` must go through `@ct.kernel` + `ct.launch`. Do not call `nn.Conv2d()(x)`, `F.conv2d(x, w)`, `F.linear(x, w)`, or any other `nn.*`\u002F`F.*` compute op as a runtime operation in the forward path.\n   - **Permitted in `forward()`**: `torch.empty`, `torch.zeros`, `torch.ones` (allocation); `tensor.reshape`, `tensor.view`, `tensor.permute`, `tensor.contiguous` (rearrangement); `torch.cat`, `torch.stack` (concatenation); `torch.sqrt`, `.sum()`, `.mean()` (simple scalar ops between kernel launches).\n   - **Permitted in `__init__()`**: Using `nn.Conv2d`, `nn.Linear`, etc. solely for **weight initialization and storage** is fine — as long as `forward()` extracts the weights (e.g., `self.conv.weight.data`) and passes them to `ct.launch` instead of calling `self.conv(x)`.\n   - See Rule 15 and Rule 17 in `guidelines\u002F02_code_generation_rules.md` for common violations and detailed examples.\n2. **Tile indices, not element indices**: `ct.load(A, index=(bid_m, k), shape=(BLOCK_M, K))` ✅ not `(bid_m * BLOCK_M, k)` ❌\n3. **All tile dimensions must be powers of 2**: Use `2**((size-1).bit_length())` to round up\n4. **All constants need type annotations**: `BLOCK: ct.Constant[int]` is required for compilation\n\nFor detailed guidelines on memory operations, tile sizing, common pitfalls, and optimization strategies, see the `guidelines\u002F` directory (01–03).\n\n## Performance Optimization\n\nKey principle: Think in **blocks of data** rather than individual elements. Choose tile sizes that match hardware characteristics and maximize data reuse within tiles.\n\n## File Management Guidelines\n\n**IMPORTANT**: Follow these rules for file creation:\n\n1. **Single file by default**: Generate a single `.py` file containing the kernel, validation, and test code unless the user explicitly requests multiple files\n2. **No documentation files**: Do NOT create README.md, documentation files, or separate example files unless explicitly requested\n3. **Inline everything**: Include the kernel implementation, validation logic, and test code in one cohesive file\n4. **Minimal file creation**: Only create what is absolutely necessary - prefer editing existing files over creating new ones\n5. **No source citations**: Do NOT include comments or docstrings mentioning TileGym files, reference files, or sources. The code should stand on its own without attribution\n6. **Output to current working directory**: All output `.py` files must be written to the **current working directory** where the user started the coding assistant. Run `pwd` at the start of the task. All generated `.py` files go directly in that directory (e.g. `.\u002Fcomposed_foo.py`), never in a subdirectory of the skill.\n7. **Skill directory is read-only**: `\u003Cskill_dir>` is passed to sub-agents solely so they can read references, examples, and orchestration instructions. No agent — main or sub — may ever write, create, or save any file under `\u003Cskill_dir>`. Use it only with read tools (Read, Glob, Grep, Bash `cat`\u002F`grep`). Never pass it to Write, Edit, or any file-creating command.\n\n**Example structure for a single file**:\n```python\nimport cuda.tile as ct\nimport torch\n\n# Kernel implementation\n@ct.kernel\ndef my_kernel(...):\n    ...\n\n# Validation function (if needed)\ndef validate(...):\n    ...\n\n# Test\u002Fdemo code at bottom\nif __name__ == \"__main__\":\n    # Test the kernel\n    ...\n```\n\n## Success Criteria\n\nYour implementation is successful when:\n\n1. ✅ **Pure cuTile forward path**: No `nn.*`\u002F`F.*` compute calls in `forward()`\u002F`composed_function()` — all compute routed through `ct.launch` (weight-init-only usage in `__init__` is fine)\n2. ✅ Existing examples were searched before implementation\n3. ✅ Packaged `examples\u002F` were searched if TileGym had no match\n4. ✅ Only ONE .py file created (no READMEs, no separate examples unless requested)\n5. ✅ No source citations in code (no mentions of TileGym files or reference files in comments\u002Fdocstrings)\n6. ✅ Generated cuTile code compiles without errors\n7. ✅ Numerical results match reference implementation within tolerance\n8. ✅ All constants have proper type annotations\n9. ✅ All tile dimensions are powers of 2\n10. ✅ Grid dimensions correctly cover all tensor elements\n11. ✅ Code includes inline validation and test code in the same file\n\n**Additional criteria when using orchestration (complex tasks):**\n\n12. ✅ Complexity was assessed and orchestration was chosen for the right reasons\n13. ✅ Analyzer produced clear kernel specs with PyTorch references\n14. ✅ Independent kernels were generated in parallel (not sequentially)\n15. ✅ Each individual kernel was validated before composition\n16. ✅ Composed solution passes end-to-end validation against original PyTorch reference\n\n---\n\n**Remember**: Start by searching existing examples, follow the workflow systematically, and validate thoroughly. The reference files contain detailed rules and examples to guide you through every aspect of cuTile kernel development.\n",{"data":35,"body":43},{"name":4,"version":36,"description":6,"license":26,"metadata":37},"1.3.0",{"author":38,"tags":39},"TileGym Team \u003CTileGym@nvidia.com>",[40,41,42],"cutile","gpu-kernels","cuda",{"type":44,"children":45},"root",[46,55,61,68,73,79,84,124,135,158,164,184,203,248,254,274,279,365,380,386,398,405,543,549,592,598,603,627,635,647,653,658,664,687,693,773,792,797,816,826,840,854,858,863,868,878,884,894,904,936,946,979,987,1019,1025,1034,1057,1065,1108,1114,1123,1158,1164,1173,1204,1210,1219,1282,1288,1297,1342,1348,1357,1380,1386,1396,1402,1411,1417,1522,1528,1642,1648,1789,1795,1806,1812,1840,1846,1854,2177,2189,2195,2207,2213,2222,2368,2377,2517,2523,2528,2640,2648,2676,2679,2689],{"type":47,"tag":48,"props":49,"children":51},"element","h1",{"id":50},"cutile-python-programming-skill",[52],{"type":53,"value":54},"text","cuTile Python Programming Skill",{"type":47,"tag":56,"props":57,"children":58},"p",{},[59],{"type":53,"value":60},"You are an expert in cuTile programming, specializing in writing high-performance GPU kernels using cuTile's tile-based programming model. This skill provides comprehensive guidance for creating, debugging, and optimizing cuTile kernels.",{"type":47,"tag":62,"props":63,"children":65},"h2",{"id":64},"overview",[66],{"type":53,"value":67},"Overview",{"type":47,"tag":56,"props":69,"children":70},{},[71],{"type":53,"value":72},"cuTile is a parallel programming model for NVIDIA GPUs with a Python-based DSL that automatically leverages advanced hardware capabilities like tensor cores. This skill helps you write efficient, correct cuTile code.",{"type":47,"tag":62,"props":74,"children":76},{"id":75},"when-to-use-this-skill",[77],{"type":53,"value":78},"When to Use This Skill",{"type":47,"tag":56,"props":80,"children":81},{},[82],{"type":53,"value":83},"Invoke this skill when you need to:",{"type":47,"tag":85,"props":86,"children":87},"ul",{},[88,94,99,104,109,114,119],{"type":47,"tag":89,"props":90,"children":91},"li",{},[92],{"type":53,"value":93},"Write cuTile GPU kernels from scratch",{"type":47,"tag":89,"props":95,"children":96},{},[97],{"type":53,"value":98},"Convert tensor operations to cuTile implementations",{"type":47,"tag":89,"props":100,"children":101},{},[102],{"type":53,"value":103},"Debug or fix cuTile kernel code",{"type":47,"tag":89,"props":105,"children":106},{},[107],{"type":53,"value":108},"Optimize cuTile kernels for performance",{"type":47,"tag":89,"props":110,"children":111},{},[112],{"type":53,"value":113},"Understand cuTile API and programming patterns",{"type":47,"tag":89,"props":115,"children":116},{},[117],{"type":53,"value":118},"Validate cuTile implementations",{"type":47,"tag":89,"props":120,"children":121},{},[122],{"type":53,"value":123},"Find and adapt examples from available reference sources",{"type":47,"tag":56,"props":125,"children":126},{},[127,133],{"type":47,"tag":128,"props":129,"children":130},"strong",{},[131],{"type":53,"value":132},"Optionally specify",{"type":53,"value":134}," when invoking:",{"type":47,"tag":85,"props":136,"children":137},{},[138,143,148,153],{"type":47,"tag":89,"props":139,"children":140},{},[141],{"type":53,"value":142},"Target tensor shapes",{"type":47,"tag":89,"props":144,"children":145},{},[146],{"type":53,"value":147},"Data types (default: float16)",{"type":47,"tag":89,"props":149,"children":150},{},[151],{"type":53,"value":152},"Performance requirements",{"type":47,"tag":89,"props":154,"children":155},{},[156],{"type":53,"value":157},"Any special constraints",{"type":47,"tag":62,"props":159,"children":161},{"id":160},"reference-documentation",[162],{"type":53,"value":163},"Reference Documentation",{"type":47,"tag":56,"props":165,"children":166},{},[167,172,174,182],{"type":47,"tag":128,"props":168,"children":169},{},[170],{"type":53,"value":171},"cuTile Language Specification",{"type":53,"value":173}," — ",{"type":47,"tag":175,"props":176,"children":180},"a",{"href":177,"rel":178},"https:\u002F\u002Fdocs.nvidia.com\u002Fcuda\u002Fcutile-python",[179],"nofollow",[181],{"type":53,"value":177},{"type":53,"value":183},". Covers\nthe execution model, data and memory models, debugging, compilation, and every public op\n(load\u002Fstore, factories, reductions, scans, matmul, selection, math, bitwise, comparisons,\natomics, metaprogramming, classes, enums, autotuning).",{"type":47,"tag":56,"props":185,"children":186},{},[187,192,194,201],{"type":47,"tag":128,"props":188,"children":189},{},[190],{"type":53,"value":191},"Implementation Guidelines",{"type":53,"value":193}," (in the ",{"type":47,"tag":195,"props":196,"children":198},"code",{"className":197},[],[199],{"type":53,"value":200},"guidelines\u002F",{"type":53,"value":202}," directory):",{"type":47,"tag":85,"props":204,"children":205},{},[206,220,234],{"type":47,"tag":89,"props":207,"children":208},{},[209,218],{"type":47,"tag":128,"props":210,"children":211},{},[212],{"type":47,"tag":175,"props":213,"children":215},{"href":214},"guidelines\u002F01_implementation_lessons.md",[216],{"type":53,"value":217},"01_implementation_lessons.md",{"type":53,"value":219}," - Important lessons and implementation rules",{"type":47,"tag":89,"props":221,"children":222},{},[223,232],{"type":47,"tag":128,"props":224,"children":225},{},[226],{"type":47,"tag":175,"props":227,"children":229},{"href":228},"guidelines\u002F02_code_generation_rules.md",[230],{"type":53,"value":231},"02_code_generation_rules.md",{"type":53,"value":233}," - Specific code generation rules and patterns",{"type":47,"tag":89,"props":235,"children":236},{},[237,246],{"type":47,"tag":128,"props":238,"children":239},{},[240],{"type":47,"tag":175,"props":241,"children":243},{"href":242},"guidelines\u002F03_concepts.md",[244],{"type":53,"value":245},"03_concepts.md",{"type":53,"value":247}," - Core concepts: tile size restriction, memory operations, kernel fusion, default rules",{"type":47,"tag":62,"props":249,"children":251},{"id":250},"examples",[252],{"type":53,"value":253},"Examples",{"type":47,"tag":56,"props":255,"children":256},{},[257,259,264,266,272],{"type":53,"value":258},"Before starting any cuTile programming task, ",{"type":47,"tag":128,"props":260,"children":261},{},[262],{"type":53,"value":263},"always search for existing examples first",{"type":53,"value":265},". TileGym is the primary reference; the packaged ",{"type":47,"tag":195,"props":267,"children":269},{"className":268},[],[270],{"type":53,"value":271},"examples\u002F",{"type":53,"value":273}," directory complements it for ops TileGym does not yet cover (convolution, pooling, scan, GEMV, 4D matmul, split-k GEMM, group_norm).",{"type":47,"tag":56,"props":275,"children":276},{},[277],{"type":53,"value":278},"The skill supports two installation contexts:",{"type":47,"tag":85,"props":280,"children":281},{},[282,324],{"type":47,"tag":89,"props":283,"children":284},{},[285,290,292,298,300,306,308,314,316,322],{"type":47,"tag":128,"props":286,"children":287},{},[288],{"type":53,"value":289},"Inside a TileGym checkout",{"type":53,"value":291}," (",{"type":47,"tag":195,"props":293,"children":295},{"className":294},[],[296],{"type":53,"value":297},"\u003Crepo>\u002Fskills\u002Ftilegym-cutile-python\u002F",{"type":53,"value":299},", or ",{"type":47,"tag":195,"props":301,"children":303},{"className":302},[],[304],{"type":53,"value":305},"\u003Crepo>\u002F.agents\u002Fskills\u002Ftilegym-cutile-python\u002F",{"type":53,"value":307}," \u002F ",{"type":47,"tag":195,"props":309,"children":311},{"className":310},[],[312],{"type":53,"value":313},"\u003Crepo>\u002F.claude\u002Fskills\u002Ftilegym-cutile-python\u002F",{"type":53,"value":315}," via the backward-compat symlinks) — TileGym ops are at ",{"type":47,"tag":195,"props":317,"children":319},{"className":318},[],[320],{"type":53,"value":321},"\u003Crepo>\u002Fsrc\u002Ftilegym\u002Fops\u002Fcutile\u002F",{"type":53,"value":323},".",{"type":47,"tag":89,"props":325,"children":326},{},[327,332,334,340,342,348,350,356,358,364],{"type":47,"tag":128,"props":328,"children":329},{},[330],{"type":53,"value":331},"Installed elsewhere",{"type":53,"value":333}," (e.g. ",{"type":47,"tag":195,"props":335,"children":337},{"className":336},[],[338],{"type":53,"value":339},"~\u002F.agents\u002Fskills\u002Ftilegym-cutile-python\u002F",{"type":53,"value":341},", ",{"type":47,"tag":195,"props":343,"children":345},{"className":344},[],[346],{"type":53,"value":347},"~\u002F.claude\u002Fskills\u002Ftilegym-cutile-python\u002F",{"type":53,"value":349},", or inside a different repo) — clone TileGym once to ",{"type":47,"tag":195,"props":351,"children":353},{"className":352},[],[354],{"type":53,"value":355},"${TILEGYM_SKILL_CACHE_DIR:-~\u002F.cache\u002Ftilegym}\u002FTileGym",{"type":53,"value":357}," and use its ",{"type":47,"tag":195,"props":359,"children":361},{"className":360},[],[362],{"type":53,"value":363},"src\u002Ftilegym\u002Fops\u002Fcutile\u002F",{"type":53,"value":323},{"type":47,"tag":56,"props":366,"children":367},{},[368,370,378],{"type":53,"value":369},"See ",{"type":47,"tag":128,"props":371,"children":372},{},[373],{"type":47,"tag":175,"props":374,"children":376},{"href":375},"examples\u002Ftilegym_and_examples_guide.md",[377],{"type":53,"value":375},{"type":53,"value":379}," for the full search order, directory layout, and cache-vs-repo decision procedure.",{"type":47,"tag":62,"props":381,"children":383},{"id":382},"when-to-clarify-before-implementation",[384],{"type":53,"value":385},"When to Clarify Before Implementation",{"type":47,"tag":56,"props":387,"children":388},{},[389,391,396],{"type":53,"value":390},"For complex or ambiguous tasks, ",{"type":47,"tag":128,"props":392,"children":393},{},[394],{"type":53,"value":395},"present approach options to the user before coding",{"type":53,"value":397},". This prevents wasted effort on the wrong implementation.",{"type":47,"tag":399,"props":400,"children":402},"h3",{"id":401},"clarify-for-these-task-types",[403],{"type":53,"value":404},"Clarify for These Task Types",{"type":47,"tag":406,"props":407,"children":408},"table",{},[409,433],{"type":47,"tag":410,"props":411,"children":412},"thead",{},[413],{"type":47,"tag":414,"props":415,"children":416},"tr",{},[417,423,428],{"type":47,"tag":418,"props":419,"children":420},"th",{},[421],{"type":53,"value":422},"Task Type",{"type":47,"tag":418,"props":424,"children":425},{},[426],{"type":53,"value":427},"Why Clarify",{"type":47,"tag":418,"props":429,"children":430},{},[431],{"type":53,"value":432},"Example Questions",{"type":47,"tag":434,"props":435,"children":436},"tbody",{},[437,459,480,501,522],{"type":47,"tag":414,"props":438,"children":439},{},[440,449,454],{"type":47,"tag":441,"props":442,"children":443},"td",{},[444],{"type":47,"tag":128,"props":445,"children":446},{},[447],{"type":53,"value":448},"Optimization requests",{"type":47,"tag":441,"props":450,"children":451},{},[452],{"type":53,"value":453},"\"Make this faster\" has many paths",{"type":47,"tag":441,"props":455,"children":456},{},[457],{"type":53,"value":458},"Which bottleneck? Memory-bound vs compute-bound? Target speedup?",{"type":47,"tag":414,"props":460,"children":461},{},[462,470,475],{"type":47,"tag":441,"props":463,"children":464},{},[465],{"type":47,"tag":128,"props":466,"children":467},{},[468],{"type":53,"value":469},"Architecture changes",{"type":47,"tag":441,"props":471,"children":472},{},[473],{"type":53,"value":474},"Structural decisions affect everything",{"type":47,"tag":441,"props":476,"children":477},{},[478],{"type":53,"value":479},"Data parallel vs model parallel? Persistent kernel vs standard?",{"type":47,"tag":414,"props":481,"children":482},{},[483,491,496],{"type":47,"tag":441,"props":484,"children":485},{},[486],{"type":47,"tag":128,"props":487,"children":488},{},[489],{"type":53,"value":490},"Ambiguous operations",{"type":47,"tag":441,"props":492,"children":493},{},[494],{"type":53,"value":495},"Same name, different implementations",{"type":47,"tag":441,"props":497,"children":498},{},[499],{"type":53,"value":500},"Flash attention vs standard? Causal vs bidirectional? Grouped vs depthwise conv?",{"type":47,"tag":414,"props":502,"children":503},{},[504,512,517],{"type":47,"tag":441,"props":505,"children":506},{},[507],{"type":47,"tag":128,"props":508,"children":509},{},[510],{"type":53,"value":511},"Performance vs correctness tradeoffs",{"type":47,"tag":441,"props":513,"children":514},{},[515],{"type":53,"value":516},"User must choose",{"type":47,"tag":441,"props":518,"children":519},{},[520],{"type":53,"value":521},"Use TF32 for speed? Approximate math functions? Reduced precision accumulation?",{"type":47,"tag":414,"props":523,"children":524},{},[525,533,538],{"type":47,"tag":441,"props":526,"children":527},{},[528],{"type":47,"tag":128,"props":529,"children":530},{},[531],{"type":53,"value":532},"Missing constraints",{"type":47,"tag":441,"props":534,"children":535},{},[536],{"type":53,"value":537},"Can't optimize without targets",{"type":47,"tag":441,"props":539,"children":540},{},[541],{"type":53,"value":542},"Target tensor shapes? Batch size range? Memory budget?",{"type":47,"tag":399,"props":544,"children":546},{"id":545},"act-directly-for-these-task-types",[547],{"type":53,"value":548},"Act Directly for These Task Types",{"type":47,"tag":85,"props":550,"children":551},{},[552,562,572,582],{"type":47,"tag":89,"props":553,"children":554},{},[555,560],{"type":47,"tag":128,"props":556,"children":557},{},[558],{"type":53,"value":559},"Clear, specific requests",{"type":53,"value":561},": \"Write a ReLU kernel for shape (1024, 1024)\"",{"type":47,"tag":89,"props":563,"children":564},{},[565,570],{"type":47,"tag":128,"props":566,"children":567},{},[568],{"type":53,"value":569},"Bug fixes with reproduction",{"type":53,"value":571},": \"This kernel crashes on line 42\"",{"type":47,"tag":89,"props":573,"children":574},{},[575,580],{"type":47,"tag":128,"props":576,"children":577},{},[578],{"type":53,"value":579},"API questions",{"type":53,"value":581},": \"How do I use ct.gather?\"",{"type":47,"tag":89,"props":583,"children":584},{},[585,590],{"type":47,"tag":128,"props":586,"children":587},{},[588],{"type":53,"value":589},"Example adaptations",{"type":53,"value":591},": \"Adapt the TileGym softmax for my shapes\"",{"type":47,"tag":399,"props":593,"children":595},{"id":594},"how-to-clarify",[596],{"type":53,"value":597},"How to Clarify",{"type":47,"tag":56,"props":599,"children":600},{},[601],{"type":53,"value":602},"When clarification is needed:",{"type":47,"tag":604,"props":605,"children":606},"ol",{},[607,612,617,622],{"type":47,"tag":89,"props":608,"children":609},{},[610],{"type":53,"value":611},"Briefly explain why multiple approaches exist",{"type":47,"tag":89,"props":613,"children":614},{},[615],{"type":53,"value":616},"Present 2-3 concrete options with tradeoffs",{"type":47,"tag":89,"props":618,"children":619},{},[620],{"type":53,"value":621},"Recommend one option if there's a clear best choice",{"type":47,"tag":89,"props":623,"children":624},{},[625],{"type":53,"value":626},"Ask the user to choose before proceeding",{"type":47,"tag":56,"props":628,"children":629},{},[630],{"type":47,"tag":128,"props":631,"children":632},{},[633],{"type":53,"value":634},"Example:",{"type":47,"tag":636,"props":637,"children":641},"pre",{"className":638,"code":640,"language":53},[639],"language-text","Your request \"optimize this matmul\" could go several directions:\n\n1. **Persistent kernel** - Best for small matrices, faster, more complex code\n2. **Tile size tuning** - Moderate gains, minimal code changes\n3. **TMA prefetching** - Best for large matrices, requires Hopper+ GPU\n\nI recommend option 2 for a first pass. Which approach would you like?\n",[642],{"type":47,"tag":195,"props":643,"children":645},{"__ignoreMap":644},"",[646],{"type":53,"value":640},{"type":47,"tag":62,"props":648,"children":650},{"id":649},"complexity-assessment-simple-vs-orchestrated-workflow",[651],{"type":53,"value":652},"Complexity Assessment: Simple vs. Orchestrated Workflow",{"type":47,"tag":56,"props":654,"children":655},{},[656],{"type":53,"value":657},"Before starting implementation, assess the complexity of the request to choose the right workflow.",{"type":47,"tag":399,"props":659,"children":661},{"id":660},"use-the-simple-workflow-steps-0-6-below-when",[662],{"type":53,"value":663},"Use the Simple Workflow (Steps 0-6 below) when:",{"type":47,"tag":85,"props":665,"children":666},{},[667,672,677,682],{"type":47,"tag":89,"props":668,"children":669},{},[670],{"type":53,"value":671},"Single kernel task (e.g., ReLU, softmax, one matmul)",{"type":47,"tag":89,"props":673,"children":674},{},[675],{"type":53,"value":676},"Bug fix or optimization of an existing kernel",{"type":47,"tag":89,"props":678,"children":679},{},[680],{"type":53,"value":681},"API question or example adaptation",{"type":47,"tag":89,"props":683,"children":684},{},[685],{"type":53,"value":686},"Clear, single-operation request",{"type":47,"tag":399,"props":688,"children":690},{"id":689},"use-the-deep-agent-orchestration-workflow-when-any-of-these-apply",[691],{"type":53,"value":692},"Use the Deep Agent Orchestration Workflow when ANY of these apply:",{"type":47,"tag":85,"props":694,"children":695},{},[696,706,731,741,763],{"type":47,"tag":89,"props":697,"children":698},{},[699,704],{"type":47,"tag":128,"props":700,"children":701},{},[702],{"type":53,"value":703},"3+ distinct operations",{"type":53,"value":705}," that need separate kernels (e.g., \"implement a transformer block with attention, FFN, and layer norm\")",{"type":47,"tag":89,"props":707,"children":708},{},[709,714,716,722,723,729],{"type":47,"tag":128,"props":710,"children":711},{},[712],{"type":53,"value":713},"Multiple user-defined functions",{"type":53,"value":715}," in the input code (e.g., ",{"type":47,"tag":195,"props":717,"children":719},{"className":718},[],[720],{"type":53,"value":721},"custom_activation()",{"type":53,"value":341},{"type":47,"tag":195,"props":724,"children":726},{"className":725},[],[727],{"type":53,"value":728},"custom_norm()",{"type":53,"value":730},")",{"type":47,"tag":89,"props":732,"children":733},{},[734,739],{"type":47,"tag":128,"props":735,"children":736},{},[737],{"type":53,"value":738},"Inter-kernel data dependencies",{"type":53,"value":740}," where output of one kernel feeds into another",{"type":47,"tag":89,"props":742,"children":743},{},[744,755,757],{"type":47,"tag":128,"props":745,"children":746},{},[747,749],{"type":53,"value":748},"PyTorch ",{"type":47,"tag":195,"props":750,"children":752},{"className":751},[],[753],{"type":53,"value":754},"nn.Module",{"type":53,"value":756}," with multiple layers in ",{"type":47,"tag":195,"props":758,"children":760},{"className":759},[],[761],{"type":53,"value":762},"forward()",{"type":47,"tag":89,"props":764,"children":765},{},[766,771],{"type":47,"tag":128,"props":767,"children":768},{},[769],{"type":53,"value":770},"Explicit decomposition request",{"type":53,"value":772}," (e.g., \"break this into fused kernels\")",{"type":47,"tag":56,"props":774,"children":775},{},[776,778,783,785,790],{"type":53,"value":777},"When orchestration is needed, follow the ",{"type":47,"tag":128,"props":779,"children":780},{},[781],{"type":53,"value":782},"Deep Agent Orchestration Workflow",{"type":53,"value":784}," section. Otherwise, continue with the ",{"type":47,"tag":128,"props":786,"children":787},{},[788],{"type":53,"value":789},"Instructions",{"type":53,"value":791}," below.",{"type":47,"tag":62,"props":793,"children":795},{"id":794},"deep-agent-orchestration-workflow",[796],{"type":53,"value":782},{"type":47,"tag":56,"props":798,"children":799},{},[800,802,807,809,814],{"type":53,"value":801},"For complex tasks requiring 3+ kernels, inter-kernel dependencies, or multi-layer ",{"type":47,"tag":195,"props":803,"children":805},{"className":804},[],[806],{"type":53,"value":754},{"type":53,"value":808}," decomposition, use the orchestrated multi-agent pipeline. The main agent acts as an ",{"type":47,"tag":128,"props":810,"children":811},{},[812],{"type":53,"value":813},"orchestrator",{"type":53,"value":815}," (not a coder) — sub-agents handle reference reading and code generation.",{"type":47,"tag":56,"props":817,"children":818},{},[819,824],{"type":47,"tag":128,"props":820,"children":821},{},[822],{"type":53,"value":823},"Pipeline",{"type":53,"value":825},": Op Tracer (optional) → Analyzer → Kernel Agents (parallel) → Composer → Main Agent validates",{"type":47,"tag":56,"props":827,"children":828},{},[829,831,839],{"type":53,"value":830},"For the complete step-by-step workflow (Steps O-0 through O-4), prompt templates, and error handling, see ",{"type":47,"tag":128,"props":832,"children":833},{},[834],{"type":47,"tag":175,"props":835,"children":837},{"href":836},"orchestration\u002Fworkflow.md",[838],{"type":53,"value":836},{"type":53,"value":323},{"type":47,"tag":56,"props":841,"children":842},{},[843,845,853],{"type":53,"value":844},"For the orchestration architecture, agent hierarchy, and kernel spec format, see ",{"type":47,"tag":128,"props":846,"children":847},{},[848],{"type":47,"tag":175,"props":849,"children":851},{"href":850},"orchestration\u002Foverview.md",[852],{"type":53,"value":850},{"type":53,"value":323},{"type":47,"tag":855,"props":856,"children":857},"hr",{},[],{"type":47,"tag":62,"props":859,"children":861},{"id":860},"instructions",[862],{"type":53,"value":789},{"type":47,"tag":56,"props":864,"children":865},{},[866],{"type":53,"value":867},"Follow these steps when writing cuTile kernels (simple workflow for single-kernel tasks).",{"type":47,"tag":56,"props":869,"children":870},{},[871,876],{"type":47,"tag":128,"props":872,"children":873},{},[874],{"type":53,"value":875},"NOTE: Skip this entire section if using the Deep Agent Orchestration Workflow above.",{"type":53,"value":877}," The orchestration workflow has its own steps (O-0 through O-4). Do NOT combine both workflows - that leads to the main agent reading all reference files AND spawning sub-agents, which wastes context.",{"type":47,"tag":399,"props":879,"children":881},{"id":880},"step-0-search-examples-and-consult-references-mandatory",[882],{"type":53,"value":883},"Step 0: Search Examples and Consult References (MANDATORY)",{"type":47,"tag":56,"props":885,"children":886},{},[887,892],{"type":47,"tag":128,"props":888,"children":889},{},[890],{"type":53,"value":891},"Objective",{"type":53,"value":893},": Find existing examples and review relevant documentation",{"type":47,"tag":56,"props":895,"children":896},{},[897,902],{"type":47,"tag":128,"props":898,"children":899},{},[900],{"type":53,"value":901},"Example Search (Two-Step Strategy)",{"type":53,"value":903},":",{"type":47,"tag":604,"props":905,"children":906},{},[907,919,931],{"type":47,"tag":89,"props":908,"children":909},{},[910,912,917],{"type":53,"value":911},"Search TileGym (",{"type":47,"tag":195,"props":913,"children":915},{"className":914},[],[916],{"type":53,"value":363},{"type":53,"value":918},") first for similar cuTile kernel patterns.",{"type":47,"tag":89,"props":920,"children":921},{},[922,924,929],{"type":53,"value":923},"If TileGym has no match, search the packaged ",{"type":47,"tag":195,"props":925,"children":927},{"className":926},[],[928],{"type":53,"value":271},{"type":53,"value":930}," directory (part of this skill).",{"type":47,"tag":89,"props":932,"children":933},{},[934],{"type":53,"value":935},"Read relevant example files to understand implementation patterns.",{"type":47,"tag":56,"props":937,"children":938},{},[939,944],{"type":47,"tag":128,"props":940,"children":941},{},[942],{"type":53,"value":943},"Complex Algorithm Translation",{"type":53,"value":945}," (flash attention, fused ops, etc.):\nWhen implementing complex algorithms, follow this systematic approach:",{"type":47,"tag":604,"props":947,"children":948},{},[949,959,969],{"type":47,"tag":89,"props":950,"children":951},{},[952,957],{"type":47,"tag":128,"props":953,"children":954},{},[955],{"type":53,"value":956},"Analyze the PyTorch implementation",{"type":53,"value":958},": Understand the mathematical operations, data flow, key computational patterns, memory access patterns, and any special optimizations or constraints.",{"type":47,"tag":89,"props":960,"children":961},{},[962,967],{"type":47,"tag":128,"props":963,"children":964},{},[965],{"type":53,"value":966},"Study relevant cuTile examples",{"type":53,"value":968},": Review examples for similar operations — existing examples often provide the exact patterns you need. Copy and adapt working patterns rather than reinventing the wheel.",{"type":47,"tag":89,"props":970,"children":971},{},[972,977],{"type":47,"tag":128,"props":973,"children":974},{},[975],{"type":53,"value":976},"Implement the cuTile version",{"type":53,"value":978},": Map PyTorch operations to cuTile primitives, apply kernel fusion where appropriate, ensure proper tile indexing and memory management, and validate against the PyTorch reference.",{"type":47,"tag":56,"props":980,"children":981},{},[982,986],{"type":47,"tag":128,"props":983,"children":984},{},[985],{"type":53,"value":163},{"type":53,"value":903},{"type":47,"tag":85,"props":988,"children":989},{},[990,1004],{"type":47,"tag":89,"props":991,"children":992},{},[993,998,999],{"type":47,"tag":128,"props":994,"children":995},{},[996],{"type":53,"value":997},"Language Spec",{"type":53,"value":173},{"type":47,"tag":175,"props":1000,"children":1002},{"href":177,"rel":1001},[179],[1003],{"type":53,"value":177},{"type":47,"tag":89,"props":1005,"children":1006},{},[1007,1011,1012,1017],{"type":47,"tag":128,"props":1008,"children":1009},{},[1010],{"type":53,"value":191},{"type":53,"value":291},{"type":47,"tag":195,"props":1013,"children":1015},{"className":1014},[],[1016],{"type":53,"value":200},{"type":53,"value":1018}," 01–03) — Lessons, rules, and concepts",{"type":47,"tag":399,"props":1020,"children":1022},{"id":1021},"step-1-understand-the-problem",[1023],{"type":53,"value":1024},"Step 1: Understand the Problem",{"type":47,"tag":56,"props":1026,"children":1027},{},[1028,1032],{"type":47,"tag":128,"props":1029,"children":1030},{},[1031],{"type":53,"value":891},{"type":53,"value":1033},": Clearly define what the kernel needs to compute",{"type":47,"tag":85,"props":1035,"children":1036},{},[1037,1042,1047,1052],{"type":47,"tag":89,"props":1038,"children":1039},{},[1040],{"type":53,"value":1041},"Identify input\u002Foutput tensors and their shapes\u002Fdtypes",{"type":47,"tag":89,"props":1043,"children":1044},{},[1045],{"type":53,"value":1046},"Understand the mathematical operations required",{"type":47,"tag":89,"props":1048,"children":1049},{},[1050],{"type":53,"value":1051},"Determine data dependencies and computation flow",{"type":47,"tag":89,"props":1053,"children":1054},{},[1055],{"type":53,"value":1056},"Analyze memory access patterns for optimization opportunities",{"type":47,"tag":56,"props":1058,"children":1059},{},[1060],{"type":47,"tag":128,"props":1061,"children":1062},{},[1063],{"type":53,"value":1064},"Working with user-provided reference implementations:",{"type":47,"tag":604,"props":1066,"children":1067},{},[1068,1078,1088,1098],{"type":47,"tag":89,"props":1069,"children":1070},{},[1071,1076],{"type":47,"tag":128,"props":1072,"children":1073},{},[1074],{"type":53,"value":1075},"Preserve Reference Code",{"type":53,"value":1077},": Keep the original PyTorch reference implementation intact. Only remove code that is clearly redundant or unnecessary.",{"type":47,"tag":89,"props":1079,"children":1080},{},[1081,1086],{"type":47,"tag":128,"props":1082,"children":1083},{},[1084],{"type":53,"value":1085},"Conservative Approach",{"type":53,"value":1087},": Do not modify or rewrite the reference implementation unless explicitly required. The reference serves as the ground truth for correctness validation.",{"type":47,"tag":89,"props":1089,"children":1090},{},[1091,1096],{"type":47,"tag":128,"props":1092,"children":1093},{},[1094],{"type":53,"value":1095},"Seek Clarification",{"type":53,"value":1097},": If you are uncertain about the correctness or intent of any part of the reference code, ask the user for clarification before proceeding.",{"type":47,"tag":89,"props":1099,"children":1100},{},[1101,1106],{"type":47,"tag":128,"props":1102,"children":1103},{},[1104],{"type":53,"value":1105},"Maintain Functionality",{"type":53,"value":1107},": Any changes to the reference code must preserve the original functionality and behavior.",{"type":47,"tag":399,"props":1109,"children":1111},{"id":1110},"step-2-design-kernel-architecture",[1112],{"type":53,"value":1113},"Step 2: Design Kernel Architecture",{"type":47,"tag":56,"props":1115,"children":1116},{},[1117,1121],{"type":47,"tag":128,"props":1118,"children":1119},{},[1120],{"type":53,"value":891},{"type":53,"value":1122},": Plan the kernel structure",{"type":47,"tag":85,"props":1124,"children":1125},{},[1126,1131,1142,1153],{"type":47,"tag":89,"props":1127,"children":1128},{},[1129],{"type":53,"value":1130},"Determine optimal block\u002Ftile sizes for parallelization (consider multiples of 32)",{"type":47,"tag":89,"props":1132,"children":1133},{},[1134,1136],{"type":53,"value":1135},"Calculate grid dimensions based on tensor sizes using ",{"type":47,"tag":195,"props":1137,"children":1139},{"className":1138},[],[1140],{"type":53,"value":1141},"ct.cdiv(size, block)",{"type":47,"tag":89,"props":1143,"children":1144},{},[1145,1147],{"type":53,"value":1146},"Design block indexing strategy using ",{"type":47,"tag":195,"props":1148,"children":1150},{"className":1149},[],[1151],{"type":53,"value":1152},"ct.bid()",{"type":47,"tag":89,"props":1154,"children":1155},{},[1156],{"type":53,"value":1157},"Handle edge cases where tensor size is not divisible by block size",{"type":47,"tag":399,"props":1159,"children":1161},{"id":1160},"step-3-prepare-type-system-and-constants",[1162],{"type":53,"value":1163},"Step 3: Prepare Type System and Constants",{"type":47,"tag":56,"props":1165,"children":1166},{},[1167,1171],{"type":47,"tag":128,"props":1168,"children":1169},{},[1170],{"type":53,"value":891},{"type":53,"value":1172},": Ensure proper type annotations",{"type":47,"tag":85,"props":1174,"children":1175},{},[1176,1181,1194,1199],{"type":47,"tag":89,"props":1177,"children":1178},{},[1179],{"type":53,"value":1180},"Identify all constant values that need type annotations",{"type":47,"tag":89,"props":1182,"children":1183},{},[1184,1186,1192],{"type":53,"value":1185},"Add proper type annotations using ",{"type":47,"tag":195,"props":1187,"children":1189},{"className":1188},[],[1190],{"type":53,"value":1191},"ct.Constant[type]",{"type":53,"value":1193}," for all constants",{"type":47,"tag":89,"props":1195,"children":1196},{},[1197],{"type":53,"value":1198},"Choose appropriate cuTile dtypes (ct.float32, ct.float16, ct.int32, etc.)",{"type":47,"tag":89,"props":1200,"children":1201},{},[1202],{"type":53,"value":1203},"Ensure block sizes and other parameters are properly typed",{"type":47,"tag":399,"props":1205,"children":1207},{"id":1206},"step-4-implement-the-kernel",[1208],{"type":53,"value":1209},"Step 4: Implement the Kernel",{"type":47,"tag":56,"props":1211,"children":1212},{},[1213,1217],{"type":47,"tag":128,"props":1214,"children":1215},{},[1216],{"type":53,"value":891},{"type":53,"value":1218},": Write the cuTile kernel function",{"type":47,"tag":85,"props":1220,"children":1221},{},[1222,1235,1240,1252,1265,1270],{"type":47,"tag":89,"props":1223,"children":1224},{},[1225,1227,1233],{"type":53,"value":1226},"Create ",{"type":47,"tag":195,"props":1228,"children":1230},{"className":1229},[],[1231],{"type":53,"value":1232},"@ct.kernel",{"type":53,"value":1234}," decorated kernel function with proper signature",{"type":47,"tag":89,"props":1236,"children":1237},{},[1238],{"type":53,"value":1239},"Add required parameters (input tensors, output tensor, typed constants)",{"type":47,"tag":89,"props":1241,"children":1242},{},[1243,1245,1250],{"type":53,"value":1244},"Implement block indexing with appropriate ",{"type":47,"tag":195,"props":1246,"children":1248},{"className":1247},[],[1249],{"type":53,"value":1152},{"type":53,"value":1251}," calls",{"type":47,"tag":89,"props":1253,"children":1254},{},[1255,1257,1263],{"type":53,"value":1256},"Use ",{"type":47,"tag":195,"props":1258,"children":1260},{"className":1259},[],[1261],{"type":53,"value":1262},"ct.load()",{"type":53,"value":1264}," for input tensor access with proper indexing and tile shapes",{"type":47,"tag":89,"props":1266,"children":1267},{},[1268],{"type":53,"value":1269},"Perform operations on loaded tiles using cuTile tile operations",{"type":47,"tag":89,"props":1271,"children":1272},{},[1273,1274,1280],{"type":53,"value":1256},{"type":47,"tag":195,"props":1275,"children":1277},{"className":1276},[],[1278],{"type":53,"value":1279},"ct.store()",{"type":53,"value":1281}," for output tensor writing with correct indexing",{"type":47,"tag":399,"props":1283,"children":1285},{"id":1284},"step-5-prepare-and-launch",[1286],{"type":53,"value":1287},"Step 5: Prepare and Launch",{"type":47,"tag":56,"props":1289,"children":1290},{},[1291,1295],{"type":47,"tag":128,"props":1292,"children":1293},{},[1294],{"type":53,"value":891},{"type":53,"value":1296},": Set up tensor inputs and launch kernel",{"type":47,"tag":85,"props":1298,"children":1299},{},[1300,1319,1324,1337],{"type":47,"tag":89,"props":1301,"children":1302},{},[1303,1305,1311,1313],{"type":53,"value":1304},"Ensure all input tensors are on CUDA device using ",{"type":47,"tag":195,"props":1306,"children":1308},{"className":1307},[],[1309],{"type":53,"value":1310},".cuda()",{"type":53,"value":1312}," or ",{"type":47,"tag":195,"props":1314,"children":1316},{"className":1315},[],[1317],{"type":53,"value":1318},".to(\"cuda\")",{"type":47,"tag":89,"props":1320,"children":1321},{},[1322],{"type":53,"value":1323},"Verify tensor dtypes are compatible with cuTile",{"type":47,"tag":89,"props":1325,"children":1326},{},[1327,1329,1335],{"type":53,"value":1328},"Handle tensor contiguity requirements using ",{"type":47,"tag":195,"props":1330,"children":1332},{"className":1331},[],[1333],{"type":53,"value":1334},".contiguous()",{"type":53,"value":1336}," if needed",{"type":47,"tag":89,"props":1338,"children":1339},{},[1340],{"type":53,"value":1341},"Launch kernel with proper grid dimensions",{"type":47,"tag":399,"props":1343,"children":1345},{"id":1344},"step-6-validate-and-test",[1346],{"type":53,"value":1347},"Step 6: Validate and Test",{"type":47,"tag":56,"props":1349,"children":1350},{},[1351,1355],{"type":47,"tag":128,"props":1352,"children":1353},{},[1354],{"type":53,"value":891},{"type":53,"value":1356},": Ensure correctness",{"type":47,"tag":85,"props":1358,"children":1359},{},[1360,1365,1370,1375],{"type":47,"tag":89,"props":1361,"children":1362},{},[1363],{"type":53,"value":1364},"Verify kernel compiles without errors",{"type":47,"tag":89,"props":1366,"children":1367},{},[1368],{"type":53,"value":1369},"Test with various tensor sizes (aligned and unaligned to tile size)",{"type":47,"tag":89,"props":1371,"children":1372},{},[1373],{"type":53,"value":1374},"Validate results against reference implementation if available",{"type":47,"tag":89,"props":1376,"children":1377},{},[1378],{"type":53,"value":1379},"Check boundary conditions and edge cases",{"type":47,"tag":62,"props":1381,"children":1383},{"id":1382},"validation-loop-mandatory",[1384],{"type":53,"value":1385},"Validation Loop (MANDATORY)",{"type":47,"tag":56,"props":1387,"children":1388},{},[1389,1394],{"type":47,"tag":128,"props":1390,"children":1391},{},[1392],{"type":53,"value":1393},"IMPORTANT",{"type":53,"value":1395},": After generating cuTile code, you MUST execute it to verify correctness. Do not just write the file - run it and fix any issues.",{"type":47,"tag":399,"props":1397,"children":1399},{"id":1398},"validation-workflow",[1400],{"type":53,"value":1401},"Validation Workflow",{"type":47,"tag":636,"props":1403,"children":1406},{"className":1404,"code":1405,"language":53},[639],"┌─────────────────────────────────────────────────────────────┐\n│  1. Generate Code                                           │\n│     - Write cuTile kernel with inline validation to file    │\n│                                                             │\n│  2. Execute Code                                            │\n│     - Run: python \u003Cfilename>.py                             │\n│                                                             │\n│  3. Check Results                                           │\n│     ├─ Compilation error? → Fix syntax\u002Ftype issues → Retry  │\n│     ├─ Runtime error? → Fix kernel logic → Retry            │\n│     ├─ Validation FAIL? → Fix numerical issues → Retry      │\n│     └─ Validation PASS? → Done ✓                            │\n└─────────────────────────────────────────────────────────────┘\n",[1407],{"type":47,"tag":195,"props":1408,"children":1409},{"__ignoreMap":644},[1410],{"type":53,"value":1405},{"type":47,"tag":399,"props":1412,"children":1414},{"id":1413},"execution-steps",[1415],{"type":53,"value":1416},"Execution Steps",{"type":47,"tag":604,"props":1418,"children":1419},{},[1420,1438,1454,1512],{"type":47,"tag":89,"props":1421,"children":1422},{},[1423,1428,1430,1436],{"type":47,"tag":128,"props":1424,"children":1425},{},[1426],{"type":53,"value":1427},"Write the generated code",{"type":53,"value":1429}," to a ",{"type":47,"tag":195,"props":1431,"children":1433},{"className":1432},[],[1434],{"type":53,"value":1435},".py",{"type":53,"value":1437}," file",{"type":47,"tag":89,"props":1439,"children":1440},{},[1441,1446,1448],{"type":47,"tag":128,"props":1442,"children":1443},{},[1444],{"type":53,"value":1445},"Run the file",{"type":53,"value":1447}," using Bash: ",{"type":47,"tag":195,"props":1449,"children":1451},{"className":1450},[],[1452],{"type":53,"value":1453},"python \u003Cfilename>.py",{"type":47,"tag":89,"props":1455,"children":1456},{},[1457,1462,1464],{"type":47,"tag":128,"props":1458,"children":1459},{},[1460],{"type":53,"value":1461},"Analyze the output",{"type":53,"value":1463},":\n",{"type":47,"tag":85,"props":1465,"children":1466},{},[1467,1479,1490,1501],{"type":47,"tag":89,"props":1468,"children":1469},{},[1470,1472,1477],{"type":53,"value":1471},"If ",{"type":47,"tag":128,"props":1473,"children":1474},{},[1475],{"type":53,"value":1476},"compilation error",{"type":53,"value":1478},": Read error message, fix the code (check type annotations, syntax, API usage)",{"type":47,"tag":89,"props":1480,"children":1481},{},[1482,1483,1488],{"type":53,"value":1471},{"type":47,"tag":128,"props":1484,"children":1485},{},[1486],{"type":53,"value":1487},"runtime error",{"type":53,"value":1489},": Check tensor shapes, grid dimensions, memory access patterns",{"type":47,"tag":89,"props":1491,"children":1492},{},[1493,1494,1499],{"type":53,"value":1471},{"type":47,"tag":128,"props":1495,"children":1496},{},[1497],{"type":53,"value":1498},"validation FAIL",{"type":53,"value":1500},": Check numerical differences, tolerances, algorithm correctness",{"type":47,"tag":89,"props":1502,"children":1503},{},[1504,1505,1510],{"type":53,"value":1471},{"type":47,"tag":128,"props":1506,"children":1507},{},[1508],{"type":53,"value":1509},"validation PASS",{"type":53,"value":1511},": Report success to user",{"type":47,"tag":89,"props":1513,"children":1514},{},[1515,1520],{"type":47,"tag":128,"props":1516,"children":1517},{},[1518],{"type":53,"value":1519},"Iterate until PASS",{"type":53,"value":1521},": Fix issues and re-run until validation passes (max 3 attempts)",{"type":47,"tag":399,"props":1523,"children":1525},{"id":1524},"validation-output-best-practices",[1526],{"type":53,"value":1527},"Validation Output Best Practices",{"type":47,"tag":85,"props":1529,"children":1530},{},[1531,1541,1551],{"type":47,"tag":89,"props":1532,"children":1533},{},[1534,1539],{"type":47,"tag":128,"props":1535,"children":1536},{},[1537],{"type":53,"value":1538},"Don't print large tensors",{"type":53,"value":1540}," - Only print tensor contents when validation fails",{"type":47,"tag":89,"props":1542,"children":1543},{},[1544,1549],{"type":47,"tag":128,"props":1545,"children":1546},{},[1547],{"type":53,"value":1548},"Print summary stats",{"type":53,"value":1550}," - Show PASS\u002FFAIL, max difference, tensor shape",{"type":47,"tag":89,"props":1552,"children":1553},{},[1554,1559,1560],{"type":47,"tag":128,"props":1555,"children":1556},{},[1557],{"type":53,"value":1558},"Example validation pattern",{"type":53,"value":1463},{"type":47,"tag":636,"props":1561,"children":1564},{"className":1562,"code":1563,"language":19,"meta":644,"style":644},"language-python shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","is_close = torch.allclose(cutile_output, reference_output, atol=1e-3, rtol=1e-3)\nif is_close:\n    print(\"✓ Validation PASSED\")\nelse:\n    max_diff = (cutile_output - reference_output).abs().max().item()\n    print(f\"✗ Validation FAILED - max diff: {max_diff}\")\n    print(f\"  Expected: {reference_output}\")\n    print(f\"  Got:      {cutile_output}\")\n",[1565],{"type":47,"tag":195,"props":1566,"children":1567},{"__ignoreMap":644},[1568,1579,1588,1597,1606,1615,1624,1633],{"type":47,"tag":1569,"props":1570,"children":1573},"span",{"class":1571,"line":1572},"line",1,[1574],{"type":47,"tag":1569,"props":1575,"children":1576},{},[1577],{"type":53,"value":1578},"is_close = torch.allclose(cutile_output, reference_output, atol=1e-3, rtol=1e-3)\n",{"type":47,"tag":1569,"props":1580,"children":1582},{"class":1571,"line":1581},2,[1583],{"type":47,"tag":1569,"props":1584,"children":1585},{},[1586],{"type":53,"value":1587},"if is_close:\n",{"type":47,"tag":1569,"props":1589,"children":1591},{"class":1571,"line":1590},3,[1592],{"type":47,"tag":1569,"props":1593,"children":1594},{},[1595],{"type":53,"value":1596},"    print(\"✓ Validation PASSED\")\n",{"type":47,"tag":1569,"props":1598,"children":1600},{"class":1571,"line":1599},4,[1601],{"type":47,"tag":1569,"props":1602,"children":1603},{},[1604],{"type":53,"value":1605},"else:\n",{"type":47,"tag":1569,"props":1607,"children":1609},{"class":1571,"line":1608},5,[1610],{"type":47,"tag":1569,"props":1611,"children":1612},{},[1613],{"type":53,"value":1614},"    max_diff = (cutile_output - reference_output).abs().max().item()\n",{"type":47,"tag":1569,"props":1616,"children":1618},{"class":1571,"line":1617},6,[1619],{"type":47,"tag":1569,"props":1620,"children":1621},{},[1622],{"type":53,"value":1623},"    print(f\"✗ Validation FAILED - max diff: {max_diff}\")\n",{"type":47,"tag":1569,"props":1625,"children":1627},{"class":1571,"line":1626},7,[1628],{"type":47,"tag":1569,"props":1629,"children":1630},{},[1631],{"type":53,"value":1632},"    print(f\"  Expected: {reference_output}\")\n",{"type":47,"tag":1569,"props":1634,"children":1636},{"class":1571,"line":1635},8,[1637],{"type":47,"tag":1569,"props":1638,"children":1639},{},[1640],{"type":53,"value":1641},"    print(f\"  Got:      {cutile_output}\")\n",{"type":47,"tag":399,"props":1643,"children":1645},{"id":1644},"common-issues-and-fixes",[1646],{"type":53,"value":1647},"Common Issues and Fixes",{"type":47,"tag":406,"props":1649,"children":1650},{},[1651,1672],{"type":47,"tag":410,"props":1652,"children":1653},{},[1654],{"type":47,"tag":414,"props":1655,"children":1656},{},[1657,1662,1667],{"type":47,"tag":418,"props":1658,"children":1659},{},[1660],{"type":53,"value":1661},"Error Type",{"type":47,"tag":418,"props":1663,"children":1664},{},[1665],{"type":53,"value":1666},"Typical Cause",{"type":47,"tag":418,"props":1668,"children":1669},{},[1670],{"type":53,"value":1671},"Fix",{"type":47,"tag":434,"props":1673,"children":1674},{},[1675,1703,1730,1767],{"type":47,"tag":414,"props":1676,"children":1677},{},[1678,1687,1698],{"type":47,"tag":441,"props":1679,"children":1680},{},[1681],{"type":47,"tag":195,"props":1682,"children":1684},{"className":1683},[],[1685],{"type":53,"value":1686},"TypeError: missing Constant annotation",{"type":47,"tag":441,"props":1688,"children":1689},{},[1690,1692],{"type":53,"value":1691},"Missing ",{"type":47,"tag":195,"props":1693,"children":1695},{"className":1694},[],[1696],{"type":53,"value":1697},"ct.Constant[int]",{"type":47,"tag":441,"props":1699,"children":1700},{},[1701],{"type":53,"value":1702},"Add type annotation to all constants",{"type":47,"tag":414,"props":1704,"children":1705},{},[1706,1715,1720],{"type":47,"tag":441,"props":1707,"children":1708},{},[1709],{"type":47,"tag":195,"props":1710,"children":1712},{"className":1711},[],[1713],{"type":53,"value":1714},"ValueError: tile dimension not power of 2",{"type":47,"tag":441,"props":1716,"children":1717},{},[1718],{"type":53,"value":1719},"Non-power-of-2 tile size",{"type":47,"tag":441,"props":1721,"children":1722},{},[1723,1724],{"type":53,"value":1256},{"type":47,"tag":195,"props":1725,"children":1727},{"className":1726},[],[1728],{"type":53,"value":1729},"2**((size-1).bit_length())",{"type":47,"tag":414,"props":1731,"children":1732},{},[1733,1749,1754],{"type":47,"tag":441,"props":1734,"children":1735},{},[1736,1742,1743],{"type":47,"tag":195,"props":1737,"children":1739},{"className":1738},[],[1740],{"type":53,"value":1741},"IndexError",{"type":53,"value":307},{"type":47,"tag":195,"props":1744,"children":1746},{"className":1745},[],[1747],{"type":53,"value":1748},"CUDA error",{"type":47,"tag":441,"props":1750,"children":1751},{},[1752],{"type":53,"value":1753},"Wrong grid dimensions or indices",{"type":47,"tag":441,"props":1755,"children":1756},{},[1757,1759,1765],{"type":53,"value":1758},"Check ",{"type":47,"tag":195,"props":1760,"children":1762},{"className":1761},[],[1763],{"type":53,"value":1764},"ct.cdiv",{"type":53,"value":1766}," usage, tile vs element indices",{"type":47,"tag":414,"props":1768,"children":1769},{},[1770,1779,1784],{"type":47,"tag":441,"props":1771,"children":1772},{},[1773],{"type":47,"tag":195,"props":1774,"children":1776},{"className":1775},[],[1777],{"type":53,"value":1778},"Validation FAIL: max diff = X",{"type":47,"tag":441,"props":1780,"children":1781},{},[1782],{"type":53,"value":1783},"Numerical mismatch",{"type":47,"tag":441,"props":1785,"children":1786},{},[1787],{"type":53,"value":1788},"Check algorithm, increase tolerance, or fix logic",{"type":47,"tag":399,"props":1790,"children":1792},{"id":1791},"default-tolerance-values",[1793],{"type":53,"value":1794},"Default Tolerance Values",{"type":47,"tag":56,"props":1796,"children":1797},{},[1798,1799,1804],{"type":53,"value":369},{"type":47,"tag":195,"props":1800,"children":1802},{"className":1801},[],[1803],{"type":53,"value":242},{"type":53,"value":1805}," → \"Default Rules When User Does Not Specify\" for tolerance values, default dtypes, and default tensor shapes.",{"type":47,"tag":399,"props":1807,"children":1809},{"id":1808},"testing-checklist",[1810],{"type":53,"value":1811},"Testing Checklist",{"type":47,"tag":85,"props":1813,"children":1814},{},[1815,1820,1825,1830,1835],{"type":47,"tag":89,"props":1816,"children":1817},{},[1818],{"type":53,"value":1819},"✓ Verify cuTile output matches reference implementation within tolerance",{"type":47,"tag":89,"props":1821,"children":1822},{},[1823],{"type":53,"value":1824},"✓ Test with various tensor sizes (aligned and unaligned to tile size)",{"type":47,"tag":89,"props":1826,"children":1827},{},[1828],{"type":53,"value":1829},"✓ Test boundary conditions and edge cases",{"type":47,"tag":89,"props":1831,"children":1832},{},[1833],{"type":53,"value":1834},"✓ Ensure all tensors are on CUDA device before kernel launch",{"type":47,"tag":89,"props":1836,"children":1837},{},[1838],{"type":53,"value":1839},"✓ Verify dtype consistency across inputs and outputs",{"type":47,"tag":62,"props":1841,"children":1843},{"id":1842},"critical-requirements",[1844],{"type":53,"value":1845},"Critical Requirements",{"type":47,"tag":56,"props":1847,"children":1848},{},[1849],{"type":47,"tag":128,"props":1850,"children":1851},{},[1852],{"type":53,"value":1853},"Four essential requirements for all cuTile kernels:",{"type":47,"tag":604,"props":1855,"children":1856},{},[1857,2118,2143,2160],{"type":47,"tag":89,"props":1858,"children":1859},{},[1860,1865,1867,1872,1874,1880,1882,1887,1889,1895,1897,1903,1904,1910,1911,1917,1919,1925,1926,1932,1934],{"type":47,"tag":128,"props":1861,"children":1862},{},[1863],{"type":53,"value":1864},"Pure cuTile forward path",{"type":53,"value":1866},": Every compute op in ",{"type":47,"tag":195,"props":1868,"children":1870},{"className":1869},[],[1871],{"type":53,"value":762},{"type":53,"value":1873},"\u002F",{"type":47,"tag":195,"props":1875,"children":1877},{"className":1876},[],[1878],{"type":53,"value":1879},"composed_function()",{"type":53,"value":1881}," must go through ",{"type":47,"tag":195,"props":1883,"children":1885},{"className":1884},[],[1886],{"type":53,"value":1232},{"type":53,"value":1888}," + ",{"type":47,"tag":195,"props":1890,"children":1892},{"className":1891},[],[1893],{"type":53,"value":1894},"ct.launch",{"type":53,"value":1896},". Do not call ",{"type":47,"tag":195,"props":1898,"children":1900},{"className":1899},[],[1901],{"type":53,"value":1902},"nn.Conv2d()(x)",{"type":53,"value":341},{"type":47,"tag":195,"props":1905,"children":1907},{"className":1906},[],[1908],{"type":53,"value":1909},"F.conv2d(x, w)",{"type":53,"value":341},{"type":47,"tag":195,"props":1912,"children":1914},{"className":1913},[],[1915],{"type":53,"value":1916},"F.linear(x, w)",{"type":53,"value":1918},", or any other ",{"type":47,"tag":195,"props":1920,"children":1922},{"className":1921},[],[1923],{"type":53,"value":1924},"nn.*",{"type":53,"value":1873},{"type":47,"tag":195,"props":1927,"children":1929},{"className":1928},[],[1930],{"type":53,"value":1931},"F.*",{"type":53,"value":1933}," compute op as a runtime operation in the forward path.\n",{"type":47,"tag":85,"props":1935,"children":1936},{},[1937,2040,2106],{"type":47,"tag":89,"props":1938,"children":1939},{},[1940,1950,1952,1958,1959,1965,1966,1972,1974,1980,1981,1987,1988,1994,1995,2001,2003,2009,2010,2016,2018,2024,2025,2031,2032,2038],{"type":47,"tag":128,"props":1941,"children":1942},{},[1943,1945],{"type":53,"value":1944},"Permitted in ",{"type":47,"tag":195,"props":1946,"children":1948},{"className":1947},[],[1949],{"type":53,"value":762},{"type":53,"value":1951},": ",{"type":47,"tag":195,"props":1953,"children":1955},{"className":1954},[],[1956],{"type":53,"value":1957},"torch.empty",{"type":53,"value":341},{"type":47,"tag":195,"props":1960,"children":1962},{"className":1961},[],[1963],{"type":53,"value":1964},"torch.zeros",{"type":53,"value":341},{"type":47,"tag":195,"props":1967,"children":1969},{"className":1968},[],[1970],{"type":53,"value":1971},"torch.ones",{"type":53,"value":1973}," (allocation); ",{"type":47,"tag":195,"props":1975,"children":1977},{"className":1976},[],[1978],{"type":53,"value":1979},"tensor.reshape",{"type":53,"value":341},{"type":47,"tag":195,"props":1982,"children":1984},{"className":1983},[],[1985],{"type":53,"value":1986},"tensor.view",{"type":53,"value":341},{"type":47,"tag":195,"props":1989,"children":1991},{"className":1990},[],[1992],{"type":53,"value":1993},"tensor.permute",{"type":53,"value":341},{"type":47,"tag":195,"props":1996,"children":1998},{"className":1997},[],[1999],{"type":53,"value":2000},"tensor.contiguous",{"type":53,"value":2002}," (rearrangement); ",{"type":47,"tag":195,"props":2004,"children":2006},{"className":2005},[],[2007],{"type":53,"value":2008},"torch.cat",{"type":53,"value":341},{"type":47,"tag":195,"props":2011,"children":2013},{"className":2012},[],[2014],{"type":53,"value":2015},"torch.stack",{"type":53,"value":2017}," (concatenation); ",{"type":47,"tag":195,"props":2019,"children":2021},{"className":2020},[],[2022],{"type":53,"value":2023},"torch.sqrt",{"type":53,"value":341},{"type":47,"tag":195,"props":2026,"children":2028},{"className":2027},[],[2029],{"type":53,"value":2030},".sum()",{"type":53,"value":341},{"type":47,"tag":195,"props":2033,"children":2035},{"className":2034},[],[2036],{"type":53,"value":2037},".mean()",{"type":53,"value":2039}," (simple scalar ops between kernel launches).",{"type":47,"tag":89,"props":2041,"children":2042},{},[2043,2053,2055,2061,2062,2068,2070,2075,2077,2082,2084,2090,2092,2097,2099,2105],{"type":47,"tag":128,"props":2044,"children":2045},{},[2046,2047],{"type":53,"value":1944},{"type":47,"tag":195,"props":2048,"children":2050},{"className":2049},[],[2051],{"type":53,"value":2052},"__init__()",{"type":53,"value":2054},": Using ",{"type":47,"tag":195,"props":2056,"children":2058},{"className":2057},[],[2059],{"type":53,"value":2060},"nn.Conv2d",{"type":53,"value":341},{"type":47,"tag":195,"props":2063,"children":2065},{"className":2064},[],[2066],{"type":53,"value":2067},"nn.Linear",{"type":53,"value":2069},", etc. solely for ",{"type":47,"tag":128,"props":2071,"children":2072},{},[2073],{"type":53,"value":2074},"weight initialization and storage",{"type":53,"value":2076}," is fine — as long as ",{"type":47,"tag":195,"props":2078,"children":2080},{"className":2079},[],[2081],{"type":53,"value":762},{"type":53,"value":2083}," extracts the weights (e.g., ",{"type":47,"tag":195,"props":2085,"children":2087},{"className":2086},[],[2088],{"type":53,"value":2089},"self.conv.weight.data",{"type":53,"value":2091},") and passes them to ",{"type":47,"tag":195,"props":2093,"children":2095},{"className":2094},[],[2096],{"type":53,"value":1894},{"type":53,"value":2098}," instead of calling ",{"type":47,"tag":195,"props":2100,"children":2102},{"className":2101},[],[2103],{"type":53,"value":2104},"self.conv(x)",{"type":53,"value":323},{"type":47,"tag":89,"props":2107,"children":2108},{},[2109,2111,2116],{"type":53,"value":2110},"See Rule 15 and Rule 17 in ",{"type":47,"tag":195,"props":2112,"children":2114},{"className":2113},[],[2115],{"type":53,"value":228},{"type":53,"value":2117}," for common violations and detailed examples.",{"type":47,"tag":89,"props":2119,"children":2120},{},[2121,2126,2127,2133,2135,2141],{"type":47,"tag":128,"props":2122,"children":2123},{},[2124],{"type":53,"value":2125},"Tile indices, not element indices",{"type":53,"value":1951},{"type":47,"tag":195,"props":2128,"children":2130},{"className":2129},[],[2131],{"type":53,"value":2132},"ct.load(A, index=(bid_m, k), shape=(BLOCK_M, K))",{"type":53,"value":2134}," ✅ not ",{"type":47,"tag":195,"props":2136,"children":2138},{"className":2137},[],[2139],{"type":53,"value":2140},"(bid_m * BLOCK_M, k)",{"type":53,"value":2142}," ❌",{"type":47,"tag":89,"props":2144,"children":2145},{},[2146,2151,2153,2158],{"type":47,"tag":128,"props":2147,"children":2148},{},[2149],{"type":53,"value":2150},"All tile dimensions must be powers of 2",{"type":53,"value":2152},": Use ",{"type":47,"tag":195,"props":2154,"children":2156},{"className":2155},[],[2157],{"type":53,"value":1729},{"type":53,"value":2159}," to round up",{"type":47,"tag":89,"props":2161,"children":2162},{},[2163,2168,2169,2175],{"type":47,"tag":128,"props":2164,"children":2165},{},[2166],{"type":53,"value":2167},"All constants need type annotations",{"type":53,"value":1951},{"type":47,"tag":195,"props":2170,"children":2172},{"className":2171},[],[2173],{"type":53,"value":2174},"BLOCK: ct.Constant[int]",{"type":53,"value":2176}," is required for compilation",{"type":47,"tag":56,"props":2178,"children":2179},{},[2180,2182,2187],{"type":53,"value":2181},"For detailed guidelines on memory operations, tile sizing, common pitfalls, and optimization strategies, see the ",{"type":47,"tag":195,"props":2183,"children":2185},{"className":2184},[],[2186],{"type":53,"value":200},{"type":53,"value":2188}," directory (01–03).",{"type":47,"tag":62,"props":2190,"children":2192},{"id":2191},"performance-optimization",[2193],{"type":53,"value":2194},"Performance Optimization",{"type":47,"tag":56,"props":2196,"children":2197},{},[2198,2200,2205],{"type":53,"value":2199},"Key principle: Think in ",{"type":47,"tag":128,"props":2201,"children":2202},{},[2203],{"type":53,"value":2204},"blocks of data",{"type":53,"value":2206}," rather than individual elements. Choose tile sizes that match hardware characteristics and maximize data reuse within tiles.",{"type":47,"tag":62,"props":2208,"children":2210},{"id":2209},"file-management-guidelines",[2211],{"type":53,"value":2212},"File Management Guidelines",{"type":47,"tag":56,"props":2214,"children":2215},{},[2216,2220],{"type":47,"tag":128,"props":2217,"children":2218},{},[2219],{"type":53,"value":1393},{"type":53,"value":2221},": Follow these rules for file creation:",{"type":47,"tag":604,"props":2223,"children":2224},{},[2225,2242,2252,2262,2272,2282,2329],{"type":47,"tag":89,"props":2226,"children":2227},{},[2228,2233,2235,2240],{"type":47,"tag":128,"props":2229,"children":2230},{},[2231],{"type":53,"value":2232},"Single file by default",{"type":53,"value":2234},": Generate a single ",{"type":47,"tag":195,"props":2236,"children":2238},{"className":2237},[],[2239],{"type":53,"value":1435},{"type":53,"value":2241}," file containing the kernel, validation, and test code unless the user explicitly requests multiple files",{"type":47,"tag":89,"props":2243,"children":2244},{},[2245,2250],{"type":47,"tag":128,"props":2246,"children":2247},{},[2248],{"type":53,"value":2249},"No documentation files",{"type":53,"value":2251},": Do NOT create README.md, documentation files, or separate example files unless explicitly requested",{"type":47,"tag":89,"props":2253,"children":2254},{},[2255,2260],{"type":47,"tag":128,"props":2256,"children":2257},{},[2258],{"type":53,"value":2259},"Inline everything",{"type":53,"value":2261},": Include the kernel implementation, validation logic, and test code in one cohesive file",{"type":47,"tag":89,"props":2263,"children":2264},{},[2265,2270],{"type":47,"tag":128,"props":2266,"children":2267},{},[2268],{"type":53,"value":2269},"Minimal file creation",{"type":53,"value":2271},": Only create what is absolutely necessary - prefer editing existing files over creating new ones",{"type":47,"tag":89,"props":2273,"children":2274},{},[2275,2280],{"type":47,"tag":128,"props":2276,"children":2277},{},[2278],{"type":53,"value":2279},"No source citations",{"type":53,"value":2281},": Do NOT include comments or docstrings mentioning TileGym files, reference files, or sources. The code should stand on its own without attribution",{"type":47,"tag":89,"props":2283,"children":2284},{},[2285,2290,2292,2297,2299,2304,2306,2312,2314,2319,2321,2327],{"type":47,"tag":128,"props":2286,"children":2287},{},[2288],{"type":53,"value":2289},"Output to current working directory",{"type":53,"value":2291},": All output ",{"type":47,"tag":195,"props":2293,"children":2295},{"className":2294},[],[2296],{"type":53,"value":1435},{"type":53,"value":2298}," files must be written to the ",{"type":47,"tag":128,"props":2300,"children":2301},{},[2302],{"type":53,"value":2303},"current working directory",{"type":53,"value":2305}," where the user started the coding assistant. Run ",{"type":47,"tag":195,"props":2307,"children":2309},{"className":2308},[],[2310],{"type":53,"value":2311},"pwd",{"type":53,"value":2313}," at the start of the task. All generated ",{"type":47,"tag":195,"props":2315,"children":2317},{"className":2316},[],[2318],{"type":53,"value":1435},{"type":53,"value":2320}," files go directly in that directory (e.g. ",{"type":47,"tag":195,"props":2322,"children":2324},{"className":2323},[],[2325],{"type":53,"value":2326},".\u002Fcomposed_foo.py",{"type":53,"value":2328},"), never in a subdirectory of the skill.",{"type":47,"tag":89,"props":2330,"children":2331},{},[2332,2337,2338,2344,2346,2351,2353,2359,2360,2366],{"type":47,"tag":128,"props":2333,"children":2334},{},[2335],{"type":53,"value":2336},"Skill directory is read-only",{"type":53,"value":1951},{"type":47,"tag":195,"props":2339,"children":2341},{"className":2340},[],[2342],{"type":53,"value":2343},"\u003Cskill_dir>",{"type":53,"value":2345}," is passed to sub-agents solely so they can read references, examples, and orchestration instructions. No agent — main or sub — may ever write, create, or save any file under ",{"type":47,"tag":195,"props":2347,"children":2349},{"className":2348},[],[2350],{"type":53,"value":2343},{"type":53,"value":2352},". Use it only with read tools (Read, Glob, Grep, Bash ",{"type":47,"tag":195,"props":2354,"children":2356},{"className":2355},[],[2357],{"type":53,"value":2358},"cat",{"type":53,"value":1873},{"type":47,"tag":195,"props":2361,"children":2363},{"className":2362},[],[2364],{"type":53,"value":2365},"grep",{"type":53,"value":2367},"). Never pass it to Write, Edit, or any file-creating command.",{"type":47,"tag":56,"props":2369,"children":2370},{},[2371,2376],{"type":47,"tag":128,"props":2372,"children":2373},{},[2374],{"type":53,"value":2375},"Example structure for a single file",{"type":53,"value":903},{"type":47,"tag":636,"props":2378,"children":2380},{"className":1562,"code":2379,"language":19,"meta":644,"style":644},"import cuda.tile as ct\nimport torch\n\n# Kernel implementation\n@ct.kernel\ndef my_kernel(...):\n    ...\n\n# Validation function (if needed)\ndef validate(...):\n    ...\n\n# Test\u002Fdemo code at bottom\nif __name__ == \"__main__\":\n    # Test the kernel\n    ...\n",[2381],{"type":47,"tag":195,"props":2382,"children":2383},{"__ignoreMap":644},[2384,2392,2400,2409,2417,2425,2433,2441,2448,2457,2466,2474,2482,2491,2500,2509],{"type":47,"tag":1569,"props":2385,"children":2386},{"class":1571,"line":1572},[2387],{"type":47,"tag":1569,"props":2388,"children":2389},{},[2390],{"type":53,"value":2391},"import cuda.tile as ct\n",{"type":47,"tag":1569,"props":2393,"children":2394},{"class":1571,"line":1581},[2395],{"type":47,"tag":1569,"props":2396,"children":2397},{},[2398],{"type":53,"value":2399},"import torch\n",{"type":47,"tag":1569,"props":2401,"children":2402},{"class":1571,"line":1590},[2403],{"type":47,"tag":1569,"props":2404,"children":2406},{"emptyLinePlaceholder":2405},true,[2407],{"type":53,"value":2408},"\n",{"type":47,"tag":1569,"props":2410,"children":2411},{"class":1571,"line":1599},[2412],{"type":47,"tag":1569,"props":2413,"children":2414},{},[2415],{"type":53,"value":2416},"# Kernel implementation\n",{"type":47,"tag":1569,"props":2418,"children":2419},{"class":1571,"line":1608},[2420],{"type":47,"tag":1569,"props":2421,"children":2422},{},[2423],{"type":53,"value":2424},"@ct.kernel\n",{"type":47,"tag":1569,"props":2426,"children":2427},{"class":1571,"line":1617},[2428],{"type":47,"tag":1569,"props":2429,"children":2430},{},[2431],{"type":53,"value":2432},"def my_kernel(...):\n",{"type":47,"tag":1569,"props":2434,"children":2435},{"class":1571,"line":1626},[2436],{"type":47,"tag":1569,"props":2437,"children":2438},{},[2439],{"type":53,"value":2440},"    ...\n",{"type":47,"tag":1569,"props":2442,"children":2443},{"class":1571,"line":1635},[2444],{"type":47,"tag":1569,"props":2445,"children":2446},{"emptyLinePlaceholder":2405},[2447],{"type":53,"value":2408},{"type":47,"tag":1569,"props":2449,"children":2451},{"class":1571,"line":2450},9,[2452],{"type":47,"tag":1569,"props":2453,"children":2454},{},[2455],{"type":53,"value":2456},"# Validation function (if needed)\n",{"type":47,"tag":1569,"props":2458,"children":2460},{"class":1571,"line":2459},10,[2461],{"type":47,"tag":1569,"props":2462,"children":2463},{},[2464],{"type":53,"value":2465},"def validate(...):\n",{"type":47,"tag":1569,"props":2467,"children":2469},{"class":1571,"line":2468},11,[2470],{"type":47,"tag":1569,"props":2471,"children":2472},{},[2473],{"type":53,"value":2440},{"type":47,"tag":1569,"props":2475,"children":2477},{"class":1571,"line":2476},12,[2478],{"type":47,"tag":1569,"props":2479,"children":2480},{"emptyLinePlaceholder":2405},[2481],{"type":53,"value":2408},{"type":47,"tag":1569,"props":2483,"children":2485},{"class":1571,"line":2484},13,[2486],{"type":47,"tag":1569,"props":2487,"children":2488},{},[2489],{"type":53,"value":2490},"# Test\u002Fdemo code at bottom\n",{"type":47,"tag":1569,"props":2492,"children":2494},{"class":1571,"line":2493},14,[2495],{"type":47,"tag":1569,"props":2496,"children":2497},{},[2498],{"type":53,"value":2499},"if __name__ == \"__main__\":\n",{"type":47,"tag":1569,"props":2501,"children":2503},{"class":1571,"line":2502},15,[2504],{"type":47,"tag":1569,"props":2505,"children":2506},{},[2507],{"type":53,"value":2508},"    # Test the kernel\n",{"type":47,"tag":1569,"props":2510,"children":2512},{"class":1571,"line":2511},16,[2513],{"type":47,"tag":1569,"props":2514,"children":2515},{},[2516],{"type":53,"value":2440},{"type":47,"tag":62,"props":2518,"children":2520},{"id":2519},"success-criteria",[2521],{"type":53,"value":2522},"Success Criteria",{"type":47,"tag":56,"props":2524,"children":2525},{},[2526],{"type":53,"value":2527},"Your implementation is successful when:",{"type":47,"tag":604,"props":2529,"children":2530},{},[2531,2583,2588,2600,2605,2610,2615,2620,2625,2630,2635],{"type":47,"tag":89,"props":2532,"children":2533},{},[2534,2536,2540,2542,2547,2548,2553,2555,2560,2561,2566,2568,2573,2575,2581],{"type":53,"value":2535},"✅ ",{"type":47,"tag":128,"props":2537,"children":2538},{},[2539],{"type":53,"value":1864},{"type":53,"value":2541},": No ",{"type":47,"tag":195,"props":2543,"children":2545},{"className":2544},[],[2546],{"type":53,"value":1924},{"type":53,"value":1873},{"type":47,"tag":195,"props":2549,"children":2551},{"className":2550},[],[2552],{"type":53,"value":1931},{"type":53,"value":2554}," compute calls in ",{"type":47,"tag":195,"props":2556,"children":2558},{"className":2557},[],[2559],{"type":53,"value":762},{"type":53,"value":1873},{"type":47,"tag":195,"props":2562,"children":2564},{"className":2563},[],[2565],{"type":53,"value":1879},{"type":53,"value":2567}," — all compute routed through ",{"type":47,"tag":195,"props":2569,"children":2571},{"className":2570},[],[2572],{"type":53,"value":1894},{"type":53,"value":2574}," (weight-init-only usage in ",{"type":47,"tag":195,"props":2576,"children":2578},{"className":2577},[],[2579],{"type":53,"value":2580},"__init__",{"type":53,"value":2582}," is fine)",{"type":47,"tag":89,"props":2584,"children":2585},{},[2586],{"type":53,"value":2587},"✅ Existing examples were searched before implementation",{"type":47,"tag":89,"props":2589,"children":2590},{},[2591,2593,2598],{"type":53,"value":2592},"✅ Packaged ",{"type":47,"tag":195,"props":2594,"children":2596},{"className":2595},[],[2597],{"type":53,"value":271},{"type":53,"value":2599}," were searched if TileGym had no match",{"type":47,"tag":89,"props":2601,"children":2602},{},[2603],{"type":53,"value":2604},"✅ Only ONE .py file created (no READMEs, no separate examples unless requested)",{"type":47,"tag":89,"props":2606,"children":2607},{},[2608],{"type":53,"value":2609},"✅ No source citations in code (no mentions of TileGym files or reference files in comments\u002Fdocstrings)",{"type":47,"tag":89,"props":2611,"children":2612},{},[2613],{"type":53,"value":2614},"✅ Generated cuTile code compiles without errors",{"type":47,"tag":89,"props":2616,"children":2617},{},[2618],{"type":53,"value":2619},"✅ Numerical results match reference implementation within tolerance",{"type":47,"tag":89,"props":2621,"children":2622},{},[2623],{"type":53,"value":2624},"✅ All constants have proper type annotations",{"type":47,"tag":89,"props":2626,"children":2627},{},[2628],{"type":53,"value":2629},"✅ All tile dimensions are powers of 2",{"type":47,"tag":89,"props":2631,"children":2632},{},[2633],{"type":53,"value":2634},"✅ Grid dimensions correctly cover all tensor elements",{"type":47,"tag":89,"props":2636,"children":2637},{},[2638],{"type":53,"value":2639},"✅ Code includes inline validation and test code in the same file",{"type":47,"tag":56,"props":2641,"children":2642},{},[2643],{"type":47,"tag":128,"props":2644,"children":2645},{},[2646],{"type":53,"value":2647},"Additional criteria when using orchestration (complex tasks):",{"type":47,"tag":604,"props":2649,"children":2650},{"start":2476},[2651,2656,2661,2666,2671],{"type":47,"tag":89,"props":2652,"children":2653},{},[2654],{"type":53,"value":2655},"✅ Complexity was assessed and orchestration was chosen for the right reasons",{"type":47,"tag":89,"props":2657,"children":2658},{},[2659],{"type":53,"value":2660},"✅ Analyzer produced clear kernel specs with PyTorch references",{"type":47,"tag":89,"props":2662,"children":2663},{},[2664],{"type":53,"value":2665},"✅ Independent kernels were generated in parallel (not sequentially)",{"type":47,"tag":89,"props":2667,"children":2668},{},[2669],{"type":53,"value":2670},"✅ Each individual kernel was validated before composition",{"type":47,"tag":89,"props":2672,"children":2673},{},[2674],{"type":53,"value":2675},"✅ Composed solution passes end-to-end validation against original PyTorch reference",{"type":47,"tag":855,"props":2677,"children":2678},{},[],{"type":47,"tag":56,"props":2680,"children":2681},{},[2682,2687],{"type":47,"tag":128,"props":2683,"children":2684},{},[2685],{"type":53,"value":2686},"Remember",{"type":53,"value":2688},": Start by searching existing examples, follow the workflow systematically, and validate thoroughly. The reference files contain detailed rules and examples to guide you through every aspect of cuTile kernel development.",{"type":47,"tag":2690,"props":2691,"children":2692},"style",{},[2693],{"type":53,"value":2694},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"items":2696,"total":2853},[2697,2715,2731,2742,2754,2768,2781,2795,2808,2819,2833,2842],{"slug":2698,"name":2698,"fn":2699,"description":2700,"org":2701,"tags":2702,"stars":2712,"repoUrl":2713,"updatedAt":2714},"nemoclaw-user-guide","retrieve NemoClaw documentation and configuration","Guides human users' AI agents to the NemoClaw docs MCP server and canonical Fern documentation in Markdown form. Use when users ask how to install, configure, operate, troubleshoot, secure, or learn NemoClaw with an AI coding assistant. Trigger keywords - nemoclaw docs, use nemoclaw with ai agent, nemoclaw mcp docs, nemoclaw install help, nemoclaw quickstart, nemoclaw markdown docs, llms.txt, agent skills.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[2703,2706,2709],{"name":2704,"slug":2705,"type":15},"Documentation","documentation",{"name":2707,"slug":2708,"type":15},"MCP","mcp",{"name":2710,"slug":2711,"type":15},"Search","search",21777,"https:\u002F\u002Fgithub.com\u002FNVIDIA\u002FNemoClaw","2026-07-20T06:00:01.461044",{"slug":2716,"name":2716,"fn":2717,"description":2718,"org":2719,"tags":2720,"stars":2728,"repoUrl":2729,"updatedAt":2730},"mcore-build-and-dependency","manage Megatron-LM development environments","Container-based dev environment setup and dependency management for Megatron-LM. Covers acquiring and launching the CI container, uv package management, and updating uv.lock.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[2721,2724,2727],{"name":2722,"slug":2723,"type":15},"Containers","containers",{"name":2725,"slug":2726,"type":15},"Deployment","deployment",{"name":18,"slug":19,"type":15},17049,"https:\u002F\u002Fgithub.com\u002FNVIDIA\u002FMegatron-LM","2026-07-27T06:06:11.249662",{"slug":2732,"name":2732,"fn":2733,"description":2734,"org":2735,"tags":2736,"stars":2728,"repoUrl":2729,"updatedAt":2741},"mcore-bump-base-image","update NVIDIA PyTorch base images","Bump the NVIDIA PyTorch base image (`nvcr.io\u002Fnvidia\u002Fpytorch:YY.MM-py3`) used by Megatron-LM CI. Covers the two pin sites (GitHub CI in `docker\u002F.ngc_version.dev` and GitLab CI in `.gitlab\u002Fstages\u002F01.build.yml`), the post-bump CI loop (re-run functional tests, refresh golden values, mark broken tests), and the gotchas that bit PRs",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[2737,2740],{"name":2738,"slug":2739,"type":15},"CI\u002FCD","ci-cd",{"name":2725,"slug":2726,"type":15},"2026-07-14T05:25:59.97109",{"slug":2743,"name":2743,"fn":2744,"description":2745,"org":2746,"tags":2747,"stars":2728,"repoUrl":2729,"updatedAt":2753},"mcore-cicd","manage CI\u002FCD pipelines for Megatron-LM","CI\u002FCD reference for Megatron-LM. Covers CI pipeline structure, PR scope labels, triggering internal GitLab CI (which force-pushes the current branch to a pull-request\u002FBRANCH ref — always dry-run and verify the destination first; never run against shared or protected branches), and CI failure investigation.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[2748,2749,2750],{"name":2738,"slug":2739,"type":15},{"name":2725,"slug":2726,"type":15},{"name":2751,"slug":2752,"type":15},"GitHub","github","2026-07-27T06:06:12.278222",{"slug":2755,"name":2755,"fn":2756,"description":2757,"org":2758,"tags":2759,"stars":2728,"repoUrl":2729,"updatedAt":2767},"mcore-create-issue","investigate CI failures and create issues","Investigate a failing GitHub Actions run or job and create a GitHub issue for the failure.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[2760,2763,2764],{"name":2761,"slug":2762,"type":15},"Debugging","debugging",{"name":2751,"slug":2752,"type":15},{"name":2765,"slug":2766,"type":15},"Triage","triage","2026-07-14T05:25:57.442089",{"slug":2769,"name":2769,"fn":2770,"description":2771,"org":2772,"tags":2773,"stars":2728,"repoUrl":2729,"updatedAt":2780},"mcore-linting-and-formatting","lint and format Megatron-LM code","Linting and formatting for Megatron-LM. Covers running autoformat.sh, tools (ruff, black, isort, pylint, mypy), and code style rules.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[2774,2777],{"name":2775,"slug":2776,"type":15},"Best Practices","best-practices",{"name":2778,"slug":2779,"type":15},"Code Analysis","code-analysis","2026-07-14T05:25:56.18433",{"slug":2782,"name":2782,"fn":2783,"description":2784,"org":2785,"tags":2786,"stars":2728,"repoUrl":2729,"updatedAt":2794},"mcore-migrate-gpt-to-hybrid","migrate Megatron-LM models to HybridModel","Migration guide for moving Megatron Core GPTModel checkpoints, model providers, training commands, and layer mappings to HybridModel.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[2787,2790,2793],{"name":2788,"slug":2789,"type":15},"Machine Learning","machine-learning",{"name":2791,"slug":2792,"type":15},"Migration","migration",{"name":9,"slug":8,"type":15},"2026-07-17T06:07:11.777011",{"slug":2796,"name":2796,"fn":2797,"description":2798,"org":2799,"tags":2800,"stars":2728,"repoUrl":2729,"updatedAt":2807},"mcore-onboard-gb200-1node-tests","onboard functional tests for GB200","Onboard 1-node GitHub MR functional tests for GB200 from existing mr-scoped 2-node tests.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[2801,2804],{"name":2802,"slug":2803,"type":15},"QA","qa",{"name":2805,"slug":2806,"type":15},"Testing","testing","2026-07-14T05:25:53.673039",{"slug":2809,"name":2809,"fn":2810,"description":2811,"org":2812,"tags":2813,"stars":2728,"repoUrl":2729,"updatedAt":2818},"mcore-run-on-slurm","launch distributed training jobs on SLURM","How to launch distributed Megatron-LM training jobs on a SLURM cluster. Covers a minimal sbatch skeleton, environment-variable setup for torch.distributed.run, CUDA_DEVICE_MAX_CONNECTIONS rules across hardware and parallelism modes, container conventions, monitoring, and per-rank failure diagnosis.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[2814,2815],{"name":2725,"slug":2726,"type":15},{"name":2816,"slug":2817,"type":15},"Infrastructure","infrastructure","2026-07-14T05:25:49.362534",{"slug":2820,"name":2820,"fn":2821,"description":2822,"org":2823,"tags":2824,"stars":2728,"repoUrl":2729,"updatedAt":2832},"mcore-split-pr","split pull requests to reduce review load","Split a PR into multiple PRs to reduce the number of required CODEOWNERS reviewer groups.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[2825,2828,2829],{"name":2826,"slug":2827,"type":15},"Code Review","code-review",{"name":2751,"slug":2752,"type":15},{"name":2830,"slug":2831,"type":15},"Pull Requests","pull-requests","2026-07-14T05:26:01.226578",{"slug":2834,"name":2834,"fn":2835,"description":2836,"org":2837,"tags":2838,"stars":2728,"repoUrl":2729,"updatedAt":2841},"mcore-testing","run and manage Megatron-LM tests","Test system for Megatron-LM. Covers test layout, recipe YAML structure, adding and running unit and functional tests, golden values, marker filters, and CI parity.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[2839,2840],{"name":2802,"slug":2803,"type":15},{"name":2805,"slug":2806,"type":15},"2026-07-14T05:25:54.928983",{"slug":2843,"name":2843,"fn":2844,"description":2845,"org":2846,"tags":2847,"stars":2728,"repoUrl":2729,"updatedAt":2852},"nightly-sync","manage nightly main-to-dev sync workflows","Domain knowledge for the nightly main-to-dev sync workflow. Covers merge strategy, CI architecture, failure investigation, and known issues.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[2848,2851],{"name":2849,"slug":2850,"type":15},"Automation","automation",{"name":2738,"slug":2739,"type":15},"2026-07-30T05:29:03.275638",496,{"items":2855,"total":2949},[2856,2871,2881,2895,2905,2920,2935],{"slug":2857,"name":2857,"fn":2858,"description":2859,"org":2860,"tags":2861,"stars":23,"repoUrl":24,"updatedAt":2870},"accelerated-computing-cudf","accelerate data processing with cuDF","Official NVIDIA-authored guidance for NVIDIA cuDF GPU DataFrames, pandas acceleration, dask-cuDF, ETL, joins, groupby, CSV\u002FParquet I\u002FO, nullable semantics, and multi-GPU DataFrame workloads.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[2862,2865,2868,2869],{"name":2863,"slug":2864,"type":15},"Data Analysis","data-analysis",{"name":2866,"slug":2867,"type":15},"Data Engineering","data-engineering",{"name":9,"slug":8,"type":15},{"name":13,"slug":14,"type":15},"2026-07-14T05:28:43.176466",{"slug":2872,"name":2872,"fn":2873,"description":2874,"org":2875,"tags":2876,"stars":23,"repoUrl":24,"updatedAt":2880},"aiq-deploy","deploy and manage NVIDIA AI-Q infrastructure","Use when asked to install, deploy, run, validate, troubleshoot, or stop NVIDIA AI-Q Blueprint infrastructure.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[2877,2878,2879],{"name":2725,"slug":2726,"type":15},{"name":2816,"slug":2817,"type":15},{"name":9,"slug":8,"type":15},"2026-07-14T05:29:06.667109",{"slug":2882,"name":2882,"fn":2883,"description":2884,"org":2885,"tags":2886,"stars":23,"repoUrl":24,"updatedAt":2894},"aiq-research","conduct deep research with AI-Q","Use when asked to run deep research or AI-Q research through a reachable NVIDIA AI-Q Blueprint backend.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[2887,2890,2891],{"name":2888,"slug":2889,"type":15},"Agents","agents",{"name":9,"slug":8,"type":15},{"name":2892,"slug":2893,"type":15},"Research","research","2026-07-14T05:28:06.816956",{"slug":2896,"name":2896,"fn":2897,"description":2898,"org":2899,"tags":2900,"stars":23,"repoUrl":24,"updatedAt":2904},"amc-run-sample-calibration","run AMC sample dataset calibration","Run end-to-end calibration on the shipped sample dataset (sdg_08_2_sample_data_010926.zip) against a running AMC microservice. Use when user says 'test sample dataset', 'run sample calibration', 'verify AMC install', or 'launch and test'.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[2901,2902,2903],{"name":2863,"slug":2864,"type":15},{"name":9,"slug":8,"type":15},{"name":2805,"slug":2806,"type":15},"2026-07-17T05:29:03.913266",{"slug":2906,"name":2906,"fn":2907,"description":2908,"org":2909,"tags":2910,"stars":23,"repoUrl":24,"updatedAt":2919},"amc-run-video-calibration","calibrate video datasets with AutoMagicCalib","Calibrate a new dataset from pre-recorded video files via the AutoMagicCalib REST API. Use when user has local MP4s and says 'calibrate my videos', 'run AMC on these videos', or similar. For RTSP\u002Flive streams, use amc-run-rtsp-calibration instead.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[2911,2912,2915,2916],{"name":2849,"slug":2850,"type":15},{"name":2913,"slug":2914,"type":15},"Imaging","imaging",{"name":9,"slug":8,"type":15},{"name":2917,"slug":2918,"type":15},"Video","video","2026-07-17T05:28:53.905004",{"slug":2921,"name":2921,"fn":2922,"description":2923,"org":2924,"tags":2925,"stars":23,"repoUrl":24,"updatedAt":2934},"amc-setup-calibration-stack","deploy AutoMagicCalib microservice with Docker","Launch AutoMagicCalib microservice and web UI from NGC release images via Docker Compose. Use when user says 'deploy auto calibration', 'launch auto calibration', 'launch AMC', 'start MS+UI', or 'set up auto-magic-calib'. Requires NGC API key.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[2926,2927,2930,2931],{"name":2725,"slug":2726,"type":15},{"name":2928,"slug":2929,"type":15},"Docker","docker",{"name":9,"slug":8,"type":15},{"name":2932,"slug":2933,"type":15},"Operations","operations","2026-07-17T05:28:56.913999",{"slug":2936,"name":2936,"fn":2937,"description":2938,"org":2939,"tags":2940,"stars":23,"repoUrl":24,"updatedAt":2948},"cudaq-guide","develop quantum applications with CUDA-Q","CUDA-Q onboarding guide for installation, test programs, GPU simulation, QPU hardware, and quantum applications.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[2941,2942,2945],{"name":9,"slug":8,"type":15},{"name":2943,"slug":2944,"type":15},"Quantum Computing","quantum-computing",{"name":2946,"slug":2947,"type":15},"Simulation","simulation","2026-07-14T05:26:58.898253",305]