# cumm
CUda Matrix Multiply library.
[](https://github.com/FindDefinition/cumm/actions?query=workflow%3Abuild)
```cumm``` is developed during learning of [CUTLASS](https://github.com/NVIDIA/cutlass), which use too much c++ template and make code unmaintainable. So I develop [pccm](https://github.com/FindDefinition/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](https://github.com/traveller59/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](https://github.com/EvernightAurora))
## Install
### Prebuilt
We offer python 3.9-3.13 and cuda 11.4/11.8/12.1/12.4/12.6 prebuilt binaries for linux (`manylinux_2_28`).
We offer python 3.9-3.13 and cuda 11.4/11.8/12.1/12.4/12.6 prebuilt binaries for windows 10/11.
We offer python 3.9-3.13 prebuilt binaries for Mac OS X >= 14.0 (Apple Silicon Only).
```pip install cumm``` for CPU-only
```pip install cumm-cu114``` for CUDA 11.4
```pip install cumm-cu126``` for CUDA 12.6
### Build from source for development (JIT, recommend for develop)
**WARNING** Use code in [tags](https://github.com/FindDefinition/cumm/releases)!!! code in main branch may contain bugs.
The c++ code will be built automatically when you change c++ code in project.
#### Linux
0. uninstall cumm installed by pip. you must ensure no "cumm" exists in ```pip list | grep cumm```
1. install build-essential, install CUDA
2. ```git clone https://github.com/FindDefinition/cumm```, ```cd ./cumm```, ```git checkout tags/<tag_name>```, ```pip install -e .```
3. in python, ```import cumm``` and wait for build finish.
#### Windows
0. uninstall spconv and cumm installed by pip. you must ensure no "cumm" exists in ```pip list | grep cumm```
1. install visual studio 2019 or newer. make sure C++ development component is installed. install CUDA
2. set [powershell script execution policy](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_execution_policies?view=powershell-7.1)
3. start a new powershell, run ```tools/msvc_setup.ps1```
4. ```git clone https://github.com/FindDefinition/cumm```, ```cd ./cumm```, ```git checkout tags/<tag_name>```, ```pip install -e .```
5. in python, ```import cumm``` and wait for build finish.
### Build wheel from source
**WARNING** Use code in [tags](https://github.com/FindDefinition/cumm/releases)!!! 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](https://github.com/FindDefinition/cumm/blob/main/.github/workflows/build.yaml). Build with CUDA support don't need a real GPU.
##### Build in Official Docker
1. select a cuda version. available: CUDA 11.1, 11.3, 11.4, 11.5, 12.0
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](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_execution_policies?view=powershell-7.1)
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```
4. run ```$Env:CUMM_DISABLE_JIT = "1"```
5. run ```python setup.py bdist_wheel```+```pip install dists/xxx.whl```
## Contributers
* [EvernightAurora](https://github.com/EvernightAurora): add ampere feature.
## Note
The work is done when the author is an employee at [Tusimple](https://www.tusimple.com/).
## LICENSE
Apache 2.0
Raw data
{
"_id": null,
"home_page": "https://github.com/FindDefinition/cumm",
"name": "cumm-cu124",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": null,
"author": "Yan Yan",
"author_email": "yanyan.sub@outlook.com",
"download_url": null,
"platform": null,
"description": "\r\n# cumm\r\nCUda Matrix Multiply library.\r\n\r\n[](https://github.com/FindDefinition/cumm/actions?query=workflow%3Abuild)\r\n\r\n```cumm``` is developed during learning of [CUTLASS](https://github.com/NVIDIA/cutlass), which use too much c++ template and make code unmaintainable. So I develop [pccm](https://github.com/FindDefinition/PCCM), use python as meta programming language, to replace c++ template meta programming. \r\nNow ```pccm``` become a foundational framework of ```cumm``` and my other c++ project such as [spconv](https://github.com/traveller59/spconv). \r\n```cumm``` also contains a python asyncio-based gemm simulator that **share same meta program** with CUDA code, enable gemm visualization and easy debug experience.\r\n\r\n## BREAKING CHANGES\r\n\r\n* 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.\r\n\r\n## News\r\n\r\n* Ampere feature support (by [EvernightAurora](https://github.com/EvernightAurora))\r\n\r\n## Install\r\n\r\n### Prebuilt\r\n\r\nWe offer python 3.9-3.13 and cuda 11.4/11.8/12.1/12.4/12.6 prebuilt binaries for linux (`manylinux_2_28`).\r\n\r\nWe offer python 3.9-3.13 and cuda 11.4/11.8/12.1/12.4/12.6 prebuilt binaries for windows 10/11.\r\n\r\nWe offer python 3.9-3.13 prebuilt binaries for Mac OS X >= 14.0 (Apple Silicon Only).\r\n\r\n```pip install cumm``` for CPU-only\r\n\r\n```pip install cumm-cu114``` for CUDA 11.4\r\n\r\n```pip install cumm-cu126``` for CUDA 12.6\r\n\r\n### Build from source for development (JIT, recommend for develop)\r\n\r\n**WARNING** Use code in [tags](https://github.com/FindDefinition/cumm/releases)!!! code in main branch may contain bugs.\r\n\r\nThe c++ code will be built automatically when you change c++ code in project.\r\n\r\n#### Linux\r\n\r\n0. uninstall cumm installed by pip. you must ensure no \"cumm\" exists in ```pip list | grep cumm```\r\n1. install build-essential, install CUDA\r\n2. ```git clone https://github.com/FindDefinition/cumm```, ```cd ./cumm```, ```git checkout tags/<tag_name>```, ```pip install -e .```\r\n3. in python, ```import cumm``` and wait for build finish.\r\n\r\n#### Windows\r\n0. uninstall spconv and cumm installed by pip. you must ensure no \"cumm\" exists in ```pip list | grep cumm```\r\n1. install visual studio 2019 or newer. make sure C++ development component is installed. install CUDA\r\n2. set [powershell script execution policy](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_execution_policies?view=powershell-7.1)\r\n3. start a new powershell, run ```tools/msvc_setup.ps1```\r\n4. ```git clone https://github.com/FindDefinition/cumm```, ```cd ./cumm```, ```git checkout tags/<tag_name>```, ```pip install -e .```\r\n5. in python, ```import cumm``` and wait for build finish.\r\n\r\n### Build wheel from source \r\n\r\n**WARNING** Use code in [tags](https://github.com/FindDefinition/cumm/releases)!!! code in main branch may contain bugs.\r\n\r\n**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.\r\n\r\n#### Linux\r\n\r\nIt's recommend to build Linux packages in [official build docker](https://github.com/FindDefinition/cumm/blob/main/.github/workflows/build.yaml). Build with CUDA support don't need a real GPU.\r\n\r\n##### Build in Official Docker\r\n\r\n1. select a cuda version. available: CUDA 11.1, 11.3, 11.4, 11.5, 12.0\r\n2. (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\"```\r\n\r\n##### Build in your environment\r\n\r\n1. install build-essential, install CUDA\r\n2. 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```\r\n3. run ```export CUMM_DISABLE_JIT=\"1\"```\r\n4. run ```python setup.py bdist_wheel```+```pip install dists/xxx.whl```\r\n\r\n#### Windows 10/11\r\n\r\n1. install visual studio 2019 or newer. make sure C++ development package is installed. install CUDA\r\n2. set [powershell script execution policy](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_execution_policies?view=powershell-7.1)\r\n3. start a new powershell, run ```tools/msvc_setup.ps1```\r\n4. 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```\r\n4. run ```$Env:CUMM_DISABLE_JIT = \"1\"```\r\n5. run ```python setup.py bdist_wheel```+```pip install dists/xxx.whl```\r\n\r\n## Contributers\r\n\r\n* [EvernightAurora](https://github.com/EvernightAurora): add ampere feature.\r\n\r\n## Note\r\nThe work is done when the author is an employee at [Tusimple](https://www.tusimple.com/).\r\n\r\n## LICENSE\r\n\r\nApache 2.0\r\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "CUda Matrix Multiply library",
"version": "0.7.11",
"project_urls": {
"Homepage": "https://github.com/FindDefinition/cumm"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "fc076565dbdd0943ca1c64cf111197dc0d2f30d55c7451ab55276b053f7c1d69",
"md5": "a17d6543d947919058840997807c49fc",
"sha256": "75ca92805593726312e856c5eb188d479e03563ebec26a1bf7194f84dd580d95"
},
"downloads": -1,
"filename": "cumm_cu124-0.7.11-cp310-cp310-manylinux_2_28_x86_64.whl",
"has_sig": false,
"md5_digest": "a17d6543d947919058840997807c49fc",
"packagetype": "bdist_wheel",
"python_version": "cp310",
"requires_python": ">=3.8",
"size": 27554713,
"upload_time": "2024-12-15T13:58:13",
"upload_time_iso_8601": "2024-12-15T13:58:13.094491Z",
"url": "https://files.pythonhosted.org/packages/fc/07/6565dbdd0943ca1c64cf111197dc0d2f30d55c7451ab55276b053f7c1d69/cumm_cu124-0.7.11-cp310-cp310-manylinux_2_28_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "596404b383a07ea45e4c5b639916bcc18c47200c3ee77d01c6a7501496e01687",
"md5": "2932f7d01e7f1fb2573cef58fd8b3c91",
"sha256": "fef7034a1eb4a552b3f9253f3d307a9af0d5984763c7d7f51df23262d43df3f0"
},
"downloads": -1,
"filename": "cumm_cu124-0.7.11-cp310-cp310-win_amd64.whl",
"has_sig": false,
"md5_digest": "2932f7d01e7f1fb2573cef58fd8b3c91",
"packagetype": "bdist_wheel",
"python_version": "cp310",
"requires_python": ">=3.8",
"size": 1221437,
"upload_time": "2024-12-15T13:37:56",
"upload_time_iso_8601": "2024-12-15T13:37:56.501973Z",
"url": "https://files.pythonhosted.org/packages/59/64/04b383a07ea45e4c5b639916bcc18c47200c3ee77d01c6a7501496e01687/cumm_cu124-0.7.11-cp310-cp310-win_amd64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "bc3f979fcdda0f2649154bbdaa65544264e2533242ae19a8f7693bd3f2fc8836",
"md5": "1b2d0ffa63dc9ee7985fc0392b24ffc8",
"sha256": "cc685eaca23057e43a19ffa6f57c6683d38737b4ec1223368e38044245df1bab"
},
"downloads": -1,
"filename": "cumm_cu124-0.7.11-cp311-cp311-manylinux_2_28_x86_64.whl",
"has_sig": false,
"md5_digest": "1b2d0ffa63dc9ee7985fc0392b24ffc8",
"packagetype": "bdist_wheel",
"python_version": "cp311",
"requires_python": ">=3.8",
"size": 27563170,
"upload_time": "2024-12-15T13:58:20",
"upload_time_iso_8601": "2024-12-15T13:58:20.244482Z",
"url": "https://files.pythonhosted.org/packages/bc/3f/979fcdda0f2649154bbdaa65544264e2533242ae19a8f7693bd3f2fc8836/cumm_cu124-0.7.11-cp311-cp311-manylinux_2_28_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "5a94f38f32c64769f113def177f6a0ca318f3ed08027da6d799e0ef2bd3d6e54",
"md5": "66ae6b57bbb077da290c764ee302d3d5",
"sha256": "bfd8c9b1f23de6fede75a97b09cd275ccacde7d91ed68059c8c592d32c1c3775"
},
"downloads": -1,
"filename": "cumm_cu124-0.7.11-cp311-cp311-win_amd64.whl",
"has_sig": false,
"md5_digest": "66ae6b57bbb077da290c764ee302d3d5",
"packagetype": "bdist_wheel",
"python_version": "cp311",
"requires_python": ">=3.8",
"size": 1222735,
"upload_time": "2024-12-15T13:38:59",
"upload_time_iso_8601": "2024-12-15T13:38:59.727326Z",
"url": "https://files.pythonhosted.org/packages/5a/94/f38f32c64769f113def177f6a0ca318f3ed08027da6d799e0ef2bd3d6e54/cumm_cu124-0.7.11-cp311-cp311-win_amd64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "6452853aee9877bcd20a2d4542d93355e172c5415ae31310e580b0eed8871269",
"md5": "ab46352a047e73a21f88f92e5c032e48",
"sha256": "e2587e4f26225a2a2675f73792561c3ccf0859491e53a394954bd32c5822d694"
},
"downloads": -1,
"filename": "cumm_cu124-0.7.11-cp312-cp312-manylinux_2_28_x86_64.whl",
"has_sig": false,
"md5_digest": "ab46352a047e73a21f88f92e5c032e48",
"packagetype": "bdist_wheel",
"python_version": "cp312",
"requires_python": ">=3.8",
"size": 27557401,
"upload_time": "2024-12-15T13:58:26",
"upload_time_iso_8601": "2024-12-15T13:58:26.597869Z",
"url": "https://files.pythonhosted.org/packages/64/52/853aee9877bcd20a2d4542d93355e172c5415ae31310e580b0eed8871269/cumm_cu124-0.7.11-cp312-cp312-manylinux_2_28_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "4a68d220eb29b43560c6ae36c33ea1033efbed9279ed0d6009745e63bea64606",
"md5": "62ed058c202405ad4bfbe02094581142",
"sha256": "00c3640ef4500b8cbd8b12f4957eb38c097ca60b8f18143758121245712109bd"
},
"downloads": -1,
"filename": "cumm_cu124-0.7.11-cp312-cp312-win_amd64.whl",
"has_sig": false,
"md5_digest": "62ed058c202405ad4bfbe02094581142",
"packagetype": "bdist_wheel",
"python_version": "cp312",
"requires_python": ">=3.8",
"size": 1221850,
"upload_time": "2024-12-15T13:47:47",
"upload_time_iso_8601": "2024-12-15T13:47:47.029635Z",
"url": "https://files.pythonhosted.org/packages/4a/68/d220eb29b43560c6ae36c33ea1033efbed9279ed0d6009745e63bea64606/cumm_cu124-0.7.11-cp312-cp312-win_amd64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "916dd1ccc8cfb72d33f48477207ff260a3d0b662b015e2287cdafc471e9599fb",
"md5": "e750f01e7955d9a98becbc62565e2d15",
"sha256": "673f01cf012c5d64fb17d82b483d24a6f590b72c8d6875329655fcf11e02ee23"
},
"downloads": -1,
"filename": "cumm_cu124-0.7.11-cp313-cp313-manylinux_2_28_x86_64.whl",
"has_sig": false,
"md5_digest": "e750f01e7955d9a98becbc62565e2d15",
"packagetype": "bdist_wheel",
"python_version": "cp313",
"requires_python": ">=3.8",
"size": 27559990,
"upload_time": "2024-12-15T13:58:32",
"upload_time_iso_8601": "2024-12-15T13:58:32.588710Z",
"url": "https://files.pythonhosted.org/packages/91/6d/d1ccc8cfb72d33f48477207ff260a3d0b662b015e2287cdafc471e9599fb/cumm_cu124-0.7.11-cp313-cp313-manylinux_2_28_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "a1b3f9fbe08e46211b14e351e592f2b934ce0b60a66a337d37e40cdf60755e8e",
"md5": "5534b3b1cba006e1c85b71a7ad7491e8",
"sha256": "929124ea56a3be65ba3c812830abc94ad34fa48ce8e9437a8a69dd28a7ab834e"
},
"downloads": -1,
"filename": "cumm_cu124-0.7.11-cp313-cp313-win_amd64.whl",
"has_sig": false,
"md5_digest": "5534b3b1cba006e1c85b71a7ad7491e8",
"packagetype": "bdist_wheel",
"python_version": "cp313",
"requires_python": ">=3.8",
"size": 1222761,
"upload_time": "2024-12-15T13:47:44",
"upload_time_iso_8601": "2024-12-15T13:47:44.368369Z",
"url": "https://files.pythonhosted.org/packages/a1/b3/f9fbe08e46211b14e351e592f2b934ce0b60a66a337d37e40cdf60755e8e/cumm_cu124-0.7.11-cp313-cp313-win_amd64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "b875b6fb790dc037b2465d8576c1f078d82cdb2747a48037844e34acf4e0db68",
"md5": "2a4b36275c72cbbfc6f3eaaa68b56373",
"sha256": "1173860239051ad37faa471a6983eeb23e4ced199092c81bd093e11b84ef5ab8"
},
"downloads": -1,
"filename": "cumm_cu124-0.7.11-cp39-cp39-manylinux_2_28_x86_64.whl",
"has_sig": false,
"md5_digest": "2a4b36275c72cbbfc6f3eaaa68b56373",
"packagetype": "bdist_wheel",
"python_version": "cp39",
"requires_python": ">=3.8",
"size": 27554140,
"upload_time": "2024-12-15T13:58:37",
"upload_time_iso_8601": "2024-12-15T13:58:37.972009Z",
"url": "https://files.pythonhosted.org/packages/b8/75/b6fb790dc037b2465d8576c1f078d82cdb2747a48037844e34acf4e0db68/cumm_cu124-0.7.11-cp39-cp39-manylinux_2_28_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "350e56f089361052ded75bea12b2882995bc5f00031eb63563f62f6005b13997",
"md5": "218968170dfae2de1ceabb3111c7285f",
"sha256": "68875113e64940ad40e26c2d08aae54112c7bbf27789a9f94c0c04f3963579ae"
},
"downloads": -1,
"filename": "cumm_cu124-0.7.11-cp39-cp39-win_amd64.whl",
"has_sig": false,
"md5_digest": "218968170dfae2de1ceabb3111c7285f",
"packagetype": "bdist_wheel",
"python_version": "cp39",
"requires_python": ">=3.8",
"size": 1221348,
"upload_time": "2024-12-15T13:47:49",
"upload_time_iso_8601": "2024-12-15T13:47:49.935993Z",
"url": "https://files.pythonhosted.org/packages/35/0e/56f089361052ded75bea12b2882995bc5f00031eb63563f62f6005b13997/cumm_cu124-0.7.11-cp39-cp39-win_amd64.whl",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-15 13:58:13",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "FindDefinition",
"github_project": "cumm",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "cumm-cu124"
}