CUda Matrix Multiply library
Project description
cumm
CUda Matrix Multiply library.
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.
BREAKING CHANGES
- 0.3.1: tv::DType enum value changed, this will affect all binary code of tv::Tensor user. you must recompile all code if upgrade to cumm >= 0.3.1.
News
- Ampere feature support (by EvernightAurora)
Install
Prebuilt
We offer python 3.7-3.11 and cuda 10.2/11.3/11.4/11.7/12.0 prebuilt binaries for linux (manylinux).
We offer python 3.7-3.11 and cuda 10.2/11.3/11.4/11.7/12.0 prebuilt binaries for windows 10/11.
pip install cumm
for CPU-only
pip install cumm-cu102
for CUDA 10.2
pip install cumm-cu113
for CUDA 11.3
pip install cumm-cu114
for CUDA 11.4
pip install cumm-cu117
for CUDA 11.7
pip install cumm-cu120
for CUDA 12.0
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
- uninstall cumm installed by pip. you must ensure no "cumm" exists in
pip list | grep cumm
- install build-essential, install CUDA
git clone https://github.com/FindDefinition/cumm
,cd ./cumm
,git checkout tags/<tag_name>
,pip install -e .
- in python,
import cumm
and wait for build finish.
Windows
- uninstall spconv and cumm installed by pip. you must ensure no "cumm" exists in
pip list | grep cumm
- install visual studio 2019 or newer. make sure C++ development component is installed. install CUDA
- set powershell script execution policy
- start a new powershell, run
tools/msvc_setup.ps1
git clone https://github.com/FindDefinition/cumm
,cd ./cumm
,git checkout tags/<tag_name>
,pip install -e .
- 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
- select a cuda version. available: CUDA 11.1, 11.3, 11.4, 11.5, 12.0
- (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
- install build-essential, install CUDA
- set env for installed cuda version. for example,
export CUMM_CUDA_VERSION="11.4"
. If you want to build CPU-only, runexport CUMM_CUDA_VERSION=""
. IfCUMM_CUDA_VERSION
isn't set, you need to ensure cuda libraries are inside OS search path, and the built wheel name will becumm
, otherwisecumm-cuxxx
- run
export CUMM_DISABLE_JIT="1"
- run
python setup.py bdist_wheel
+pip install dists/xxx.whl
Windows 10/11
- install visual studio 2019 or newer. make sure C++ development package is installed. install CUDA
- set powershell script execution policy
- start a new powershell, run
tools/msvc_setup.ps1
- 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 = ""
. . IfCUMM_CUDA_VERSION
isn't set, you need to ensure cuda libraries are inside OS search path, and the built wheel name will becumm
, otherwisecumm-cuxxx
- run
$Env:CUMM_DISABLE_JIT = "1"
- run
python setup.py bdist_wheel
+pip install dists/xxx.whl
Contributers
- EvernightAurora: add ampere feature.
Note
The work is done when the author is an employee at Tusimple.
LICENSE
Apache 2.0
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Hashes for cumm_cu120-0.4.0-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e8ca23acb81ee53177d42fb8ec55e076ca7986104353ddeed2b2aa6f4479b112 |
|
MD5 | a6be8f7808ae92f48a2f9d62d390e70d |
|
BLAKE2b-256 | eb88cb8397eb0ae9339e1418e9c127105fe76fe3f890ba28f77a3e3e0704c328 |
Hashes for cumm_cu120-0.4.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5bb4403613701fd8f80f383b92a6b87249cac0d73272e479fbdc69b48ae8b8a3 |
|
MD5 | fa3e35f56727665619e3d7d808ff14db |
|
BLAKE2b-256 | d1516d7f500d3ba4f419f917755d13ee7a6a907648c04e8688a2a76a6d852676 |
Hashes for cumm_cu120-0.4.0-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d4305ce418ba5515f924159ccd4cfebf8e8c9d96d7aeff0445730a8689ffe4b6 |
|
MD5 | 2852de5579499cd438a6ac5fa6040670 |
|
BLAKE2b-256 | 3e1cc945941eb58c5f6ed2a9ab6724825c101d4d23c46abc1dfec99a3eafd449 |
Hashes for cumm_cu120-0.4.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 29bf142cf793d54a4bc387f3481e242036d138e7e7a490b91a64e35f85010f51 |
|
MD5 | 0709e61bcce8655b290007d012d716a8 |
|
BLAKE2b-256 | 2b17be8fd5e80e642126241dd48c8b71cb77815724cf337200112583242a9dba |
Hashes for cumm_cu120-0.4.0-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 74bba207e869de36171a14c609a7e00b28acf64154245604750cfb29447bcd4f |
|
MD5 | 59137d914e78630e6a79ba2647ed598c |
|
BLAKE2b-256 | 883a348e70a49b37d063145ae34bde3a1cf43f2da2eede516b54717589e3f1d1 |
Hashes for cumm_cu120-0.4.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2769599e49eaffa6c40127b5f141b35c52b6e76b781efba3e8eed80bdc405bd6 |
|
MD5 | b7ce342b724398190d3c9b1a3b7af3d0 |
|
BLAKE2b-256 | 1d3426bb1ec13d5c9b87d1e254e8f91f5044d8f8eca24b057bfd1116527ca0ce |
Hashes for cumm_cu120-0.4.0-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 624be1149597c1b36fb8a8e98bd0c687ecc9c6d06992665a13104e6133d8ad60 |
|
MD5 | f7399d94b29928c60bd599597127f70d |
|
BLAKE2b-256 | 73014b3567a18af77fcfff408c60ac2f1104a1bb88d451e6c7862d30eb4b9961 |
Hashes for cumm_cu120-0.4.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b99ab758e9fc744255077640c803cdb8e99310a4ed2c4a1b95c171092925340f |
|
MD5 | 6c93d24731035340e0e4ed9925dc9462 |
|
BLAKE2b-256 | 5d0de6f97d7402dc8f0a1cf50035c38a14be0fcb2a4d3b1f38b97104715cbf8a |
Hashes for cumm_cu120-0.4.0-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8a74363b56bd747594c025faa6ad2ac236da0d6b4d673bc83a87535d07f9962a |
|
MD5 | 6556e8003ee3f55afa924aab58c0ab10 |
|
BLAKE2b-256 | c71d1f8374db9bf9cb8bff5ac568ff8a2abc013546e30a97b3cd6cd1bb9e9286 |
Hashes for cumm_cu120-0.4.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9091d073de107044f940208c1550f6805fb5b5f8a18637f4d69bfc6a699c1fa3 |
|
MD5 | 974ec5dc202b706abe84a2a16a08dc70 |
|
BLAKE2b-256 | 4baa1616e8bea295f901d6a2d2248a55224a9c003cf3396f8efbfa25e5fb6e5d |