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_cu111-0.2.9-cp310-cp310-win_amd64.whl (787.3 kB view details)

Uploaded CPython 3.10 Windows x86-64

cumm_cu111-0.2.9-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_cu111-0.2.9-cp39-cp39-win_amd64.whl (787.5 kB view details)

Uploaded CPython 3.9 Windows x86-64

cumm_cu111-0.2.9-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_cu111-0.2.9-cp38-cp38-win_amd64.whl (787.3 kB view details)

Uploaded CPython 3.8 Windows x86-64

cumm_cu111-0.2.9-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_cu111-0.2.9-cp37-cp37m-win_amd64.whl (787.3 kB view details)

Uploaded CPython 3.7m Windows x86-64

cumm_cu111-0.2.9-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_cu111-0.2.9-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_cu111-0.2.9-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for cumm_cu111-0.2.9-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 4f7b29941bfc9dab8f43b361fac0d27f7e8422a2f0f74f67c879f444a356911e
MD5 50628604d452e63e33650444f8460129
BLAKE2b-256 d286756aeb2c267d46f0256b95034443a61ea9a6a8efb3f0edb062b808f42e4b

See more details on using hashes here.

File details

Details for the file cumm_cu111-0.2.9-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for cumm_cu111-0.2.9-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 fa8c4cee35436434b1293cd1bb3aa9c83597ce040237baf572cd09ed46a2f289
MD5 3b1ba70206db6474aa46e6b62481c715
BLAKE2b-256 3c6ad0e122e7f16fa45f28aa143287332de4488eea6e52a404386bf5db2c959c

See more details on using hashes here.

File details

Details for the file cumm_cu111-0.2.9-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: cumm_cu111-0.2.9-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 787.5 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for cumm_cu111-0.2.9-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 5c72820959be5901eb0e99ef1ac53e4284a3b3d6874ccdd681f0b06a875ff9db
MD5 7616f91d938e29a823811ed642f34d22
BLAKE2b-256 7efc4c4f713382ca64a31bfb34d4cd3202c073adf601a6352a16e62c7d7d41eb

See more details on using hashes here.

File details

Details for the file cumm_cu111-0.2.9-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for cumm_cu111-0.2.9-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 faed8ffda989d114183e467f8e54c30ee5cfcbca4fba96a09d86c67c24375c5a
MD5 6e9a4aac031edd65ebdeb34cc607b4d7
BLAKE2b-256 60bedb1b3ce18b78c3468f7381cf95a324ac2fca4574587ee6e8c933e7239c6f

See more details on using hashes here.

File details

Details for the file cumm_cu111-0.2.9-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: cumm_cu111-0.2.9-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 787.3 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.10

File hashes

Hashes for cumm_cu111-0.2.9-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 84e62dfe00ecdeecdbb5fced8d67888961955b2c65644b1e09e59af4982646d7
MD5 32ee24475415c31678835a6a015b2cfc
BLAKE2b-256 cef9a9ad1788867bc9e69cf980f0403c43f2878704bee18e66ad50e9e3dd00e9

See more details on using hashes here.

File details

Details for the file cumm_cu111-0.2.9-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for cumm_cu111-0.2.9-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 fd7c5d2d1eeeee04e87339c25c4996a587aee60f44567c11532edf31e68e2a4d
MD5 5ae662cca7913ef955d50c10e4df659f
BLAKE2b-256 e6d661b50762f70829a75d2d3778d6fd229bf5b7d3a0c447ab27553ef895ec4f

See more details on using hashes here.

File details

Details for the file cumm_cu111-0.2.9-cp37-cp37m-win_amd64.whl.

File metadata

File hashes

Hashes for cumm_cu111-0.2.9-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 aeab9eea00db631a1caf66a549320bc66fdf926ce28ebcafce611ce21426fa76
MD5 5dfc8a393b1e45777612122feb9a8abb
BLAKE2b-256 7a4fcabfbf316a66f71028f435af9e118e2abbcb7c3fadf443ba7baedc64effd

See more details on using hashes here.

File details

Details for the file cumm_cu111-0.2.9-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for cumm_cu111-0.2.9-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0bb1a94a9ce68c880493f0677f890549dc21be0eda78f6925bf1e63bd24702b8
MD5 576db0b7db5c971d5f6413b76af511d9
BLAKE2b-256 36bb7ae39773fba89a53d808fc12b1011bcd31a71f6b09c443284bbb34370cc4

See more details on using hashes here.

File details

Details for the file cumm_cu111-0.2.9-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for cumm_cu111-0.2.9-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 bfd8b96c5eff4c7d23e06729861fc5c394d43ae3197ae354570db3d2dd54c57a
MD5 37528e5b380d50986ab71cd6a6910ee6
BLAKE2b-256 d18429bbda257fb3b7fc45c7f5826b9765c5c601c773577064757eada3ecad03

See more details on using hashes here.

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