All skills
nvidia avatar

/tilegym-cutile-python

@129a108
by NVIDIA Corporationnvidia/skills3.5k stars
424

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.

Use this Skill: https://skilld.dev/gh/nvidia/skills/tilegym-cutile-python

This session only. Nothing lands on disk.

examplesconvolutionREADME.md

≈742 tokens on demand. Your agent reads this file only when SKILL.md points to it.

List of test examples for Convolution

For Convolution parameters, the following can be either a single value or a tuple of values and you should generate the code accordingly.

  • kernel_size: The size of the kernel, either a single value or a tuple of values.
    • The single value means the size of the kernel is the same for all dimensions.
    • The tuple of values means the size of the kernel is different for each dimension.
  • stride: stride of the convolution.
  • padding: padding of the convolution.
  • dilation: dilation of the convolution.
  • output_padding: controls the additional size added to one side of the output shape, not actually padding (only in convolution transpose)
  • bias: bias of the convolution (default: True)

Important: Avoid using cuTile's tile size (1, 1) for 2D convolution or (1, 1, 1) for 3D convolution as it is inefficient. Use larger kernel sizes as shown in the following examples.

Steps for Converting PyTorch Convolution to cuTile:

  1. Identify Convolution Type and Dimension:

    • Determine if it's regular convolution (torch.nn.Conv1d, torch.nn.Conv2d, torch.nn.Conv3d) or transpose convolution (torch.nn.ConvTranspose1d, torch.nn.ConvTranspose2d, torch.nn.ConvTranspose3d)
    • Extract the dimension (1D, 2D, or 3D) from the layer type
  2. Extract Convolution Parameters:

    • Model attributes: Access parameters like model.conv.in_channels, model.conv.out_channels, and model.conv.kernel_size.
    • Weight tensor: Use model.conv.weight.data to get the actual weight values
    • Bias tensor: Use model.conv.bias.data if bias is enabled (bias is enabled by default) this is different from model.bias.data which is the bias of the model.
  3. Distinguish Parameter Types:

    • Model parameters: Direct model attributes like model.bias.data (model bias)
    • Layer parameters: Convolution-specific parameters like model.conv.weight.data, model.conv.bias.data (conv bias)
    • Computed parameters: Derived values like in_channels_per_group = in_channels // groups
  4. Implement cuTile Kernel Considerations:

    • Regular Convolution: Use forward convolution logic with proper indexing for input gathering
    • Power-of-2 Padding: Use next_power_of_2() for efficient cuTile operations
    • Masking: Apply proper bounds checking and padding for out-of-bounds access
  5. Grid and Block Configuration:

    • Set up appropriate grid dimensions based on output tensor shape
    • Handle grouped convolutions by computing per-group channel ranges

Examples

Source: SKILL.md on GitHub

1 warning3mo3 checks · Risk SAFE
  • Gen Agent Trust Hub3mo

    The skill is a cuTile programming assistant provided by NVIDIA. It guides agents through writing, optimizing, and validating GPU kernels. Security analysis found that it clones official repositories from GitHub (NVIDIA TileGym and PyTorch) and executes generated scripts as part of its validation workflow. Both behaviors are standard for its intended use case. Static analysis warnings for eval() calls were confirmed as false positives, as they refer to the PyTorch .eval() method rather than the Python eval() function.

  • Socket3mo

    No alerts

  • Snyk3mo

    Risk: MEDIUM · 2 issues

Signed by skilld at 129a108. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub yesterday.

Activeupdated 4 months ago
version
1.3.0
Other metadata
metadata
{
  "author": "TileGym Team <TileGym@nvidia.com>",
  "tags": [
    "cutile",
    "gpu-kernels",
    "cuda"
  ]
}

README badge

README badge for nvidia/skills/tilegym-cutile-python