Aller au contenu
Skillpedia
Programmation générale51k · #3515

optimize-for-gpu

Ce qu’il fait

Cet outil vous aide à accélérer les programmes informatiques écrits en Python qui utilisent des bibliothèques scientifiques, en les faisant tourner plus vite sur les cartes graphiques NVIDIA (GPU). Il vérifie que les résultats restent corrects et qu'il y a bien un gain de vitesse réel.

Quand l’utiliser

  • ✓Lorsqu'un programme Python est lent et que vous souhaitez l'accélérer.
  • ✓Si vous travaillez avec de grandes quantités de données, comme des nombres, des tableaux ou des images, et utilisez des bibliothèques comme NumPy ou pandas.
  • ✓Si vous devez optimiser des calculs complexes dans des domaines comme l'intelligence artificielle, le traitement d'images ou les simulations.

Lien du skill

https://github.com/K-Dense-AI/scientific-agent-skills/blob/main/skills/optimize-for-gpu/SKILL.md

Copiez-le et collez-le dans votre IA (Claude, ChatGPT ou Cursor) en lui demandant de suivre les instructions.

Comment l’utiliser

Le plus simple : copiez le message et collez-le dans votre IA. Elle lit le skill et suit les instructions.

Message prêt à coller

Utilise ce skill pour m’aider : https://github.com/K-Dense-AI/scientific-agent-skills/blob/main/skills/optimize-for-gpu/SKILL.md Lis le fichier SKILL.md de ce lien et suis ses instructions pour ma tâche.
Envie que votre IA trouve seule des skills comme celui-ci ?Installez le MCP gratuit de Skillpedia : une ligne, et elle cherche parmi 15 000+ skills avant chaque tâche.Installer en 1 minute →

Exemple de demande à votre IA

“Comment faire tourner plus vite mon code Python utilisant NumPy sur un GPU NVIDIA ?”

5 nouveaux skills par semaine. 1 minute de lecture.

Comment ça marche

L'outil analyse votre code Python et repère les parties pouvant être exécutées sur le GPU. Il utilise des bibliothèques spécifiques pour transférer les calculs vers la carte graphique, puis compare la vitesse et la précision avec la version d'origine.

Contenu technique (SKILL.md original)

Texte original de l’auteur, en anglais, directement depuis 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.

Reviewed against RAPIDS 26.08, CuPy 14.2, Numba-CUDA 0.30.4, and Warp 1.17. The references contain illustrative GPU examples: source/API review is not execution on CUDA hardware. Validate them on the user's target GPU before reporting correctness or speedup. Do not use a moving latest documentation page to infer compatibility with a pinned release.

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

Choose the Smallest Suitable Layer

Prefer a maintained library implementation over a custom kernel:

Existing workload Preferred path Use for
NumPy / SciPy CuPy arrays, sparse matrices, linear algebra, FFTs, signal processing
pandas cudf.pandas, then cuDF accelerator mode first; native API for more control
scikit-learn cuml.accel, then cuML accelerator mode first; native estimators as needed
NetworkX nx-cugraph, then cuGraph backend dispatch first; native graph API at scale
scikit-image cuCIM GPU image processing and whole-slide imaging
Faiss / Annoy / k-NN cuVS exact and approximate vector search
Raw or remote file I/O KvikIO GPU buffers and GPUDirect Storage
Custom array kernels Numba-CUDA-MLIR for new work; Numba-CUDA for existing code explicit SIMT kernels and shared memory
Spatial or differentiable kernels Warp geometry, simulation kernels, robotics, autodiff
High-level physics simulation Newton maintained engine that succeeds the removed warp.sim module
Low-level RAPIDS primitives RAFT (pylibraft) sparse eigensolvers, resources, multi-GPU building blocks

Do not move code out of PyTorch, JAX, TensorFlow, or another GPU-native framework merely to use one of these libraries. First remove CPU round trips and use the framework's compiler, profiler, mixed-precision, and batching facilities.

…

Questions fréquentes

Ai-je besoin d'une carte graphique NVIDIA ?

Oui, cet outil est spécialement conçu pour les cartes graphiques NVIDIA et utilise des technologies comme CUDA.

Cela va-t-il modifier entièrement mon code ?

L'objectif est d'accélérer votre code sans modifier sa logique principale. L'outil essaie d'utiliser des bibliothèques proches de celles que vous utilisez déjà, comme CuPy à la place de NumPy.

Comment savoir si le code est vraiment plus rapide ?

L'outil mesure le temps d'exécution avant et après l'optimisation, avec les mêmes données, afin de vérifier que la version GPU est effectivement plus rapide.

Détails

Description originale de l’auteur

GPU-accelerates scientific Python on NVIDIA hardware and verifies that the result is correct and faster. Use for CUDA/GPU optimization; CPU-bound NumPy, SciPy, pandas, scikit-learn, NetworkX, scikit-image, vector-search, image-processing, graph, simulation, or file-I/O workloads; CuPy, cuDF, cuML, cuGraph, cuVS, cuCIM, KvikIO, Warp, Newton, Numba-CUDA, or RAFT questions; and profiling, memory-tran

repo: K-Dense-AI/scientific-agent-skills

Popularité

Étoiles GitHub
51k
Position au classement
#3515
Licence
MIT
Mis à jour
15/10/2026

Ce skill vous est-il utile ?

0

Connectez-vous pour voter.

Commentaires

  • …

Autres skills de ce dépôt

Skills similaires