Skip to main content

CUda Matrix Multiply library

Project description

cumm

CUda Matrix Multiply library.

Build Status

cumm is developed during learning of CUTLASS, which use too much c++ template and make code unmaintainable. So I develop pccm, use python as meta programming language, to replace c++ template meta programming. Now pccm become a foundational framework of cumm and my other c++ project such as spconv. cumm also contains a python asyncio-based gemm simulator that share same meta program with CUDA code, enable gemm visualization and easy debug experience.

Install

Prebuilt

We offer python 3.6-3.10 and cuda 10.2/11.1/11.3/11.4 prebuilt binaries for linux (manylinux).

We offer python 3.7-3.10 and cuda 10.2/11.1/11.3/11.4 prebuilt binaries for windows 10/11.

We will offer prebuilts for CUDA versions supported by latest pytorch release. For example, pytorch 1.9 support cuda 10.2 and 11.1, so we support them too.

pip install cumm for CPU-only

pip install cumm-cu102 for CUDA 10.2

pip install cumm-cu111 for CUDA 11.1

pip install cumm-cu113 for CUDA 11.3

pip install cumm-cu114 for CUDA 11.4

Build from source for development (JIT, recommend for develop)

WARNING Use code in tags!!! code in main branch may contain bugs.

The c++ code will be built automatically when you change c++ code in project.

Linux

  1. uninstall cumm installed by pip. you must ensure no "cumm" exists in pip list | grep cumm
  2. install build-essential, install CUDA
  3. git clone https://github.com/FindDefinition/cumm, cd ./cumm, pip install -e .
  4. in python, import cumm and wait for build finish.

Windows

  1. uninstall spconv and cumm installed by pip. you must ensure no "cumm" exists in pip list | grep cumm
  2. install visual studio 2019 or newer. make sure C++ development component is installed. install CUDA
  3. set powershell script execution policy
  4. start a new powershell, run tools/msvc_setup.ps1
  5. git clone https://github.com/FindDefinition/cumm, cd ./cumm, pip install -e .
  6. in python, import cumm and wait for build finish.

Build wheel from source

WARNING Use code in tags!!! code in main branch may contain bugs.

WARNING: If CUMM_CUDA_VERSION is set with a CUDA version, following steps will create a wheel named "cumm-cuxxx", not "cumm", this means you must use cumm-cuxxx in dependency of your project which depend on cumm, not cumm. If CUMM_CUDA_VERSION isn't set, cumm will always built with CUDA, so the CUDA must exists in your system. The wheel name will be cumm even if it is built with cuda.

Linux

It's recommend to build Linux packages in official build docker. Build with CUDA support don't need a real GPU.

Build in Official Docker
  1. select a cuda version. available: CUDA 10.2, 11.1, 11.3, 11.4, 11.5
  2. (Example for CUDA 11.4) git clone https://github.com/FindDefinition/cumm, cd ./cumm, docker run --rm -e PLAT=manylinux2014_x86_64 -e CUMM_CUDA_VERSION=114 -v `pwd`:/io scrin/manylinux2014-cuda:cu114-devel-1.0.0 bash -c "source /etc/bashrc && /io/tools/build-wheels.sh"
Build in your environment
  1. install build-essential, install CUDA
  2. set env for installed cuda version. for example, export CUMM_CUDA_VERSION="11.4". If you want to build CPU-only, run export CUMM_CUDA_VERSION="". If CUMM_CUDA_VERSION isn't set, you need to ensure cuda libraries are inside OS search path, and the built wheel name will be cumm, otherwise cumm-cuxxx
  3. run export CUMM_DISABLE_JIT="1"
  4. run python setup.py bdist_wheel+pip install dists/xxx.whl

Windows 10/11

  1. install visual studio 2019 or newer. make sure C++ development package is installed. install CUDA
  2. set powershell script execution policy
  3. start a new powershell, run tools/msvc_setup.ps1
  4. set env for installed cuda version. for example, $Env:CUMM_CUDA_VERSION = "11.4". If you want to build CPU-only, run $Env:CUMM_CUDA_VERSION = "". . If CUMM_CUDA_VERSION isn't set, you need to ensure cuda libraries are inside OS search path, and the built wheel name will be cumm, otherwise cumm-cuxxx
  5. run $Env:CUMM_DISABLE_JIT = "1"
  6. run python setup.py bdist_wheel+pip install dists/xxx.whl

Note

The work is done when the author is an employee at Tusimple.

LICENSE

Apache 2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

cumm_cu113-0.2.6-cp310-cp310-win_amd64.whl (785.3 kB view details)

Uploaded CPython 3.10 Windows x86-64

cumm_cu113-0.2.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

cumm_cu113-0.2.6-cp39-cp39-win_amd64.whl (779.8 kB view details)

Uploaded CPython 3.9 Windows x86-64

cumm_cu113-0.2.6-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

cumm_cu113-0.2.6-cp38-cp38-win_amd64.whl (785.1 kB view details)

Uploaded CPython 3.8 Windows x86-64

cumm_cu113-0.2.6-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

cumm_cu113-0.2.6-cp37-cp37m-win_amd64.whl (785.0 kB view details)

Uploaded CPython 3.7m Windows x86-64

cumm_cu113-0.2.6-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.7m manylinux: glibc 2.17+ x86-64

cumm_cu113-0.2.6-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.6m manylinux: glibc 2.17+ x86-64

File details

Details for the file cumm_cu113-0.2.6-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: cumm_cu113-0.2.6-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 785.3 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.0 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.0

File hashes

Hashes for cumm_cu113-0.2.6-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 85691b671b77ad8de8e35f8357b3b6921d69ae03294000594f6b08eaa29bea7b
MD5 853033962959eec5a17a4d6148b0b91b
BLAKE2b-256 be3c01b74aaa5446c0d5fd6ce0e373df46694adbd16617569d2afe6e44cff97f

See more details on using hashes here.

Provenance

File details

Details for the file cumm_cu113-0.2.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for cumm_cu113-0.2.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a96936748ef2d9850d13c9a0ca23fbed8f0c492ce75222a73cd88572343497a2
MD5 ee9b15845a25f79739fa085118c39ba6
BLAKE2b-256 7fe1b01637191216d60333d07204069063ed2ab8a98f16f0cc3e9827e1b7b875

See more details on using hashes here.

Provenance

File details

Details for the file cumm_cu113-0.2.6-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: cumm_cu113-0.2.6-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 779.8 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.0 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for cumm_cu113-0.2.6-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 0d381474c528e6c0942e9a617d639903ee5fce855b187c1fd91c2c446c0d936b
MD5 cadddba30f70d3dad46df6f4796c295f
BLAKE2b-256 a98264252fe89b06ff039aba52fc11c3e2adfa65f1b61e51f35f092e98bc9002

See more details on using hashes here.

Provenance

File details

Details for the file cumm_cu113-0.2.6-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for cumm_cu113-0.2.6-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 5fe972d37d5c85fe937389a7f32beaff19b5628afc9cef87a65c2794bba138be
MD5 ee48be062af79b500cceaf667bc6e0d5
BLAKE2b-256 4e106c646f0028c79cd595fb31598d1323e7de5625e378e1bcfe14be39389323

See more details on using hashes here.

Provenance

File details

Details for the file cumm_cu113-0.2.6-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: cumm_cu113-0.2.6-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 785.1 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.0 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10

File hashes

Hashes for cumm_cu113-0.2.6-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 c5a155d304f00e0a5e47cb00e364448f07c807452f86f94c1a7d077c602b87af
MD5 b4f69ec313a004e66c54460b40dca0b8
BLAKE2b-256 91e50ad43a3bd45b6807a04be54b46adc116af0c72c63ff14b2510daeed62230

See more details on using hashes here.

Provenance

File details

Details for the file cumm_cu113-0.2.6-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for cumm_cu113-0.2.6-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 fd5192bf5a082b224d01157ffc785e43143a122d2af40f0adc02d0c5255f79bd
MD5 e3b0795e5cc7b2df625d537b483aac5c
BLAKE2b-256 08774a8107db37c4ba4948d279dce4a34d8607c3e7b32a7d1aefeb7d6ff7debc

See more details on using hashes here.

Provenance

File details

Details for the file cumm_cu113-0.2.6-cp37-cp37m-win_amd64.whl.

File metadata

  • Download URL: cumm_cu113-0.2.6-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 785.0 kB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.0 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.9

File hashes

Hashes for cumm_cu113-0.2.6-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 8f922418ce8c2722ebf7a6eaeec9c1823b5be284f06772f6f2d32a9237444460
MD5 ede928e217d322bf25896926cc7c4ccb
BLAKE2b-256 1261fcf0699831039e6b4b344f9aa671005e91ea8e2fe6f30a16a718902096f0

See more details on using hashes here.

Provenance

File details

Details for the file cumm_cu113-0.2.6-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for cumm_cu113-0.2.6-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 9b3361920d4e69cc493478bfde8fb359b4fd01833426f0f7536522b01265811c
MD5 52d2b8efdd5d73427ca45c019b97f029
BLAKE2b-256 5a2cb8f7057d52599a5852c7359708cc0bf37f4948a6718447cd8c192ed72ba6

See more details on using hashes here.

Provenance

File details

Details for the file cumm_cu113-0.2.6-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for cumm_cu113-0.2.6-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 adb6821958b6955e34b5adcb604abcb7f1d1de018d1fb4b97dc871ebaf351744
MD5 1c35be7b40a373017b6e5962af24a6ca
BLAKE2b-256 cb8677d2e925873ca9dc93aea8b152ccffb748b0938c8f457e9210407632f830

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page