Skip to content

Guide · Agent skill

How to use the GPU Optimization for Python agent skill

Updated · written with AI from the project's own documentation and checked against our catalogue data

The optimize-for-gpu skill is an agent skill that helps an AI coding agent speed up scientific Python code on NVIDIA GPUs using libraries such as CuPy, cuDF, cuML and cuGraph. It is for researchers and engineers whose NumPy, pandas, scikit-learn, graph, image or simulation code is slow on large data and who have a CUDA-capable NVIDIA GPU. After this guide you will know what the skill does, how to install it, how to ask for it in plain language, and what to check before trusting the GPU version.

GPU Optimization for PythonK-Dense-AI/scientific-agent-skills · MIT

Quick start

  1. 1Check hardware and platform. Confirm you have an NVIDIA CUDA-capable GPU and are on Linux or WSL2 with Python 3.11 to 3.14.
  2. 2Download the ZIP. Download the optimize-for-gpu ZIP from this page.
  3. 3Unzip into a skills folder. Unzip into ~/.claude/skills/ for personal use, or into a project's .claude/skills/ folder.
  4. 4Or upload in the Claude apps. In the Claude apps, go to Settings → Capabilities → Skills and upload the skill.
  5. 5Ask with a natural request. Describe your slow code, your data size and the expected output, without needing to name CUDA.
  6. 6Provide a baseline. Let the agent measure current end-to-end speed on representative data before any changes.
  7. 7Validate before adopting. Check the GPU version's outputs against the expected results and keep it only if the benchmark improves.

What is an agent skill and what does this one do?

An agent skill is a folder of instructions and reference files that an AI agent loads when a request matches the skill's description. This skill, from the K-Dense-AI scientific-agent-skills collection, is licensed under MIT.

Once installed, the agent looks at slow NumPy, pandas, scikit-learn, graph, image or simulation code and considers moving it onto an NVIDIA GPU. The skill is designed to be cautious: it first asks for representative data and expected outputs, measures the current speed, and keeps the GPU version only if end-to-end benchmarks show a real improvement with matching results.

  • Prefers maintained libraries over custom kernels, for example CuPy for NumPy and SciPy, cuDF for pandas, cuML for scikit-learn and cuGraph for NetworkX.
  • Tries least-disruptive options first, such as cudf.pandas, cuml.accel and nx-cugraph backend dispatch.
  • Checks that outputs match within a numerical tolerance before reporting correctness or speedup.
  • Includes reference files for each library, plus before-and-after code patterns.

Check your requirements before installing

The skill needs an NVIDIA CUDA-capable GPU for GPU execution. Without one, the GPU code cannot run. The skill's requirements are Linux or WSL2 with Python 3.11 to 3.14, NumPy 2, CuPy 14, and CUDA 12 or 13 compatible RAPIDS packages. Package installation needs network access.

The skill does not support Mac or Windows outside WSL2.

  • NVIDIA CUDA-capable GPU for GPU execution
  • Linux or WSL2 with Python 3.11-3.14
  • NumPy 2, CuPy 14 and CUDA 12 or 13 compatible RAPIDS packages
  • Network access to install packages

Install the skill from the ZIP download

Download the ZIP for the optimize-for-gpu skill from this page. Then install it using one of the two methods below.

For a personal install across all projects, unzip the download into ~/.claude/skills/. To limit it to one project, unzip it into that project's .claude/skills/ folder. In the Claude apps, you can instead upload the skill under Settings → Capabilities → Skills.

  • Personal: unzip into ~/.claude/skills/
  • Single project: unzip into your project's .claude/skills/ folder
  • Claude apps: Settings → Capabilities → Skills, then upload

Trigger the skill with a natural request

You do not need to name the skill. The skill activates on requests about CUDA or GPU optimization, slow CPU-bound NumPy, SciPy, pandas, scikit-learn, NetworkX or image-processing code on large data, and questions about CuPy, cuDF, cuML, cuGraph, cuVS, cuCIM, KvikIO, Warp, Newton, Numba-CUDA or RAFT. It also activates when large data-parallel Python is slow and a GPU is a plausible fix, even if you never say CUDA.

Give the agent your code, a representative sample of your data, and what the output should look like. Mention your GPU if you know it.

  • "This pandas groupby takes 40 minutes on 200 million rows. Can we run it on my NVIDIA GPU and confirm the results match?"
  • "Port this NumPy FFT pipeline to CuPy and benchmark it end to end."
  • "My scikit-learn KMeans on 5 million rows is slow. Is cuML a good option here?"

Example workflow

A typical session follows the skill's workflow. The agent defines the contract and baseline, checks whether the workload suits a GPU, then tries the least disruptive implementation first. For a pandas script, that may mean enabling cudf.pandas before rewriting anything to the native cuDF API.

Review each change before you accept it. The skill notes that its reference examples are not tested on GPU hardware and must be validated on your machine before correctness or speedup is reported.

  • Capture a representative input, expected output and numerical tolerance.
  • Measure the current end-to-end time, including loading, transfers and output.
  • Port to the least disruptive option and compare results.
  • Keep the GPU version only if end-to-end benchmarks show a real improvement.

Safety notes: scripts and network access

This skill runs scripts and uses the network. It edits code and may install packages, so treat its changes like any other code change. Run them in a test environment first and review package installs before they reach production.

The skill's own text says its examples are illustrative and have not been executed on GPU hardware. Validate outputs and timings on your target GPU before relying on them.

  • Test changes in a non-production environment before deployment.
  • Review any packages the agent proposes to install.
  • Confirm correctness with your own representative data, not only the agent's random test arrays.
  • Do not use this skill for production code without review.

Tips for better results

Good inputs make the biggest difference. Provide real or representative data shapes and dtypes, your hardware, and your current package versions. Benchmarks should include transfers and output, not only compute time.

Be skeptical of small workloads. GPU setup and data transfer can cost more than they save on quick scripts.

  • Give the agent the expected output and a tolerance for numerical differences.
  • Share hardware and package versions so benchmarks are meaningful.
  • Ask for end-to-end timings, not only kernel timings.
  • If your code uses PyTorch, JAX or TensorFlow, ask to optimize within that framework rather than moving code out of it.

What people use it for

  • Speeding up a large pandas groupby or join with cudf.pandas or cuDF.
  • Porting a NumPy or SciPy array pipeline to CuPy.
  • Running scikit-learn estimators on GPU with cuML.
  • Accelerating NetworkX graph analytics with nx-cugraph or cuGraph.
  • Moving scikit-image processing to cuCIM for large images.

Frequently asked questions

Is the optimize-for-gpu skill free?

The skill is published under the MIT licence, as stated on this page. Check the licence in the skill's files for the exact terms.

What do I need to run the optimize-for-gpu skill?

You need an NVIDIA CUDA-capable GPU for GPU execution, Linux or WSL2 with Python 3.11 to 3.14, NumPy 2, CuPy 14, CUDA 12 or 13 compatible RAPIDS packages, and network access to install packages.

Does this skill work on Mac or Windows?

Not outside WSL2. The skill does not support Mac, and on Windows it works only through WSL2 on Linux.

How do I install an agent skill from a ZIP?

Unzip the download into ~/.claude/skills/ for personal use or into a project's .claude/skills/ folder. In the Claude apps, you can upload it under Settings → Capabilities → Skills.

Will the GPU version of my code be faster?

Not always. The skill keeps the GPU version only when synchronized end-to-end benchmarks show a real improvement with matching results. Small or quick scripts can be slower on GPU because of setup and data transfer.

Can I use this instead of CPU libraries like pandas or scikit-learn?

The skill can suggest GPU equivalents such as cuDF or cuML, and it also prefers accelerator modes that keep your existing code. Whether a GPU alternative is worth it depends on your data size and hardware, which the skill measures.

New agent skills, repos and AI tools — every week

The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.

Our verdict

Use this skill if you have an NVIDIA GPU, large NumPy, pandas, scikit-learn or graph workloads, and want an agent that benchmarks and checks correctness before changing code. Pick something else if you have no NVIDIA GPU, work on Mac or native Windows, or have small scripts where GPU overhead would dominate. Review every change and test it before it reaches production.

Download the skill