CuPy

CuPy
CuPy
원저작자도쿠이 세이야
개발자커뮤니티, 우선 네트워크, Inc.
초기 릴리즈2015년 9월 2일, 7년 전(2015-09-02)[1]
안정된 릴리스
v10.5.0[2] / 2022년 5월 26일, 8개월 전(2022-05-26)[2]
프리뷰 릴리즈
v11.0.0b3[2] / 2022년 5월 26일;8개월 전(2022-05-26)[2]
저장소github.com/cupy/cupy
기입처Python, Cython, CUDA
운영 체제Linux, Windows
플랫폼크로스 플랫폼
유형수치 분석
면허증.MIT
웹 사이트큐피.dev

CuPy는 Python 프로그래밍 언어로 GPU 가속 컴퓨팅을 위한 오픈 소스 라이브러리이며 다차원 배열, 스파스 매트릭스 및 [3]그 위에 구현된 다양한 수치 알고리즘을 지원합니다.CuPy는 NumPy SciPy와 동일한 API 세트를 공유하여 NumPy/SciPy 코드를 GPU에서 실행하는 드롭인 대체가 가능합니다.CuPy는 NVIDIA CUDA GPU 플랫폼과 AMD ROCM GPU 플랫폼을 v9.[4][5]0부터 지원합니다.

CuPy는 초기에 Chainer 딥 러닝 프레임워크의 백엔드로 개발되었으며,[6] 이후 2017년에 독립 프로젝트로 설립되었습니다.

CuPy는 NumPy 에코시스템[7] 어레이 라이브러리의 일부이며 특히 [9]Summit, Perlmutter,[10] Eluer [11][12]ABCI와 같은 고성능 컴퓨팅 환경에서 [8]Python과 GPU를 활용하기 위해 널리 채택되고 있습니다.

CuPy는 NumFOCUS 관련 [13]프로젝트입니다.

특징들

CuPy는 NumPy/SciPy 호환 API와 더불어 사용자 정의 GPU 커널을 작성하거나 낮은 수준의 API에 [14][15]액세스하는 기능을 구현합니다.

NumPy 호환 API

NumPy 패키지에 정의된 것과 동일한 API 세트(numpy.*)는, 이하에서 입수할 수 있습니다.cupy.*패키지.

SciPy 호환 API

SciPy 패키지에 정의된 것과 동일한 API 세트(scipy.*)는, 이하에서 입수할 수 있습니다.cupyx.scipy.*패키지.

사용자 정의 GPU 커널

  • 요소별 및 축소 작업을 위한 커널 템플릿
  • 원시 커널(CUDA C/C++)
  • 저스트 인 타임 트랜스필러(JIT)
  • 커널 융합

분산 컴퓨팅

  • 분산 커뮤니케이션 패키지(cupyx.distributed), 집합 및 피어 투 피어 프리미티브 제공

저레벨 CUDA 기능

  • 스트림 및 이벤트
  • 메모리 풀
  • 프로파일러
  • 호스트 API 바인딩
  • CUDA Python[16] 지원

상호 운용성

  • DLPack[17]
  • CUDA 어레이[18] 인터페이스
  • NEP 13 (__array_ufunc__[19]
  • NEP 18 (__array_function__[20][21]
  • 어레이 API[22][23] 표준

어레이 작성

>>>수입품 큐피 ~하듯이 cp >>>x = cp.배열([1, 2, 3]) >>>x 어레이([1, 2, 3]) >>>y = cp.오렌지색(10) >>>y 어레이([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]) 

기본 조작

>>>수입품 큐피 ~하듯이 cp >>>x = cp.오렌지색(12).모양을 바꾸다(3, 4).타이프(cp.플로트32) >>>x 어레이([0., 1., 2., 3)], [ 4.,  5.,  6.,  7.], [8., 9., 10., 11.], dtype=18032) >>>x.(축.=1) 어레이([6., 22., 38.), dtype=param32) 

원시 CUDA C/C++ 커널

>>>수입품 큐피 ~하듯이 cp >>>접속하다 = cp.RawKernel(r''' ...외부 "C" __global__ ...void multiply_elmwise(const float*in1, const float*in2, float*out) { ...int tid = blockDim.x * blockIdx.x + threadIdx.x; ...out[context] = in1[context] * in2[context]; ...} ...''', '일레임와이즈') >>>입력 1 = cp.오렌지색(16, d타입=cp.플로트32).모양을 바꾸다(4, 4) >>>인2 = cp.오렌지색(16, d타입=cp.플로트32).모양을 바꾸다(4, 4) >>>나가. = cp.제로((4, 4), d타입=cp.플로트32) >>>접속하다((4,), (4,), (입력 1, 인2, 나가.))  그리드, 블록 및 인수 수 >>>나가. 어레이([0., 1., 4., 9]), [ 16.,  25.,  36.,  49.], [ 64.,  81., 100., 121.], [198., 169., 196., 225.]), dtype=18032) 

적용들

「 」를 참조해 주세요.

레퍼런스

  1. ^ "Release v1.3.0 – chainer/chainer". Retrieved 25 June 2022 – via GitHub.
  2. ^ a b c d "Releases – cupy/cupy". Retrieved 18 June 2022 – via GitHub.
  3. ^ Okuta, Ryosuke; Unno, Yuya; Nishino, Daisuke; Hido, Shohei; Loomis, Crissman (2017). CuPy: A NumPy-Compatible Library for NVIDIA GPU Calculations (PDF). Proceedings of Workshop on Machine Learning Systems (LearningSys) in The Thirty-first Annual Conference on Neural Information Processing Systems (NIPS).
  4. ^ "CuPy 9.0 Brings AMD GPU Support To This Numpy-Compatible Library - Phoronix". Phoronix. 29 April 2021. Retrieved 21 June 2022.
  5. ^ "AMD Leads High Performance Computing Towards Exascale and Beyond". 28 June 2021. Retrieved 21 June 2022. Most recently, CuPy, an open-source array library with Python, has expanded its traditional GPU support with the introduction of version 9.0 that now offers support for the ROCm stack for GPU-accelerated computing.
  6. ^ "Preferred Networks released Version 2 of Chainer, an Open Source framework for Deep Learning - Preferred Networks, Inc". 2 June 2017. Retrieved 18 June 2022.
  7. ^ "NumPy". numpy.org. Retrieved 21 June 2022.
  8. ^ Gorelick, Micha; Ozsvald, Ian (April 2020). High Performance Python: Practical Performant Programming for Humans (2nd ed.). O'Reilly Media, Inc. p. 190. ISBN 9781492055020.
  9. ^ Oak Ridge Leadership Computing Facility. "Installing CuPy". OLCF User Documentation. Retrieved 21 June 2022.
  10. ^ National Energy Research Scientific Computing Center. "Using Python on Perlmutter". NERSC Documentation. Retrieved 21 June 2022.
  11. ^ ETH Zurich. "CuPy". ScientificComputing. Retrieved 21 June 2022.
  12. ^ National Institute of Advanced Industrial Science and Technology. "Chainer". ABCI 2.0 User Guide. Retrieved 21 June 2022.
  13. ^ "Affiliated Projects - NumFOCUS". Retrieved 18 June 2022.
  14. ^ "Overview". CuPy documentation. Retrieved 18 June 2022.
  15. ^ "Comparison Table". CuPy documentation. Retrieved 18 June 2022.
  16. ^ "CUDA Python NVIDIA Developer". Retrieved 21 June 2022.
  17. ^ "Welcome to DLPack's documentation!". DLPack 0.6.0 documentation. Retrieved 21 June 2022.
  18. ^ "CUDA Array Interface (Version 3)". Numba 0.55.2+0.g2298ad618.dirty-py3.7-linux-x86_64.egg documentation. Retrieved 21 June 2022.
  19. ^ "NEP 13 — A mechanism for overriding Ufuncs — NumPy Enhancement Proposals". numpy.org. Retrieved 21 June 2022.
  20. ^ "NEP 18 — A dispatch mechanism for NumPy's high level array functions — NumPy Enhancement Proposals". numpy.org. Retrieved 21 June 2022.
  21. ^ Charles R Harris; K. Jarrod Millman; Stéfan J. van der Walt; et al. (16 September 2020). "Array programming with NumPy" (PDF). Nature. 585 (7825): 357–362. arXiv:2006.10256. doi:10.1038/S41586-020-2649-2. ISSN 1476-4687. PMC 7759461. PMID 32939066. Wikidata Q99413970.
  22. ^ "2021 report - Python Data APIs Consortium" (PDF). Retrieved 21 June 2022.
  23. ^ "Purpose and scope". Python array API standard 2021.12 documentation. Retrieved 21 June 2022.
  24. ^ "Install spaCy". spaCy Usage Documentation. Retrieved 21 June 2022.
  25. ^ Patel, Ankur A.; Arasanipalai, Ajay Uppili (May 2021). Applied Natural Language Processing in the Enterprise (1st ed.). O'Reilly Media, Inc. p. 68. ISBN 9781492062578.
  26. ^ "Python Package Introduction". xgboost 1.6.1 documentation. Retrieved 21 June 2022.
  27. ^ "UCBerkeleySETI/turbo_seti: turboSETI -- python based SETI search algorithm". GitHub. Retrieved 21 June 2022.
  28. ^ "Open GPU Data Science RAPIDS". Retrieved 21 June 2022.
  29. ^ "API Docs". RAPIDS Docs. Retrieved 21 June 2022.
  30. ^ "Efficient Data Sharing between CuPy and RAPIDS". Retrieved 21 June 2022.
  31. ^ "10 Minutes to cuDF and CuPy". Retrieved 21 June 2022.
  32. ^ Alex, Rogozhnikov (2022). Einops: Clear and Reliable Tensor Manipulations with Einstein-like Notation. International Conference on Learning Representations.
  33. ^ "arogozhnikov/einops: Deep learning operations reinvented (for pytorch, tensorflow, jax and others)". GitHub. Retrieved 21 June 2022.
  34. ^ Tokui, Seiya; Okuta, Ryosuke; Akiba, Takuya; Niitani, Yusuke; Ogawa, Toru; Saito, Shunta; Suzuki, Shuji; Uenishi, Kota; Vogel, Brian; Vincent, Hiroyuki Yamazaki (2019). Chainer: A Deep Learning Framework for Accelerating the Research Cycle. Proceedings of the 25th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining. doi:10.1145/3292500.3330756.

외부 링크