optimize-for-gpu

optimize-for-gpu is a skill for Claude Code, Codex from synthetic-sciences/openscience. It costs 151 tokens per session (2,946 once invoked), scanned A, a copy of optimize-for-gpu, Apache-2.0.

A guide to speeding up scientific Python programs on NVIDIA graphics processors (GPUs). It covers workloads using tools such as NumPy, pandas, SciPy, scikit-learn, and graph or image-processing libraries.

In plain words
What is it for?
Use it to optimize numerical code, machine-learning tasks, vector search, graph analysis, simulations, and large array or table operations with CUDA and related tools.
Why use it?
It helps determine whether moving work from the CPU to a GPU is worthwhile, while checking that the results remain correct.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to optimize numerical code, machine-learning tasks, vector search, graph analysis, simulations, and large array or table operations with CUDA and related tools.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/synthetic-sciences/openscience/optimize-for-gpu
About the project

synthetic-sciences/openscience is an AI workbench that carries out scientific research by reading papers, forming hypotheses, writing and running code, conducting experiments, analyzing results, and preparing reports. Researchers use it for work in machine learning, biology, physics, and chemistry with remote or local models. Catalogue add-ons extend its scientific workflows through skills and instructions.

synthetic-sciences/openscience · 4,025 stars · on GitHub · openscience.sh

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add synthetic-sciences/openscience --skill optimize-for-gpu
Clone the repo
git clone --depth 1 https://github.com/synthetic-sciences/openscience

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for optimize-for-gpu

README.md
[![agentmods](https://agentmods.dev/badge/skills/synthetic-sciences/openscience/optimize-for-gpu/github.svg)](https://agentmods.dev/skills/synthetic-sciences/openscience/optimize-for-gpu)
Your own site
<a href="https://agentmods.dev/skills/synthetic-sciences/openscience/optimize-for-gpu"><img src="https://agentmods.dev/badge/skills/synthetic-sciences/openscience/optimize-for-gpu/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for optimize-for-gpu

Your own site · 80×15
<a href="https://agentmods.dev/skills/synthetic-sciences/openscience/optimize-for-gpu"><img src="https://agentmods.dev/badge/skills/synthetic-sciences/openscience/optimize-for-gpu.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 151 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,946 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin 95% copy Near-identical to another mod in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00151 $0.02946
Opus 5.5 $0.00060 $0.01178
Sonnet 5.5 $0.00030 $0.00589
Haiku 4.5 $0.00015 $0.00295

Measured 1mo ago against content hash 9d6430de47dc, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

optimize-for-gpu scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

This is a copy

95% identical to optimize-for-gpu — 27 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

backend/cli/skills/coding/optimize-for-gpu/SKILL.md · 201 lines

How it starts

The opening of the file, as written. The whole thing — 201 lines — stays where its author put it; the contents beside it link to each section on GitHub.

GPU Optimization for Python with NVIDIA

Treat GPU acceleration as an evidence-driven optimization, not an automatic rewrite. Preserve the user's numerical and algorithmic contract, measure with representative data, and keep the GPU version only when synchronized end-to-end benchmarks show a useful improvement.

When This Skill Applies

  • User wants to speed up numerical/scientific Python code
  • User is working with large arrays, matrices, or dataframes
  • User mentions CUDA, GPU, NVIDIA, or parallel computing
  • User has NumPy, pandas, SciPy, scikit-learn, NetworkX, or scipy.sparse.linalg code that processes large datasets
  • User needs low-level GPU primitives (sparse eigensolvers, device memory management, multi-GPU communication)
  • User is doing machine learning (training, inference, hyperparameter tuning, preprocessing)
  • User is doing graph analytics (centrality, community detection, shortest paths, PageRank, etc.)
  • User is doing vector search, nearest neighbor search, similarity search, or building a RAG pipeline
  • User has Faiss, Annoy, ScaNN, or sklearn NearestNeighbors code that could be GPU-accelerated
  • User wants GPU-accelerated interactive dashboards, cross-filtering, or exploratory data analysis on large datasets
  • User is doing geospatial analysis (point-in-polygon, spatial joins, trajectory analysis, distance calculations) with GeoPandas or shapely
  • User is doing image processing, computer vision, or medical imaging (filtering, segmentation, morphology, feature detection) with scikit-image or OpenCV
  • User is working with whole-slide images (WSI), digital pathology, microscopy, or remote sensing imagery
  • User is loading large binary data files into GPU memory (numpy.fromfile → cupy, or Python open() → GPU array)
  • User needs to read files from S3, HTTP, or WebHDFS directly into GPU memory
  • User mentions GPUDirect Storage (GDS) or wants to bypass CPU-memory staging for file IO
  • User is doing physics simulation (particles, cloth, fluids, rigid bodies) or differentiable simulation
  • User needs mesh operations (ray casting, closest-point queries, signed distance fields) or geometry processing on GPU
  • User is doing robotics (kinematics, dynamics, control) with transforms and quaternions
  • User has Python simulation loops that could be JIT-compiled to GPU kernels
  • User mentions NVIDIA Warp or wants differentiable GPU simulation integrated with PyTorch/JAX
  • User is doing simulations, signal processing, financial modeling, bioinformatics, physics, or any compute-intensive work
  • User wants to optimize existing code and GPU acceleration is the right answer

Read the full file on GitHub · 201 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago Changed · +5 lines 9d6430de47dc
  2. 1mo ago First seen · 196 lines · 151 tokens per session scan A 304936d0a12e

Subscribe to this mod's changes

optimize-for-gpu is a skill published in the GitHub repository synthetic-sciences/openscience (4,025 stars, last pushed today), licensed Apache-2.0. It adds 151 tokens to every session and 2,946 once invoked, about $0.0006 per session on Opus 5.5. A static security scan graded it A with 0 findings. It is 95% identical to optimize-for-gpu, differing in 27 lines, and is treated as a copy.

Related

Other skills, from other repositories

system-prompts

Write system prompts, tool docs, and agent definitions. Project tag conventions + RFC 2119 keywords + dense compression. Use when authoring or editing any prompt the model reads.

can1357/oh-my-pi · 40 tokens

tool-prompt-optimization

Optimize the description prompts an AI agent reads to learn its built-in tools (the .md files under prompts/tools/). Two halves: (1) measure how much of a prompt is already inferable from the tool's JSON parameter schema + name, to prune redundancy with evidence; (2) house authoring rules for what belongs in a tool…

can1357/oh-my-pi · 0 tokens

gno

Search local documents, files, notes, and knowledge bases. Index directories, search with BM25/vector/hybrid, get AI answers with citations. Use when user wants to search files, find documents, query notes, look up information in local folders, index a directory, set up document search, build a knowledge base, needs…

gmickel/gno · 86 tokens

knowledge-model-and-provider-runtime-provider-resilience-admission-and-observability

A codebase guide for handling unreliable AI provider requests across agents and sessions, including retries, circuit breakers, fair queues, stalled streams, cache tracking, and health checks.

echoVic/blade-code · 184 tokens

knowledge-model-and-provider-runtime-model-catalog-configuration-and-credentials

A codebase guide for defining AI models and providers, selecting endpoints and credentials, configuring fallback channels, and migrating model identifiers.

echoVic/blade-code · 160 tokens

knowledge-model-and-provider-runtime

A codebase guide for choosing AI models and providers, sending requests, recovering from failures, and recording runtime information.

echoVic/blade-code · 152 tokens