Zum Inhalt springen
Skillpedia
Allgemeines Programmieren51k · #3515

optimize-for-gpu

Was er macht

Dieses Tool hilft dir, Python-Programme, die wissenschaftliche Bibliotheken nutzen, zu beschleunigen, indem es sie auf NVIDIA-Grafikkarten (GPUs) laufen lässt. Es prüft, dass die Ergebnisse korrekt bleiben und das Programm tatsächlich schneller wird.

Wann du ihn nutzt

  • ✓Wenn ein Python-Programm langsam ist und du es schneller machen willst.
  • ✓Wenn du mit großen Datenmengen arbeitest, etwa Zahlen, Tabellen oder Bildern, und Bibliotheken wie NumPy oder pandas verwendest.
  • ✓Wenn du aufwendige Berechnungen in Bereichen wie künstlicher Intelligenz, Bildverarbeitung oder Simulationen optimieren musst.

Link zum Skill

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

Kopiere ihn und füge ihn in deine KI ein (Claude, ChatGPT oder Cursor) mit der Bitte, den Anweisungen zu folgen.

So nutzt du ihn

Am einfachsten: Kopiere die Nachricht und füge sie in deine KI ein. Sie liest den Skill und folgt den Anweisungen.

Fertige Nachricht zum Einfügen

Nutze diesen Skill, um mir zu helfen: https://github.com/K-Dense-AI/scientific-agent-skills/blob/main/skills/optimize-for-gpu/SKILL.md Lies die SKILL.md unter diesem Link und folge ihren Anweisungen für meine Aufgabe.
Soll deine KI Skills wie diesen selbst finden?Installiere den kostenlosen Skillpedia-MCP: eine Zeile, und sie durchsucht vor jeder Aufgabe 15.000+ Skills.In 1 Minute installieren →

Beispielanfrage an deine KI

“Wie kann ich meinen Python-Code mit NumPy auf einer NVIDIA-GPU schneller laufen lassen?”

5 neue Skills pro Woche. 1 Minute Lesezeit.

So funktioniert es

Das Tool analysiert deinen Python-Code und findet Teile, die auf der GPU laufen können. Es nutzt spezielle Bibliotheken, um die Berechnungen auf die Grafikkarte zu übertragen, und vergleicht dann Geschwindigkeit und Genauigkeit mit der ursprünglichen Version.

Technischer Inhalt (originale SKILL.md)

Originaltext des Autors, auf Englisch, direkt von 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.

…

Häufige Fragen

Brauche ich eine NVIDIA-Grafikkarte?

Ja, dieses Tool ist speziell für NVIDIA-Grafikkarten gemacht und nutzt Technologien wie CUDA.

Wird dadurch mein Code komplett verändert?

Ziel ist es, deinen Code zu beschleunigen, ohne die Grundlogik zu verändern. Das Tool versucht, Bibliotheken zu verwenden, die den bereits genutzten ähneln, zum Beispiel CuPy statt NumPy.

Woran erkenne ich, ob es wirklich schneller ist?

Das Tool misst die Ausführungszeit vor und nach der Optimierung mit denselben Daten. So lässt sich nachweisen, dass die GPU-Version tatsächlich schneller ist.

Details

Originalbeschreibung des Autors

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

Beliebtheit

GitHub-Sterne
51k
Platz im Ranking
#3515
Lizenz
MIT
Aktualisiert
15.10.2026

Ist dieser Skill nützlich?

0

Anmelden um abzustimmen.

Kommentare

  • …

Weitere Skills aus diesem Repository

Ähnliche Skills