본문으로 건너뛰기
Skillpedia
일반 코딩51k · #3515

optimize-for-gpu

하는 일

이 도구는 과학 라이브러리를 사용하는 Python 프로그램을 NVIDIA 그래픽카드(GPU)에서 더 빠르게 실행하도록 돕습니다. 결과가 여전히 정확한지, 그리고 실제로 속도가 향상되었는지 확인합니다.

사용하는 경우

  • ✓Python 프로그램이 느려서 더 빠르게 만들고 싶을 때.
  • ✓숫자, 표, 이미지 같은 대량의 데이터를 다루며 NumPy나 pandas 같은 라이브러리를 쓸 때.
  • ✓인공지능, 이미지 처리, 시뮬레이션 같은 분야의 복잡한 계산을 최적화해야 할 때.

스킬 링크

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

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/K-Dense-AI/scientific-agent-skills/blob/main/skills/optimize-for-gpu/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“NumPy를 사용하는 제 Python 코드를 NVIDIA GPU에서 더 빠르게 실행하려면 어떻게 해야 하나요?”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

도구는 Python 코드를 분석해 GPU에서 실행할 수 있는 부분을 찾습니다. 특정 라이브러리를 사용해 계산을 그래픽카드로 옮기고, 원래 버전과 속도 및 정확도를 비교합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 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.

…

자주 묻는 질문

NVIDIA 그래픽카드가 필요한가요?

네, 이 도구는 NVIDIA 그래픽카드에 맞게 설계되었으며 CUDA 같은 기술을 사용합니다.

제 코드를 완전히 바꾸나요?

목표는 코드의 주요 로직을 바꾸지 않고 속도를 높이는 것입니다. 도구는 이미 사용 중인 라이브러리와 비슷한 라이브러리를 사용하려고 하며, 예를 들어 NumPy 대신 CuPy를 씁니다.

실제로 더 빠른지 어떻게 알 수 있나요?

같은 데이터로 최적화 전후의 실행 시간을 측정해, GPU 버전이 실제로 더 빠른지 확인합니다.

상세 정보

작성자의 원본 설명

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

인기도

GitHub 스타
51k
순위
#3515
라이선스
MIT
업데이트
2026. 10. 15.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬