# 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-cu114",
"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": "f4facfed7eaa8e5d309235b813dc44a227d49523b1b33312055c5ce69b7751db",
"md5": "614bf91a349c6ad85deafe9d0b395422",
"sha256": "de1b1b505683b0a1fe07ae6e84a79d11379fada3f974858c4cd43d63390d2dea"
},
"downloads": -1,
"filename": "cumm_cu114-0.7.11-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"has_sig": false,
"md5_digest": "614bf91a349c6ad85deafe9d0b395422",
"packagetype": "bdist_wheel",
"python_version": "cp310",
"requires_python": ">=3.8",
"size": 22873542,
"upload_time": "2024-12-15T13:57:17",
"upload_time_iso_8601": "2024-12-15T13:57:17.038245Z",
"url": "https://files.pythonhosted.org/packages/f4/fa/cfed7eaa8e5d309235b813dc44a227d49523b1b33312055c5ce69b7751db/cumm_cu114-0.7.11-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "1dcbb4fd700cb86c011b140dc8c905d7ed22879bd4ec8ef115957466f5061347",
"md5": "18f868957160500e94a1efe08e78f310",
"sha256": "7460a634ad0945a53a5d6d4569e65637f0adc4b7389c386aad92afb4002013dd"
},
"downloads": -1,
"filename": "cumm_cu114-0.7.11-cp310-cp310-win_amd64.whl",
"has_sig": false,
"md5_digest": "18f868957160500e94a1efe08e78f310",
"packagetype": "bdist_wheel",
"python_version": "cp310",
"requires_python": ">=3.8",
"size": 1220837,
"upload_time": "2024-12-15T13:36:34",
"upload_time_iso_8601": "2024-12-15T13:36:34.160498Z",
"url": "https://files.pythonhosted.org/packages/1d/cb/b4fd700cb86c011b140dc8c905d7ed22879bd4ec8ef115957466f5061347/cumm_cu114-0.7.11-cp310-cp310-win_amd64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "408befb234540df59149c48dce8cafc2e2f3d2676d7a22c4db3a3c88f61936c2",
"md5": "66161882562732bf68e812fc985069ce",
"sha256": "14602e058c233f5b57ced492f7b1b199fe09b806469863985501c05a6fdc2ae3"
},
"downloads": -1,
"filename": "cumm_cu114-0.7.11-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"has_sig": false,
"md5_digest": "66161882562732bf68e812fc985069ce",
"packagetype": "bdist_wheel",
"python_version": "cp311",
"requires_python": ">=3.8",
"size": 22877728,
"upload_time": "2024-12-15T13:57:22",
"upload_time_iso_8601": "2024-12-15T13:57:22.449059Z",
"url": "https://files.pythonhosted.org/packages/40/8b/efb234540df59149c48dce8cafc2e2f3d2676d7a22c4db3a3c88f61936c2/cumm_cu114-0.7.11-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "e44640fceea24a7d43915003831d0a5b714d50c596c0d90c6c77ce7d9fee779e",
"md5": "448ef0eb8204d5b3847b56c3caf34f7d",
"sha256": "fff6896417fa1913a79832bc80e98556a0be188aa44e43cfcbe58fd35732535b"
},
"downloads": -1,
"filename": "cumm_cu114-0.7.11-cp311-cp311-win_amd64.whl",
"has_sig": false,
"md5_digest": "448ef0eb8204d5b3847b56c3caf34f7d",
"packagetype": "bdist_wheel",
"python_version": "cp311",
"requires_python": ">=3.8",
"size": 1221864,
"upload_time": "2024-12-15T13:41:50",
"upload_time_iso_8601": "2024-12-15T13:41:50.852560Z",
"url": "https://files.pythonhosted.org/packages/e4/46/40fceea24a7d43915003831d0a5b714d50c596c0d90c6c77ce7d9fee779e/cumm_cu114-0.7.11-cp311-cp311-win_amd64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "fe6d9811b0158a5ef94db8f23208a7a1ac8291e95f6d102d535638595995a708",
"md5": "93c1946f63065e597449ef4d9dc49f8f",
"sha256": "c5931fe1ecd0e4bd9bf8ffc4826ea388a8709657145241741838b4f2100ee144"
},
"downloads": -1,
"filename": "cumm_cu114-0.7.11-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"has_sig": false,
"md5_digest": "93c1946f63065e597449ef4d9dc49f8f",
"packagetype": "bdist_wheel",
"python_version": "cp312",
"requires_python": ">=3.8",
"size": 22872530,
"upload_time": "2024-12-15T13:57:26",
"upload_time_iso_8601": "2024-12-15T13:57:26.143537Z",
"url": "https://files.pythonhosted.org/packages/fe/6d/9811b0158a5ef94db8f23208a7a1ac8291e95f6d102d535638595995a708/cumm_cu114-0.7.11-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "243635627fef5343dac70cb07d3de9e253515489447957a39c2300cdede41b3a",
"md5": "e175b35ec815aaed0bfc87bd14f930da",
"sha256": "14bfc2a3cb1bce8b78bc2b4db347fea7ecede6ed019832beb5d2043f32811df1"
},
"downloads": -1,
"filename": "cumm_cu114-0.7.11-cp312-cp312-win_amd64.whl",
"has_sig": false,
"md5_digest": "e175b35ec815aaed0bfc87bd14f930da",
"packagetype": "bdist_wheel",
"python_version": "cp312",
"requires_python": ">=3.8",
"size": 1221181,
"upload_time": "2024-12-15T13:39:53",
"upload_time_iso_8601": "2024-12-15T13:39:53.141938Z",
"url": "https://files.pythonhosted.org/packages/24/36/35627fef5343dac70cb07d3de9e253515489447957a39c2300cdede41b3a/cumm_cu114-0.7.11-cp312-cp312-win_amd64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "52b5b8478a85a38f86879eecc674545ab05a9b4dc54c1d679546ca7073084279",
"md5": "d3be441b13fc1e1c93fd88e0bf89be1c",
"sha256": "1aeeafd154030de40b943f98553c8bc15ecc817f0f8db96f876c13cc71a2d702"
},
"downloads": -1,
"filename": "cumm_cu114-0.7.11-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"has_sig": false,
"md5_digest": "d3be441b13fc1e1c93fd88e0bf89be1c",
"packagetype": "bdist_wheel",
"python_version": "cp313",
"requires_python": ">=3.8",
"size": 22876261,
"upload_time": "2024-12-15T13:57:30",
"upload_time_iso_8601": "2024-12-15T13:57:30.927785Z",
"url": "https://files.pythonhosted.org/packages/52/b5/b8478a85a38f86879eecc674545ab05a9b4dc54c1d679546ca7073084279/cumm_cu114-0.7.11-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "062381f6c9fef0a8c66c305dce5a0fb76251c1592910c2abc01b710bd62b9023",
"md5": "d53feaf258653acb4dba821aad7f4edb",
"sha256": "335bfe38c46c6584daf1725ec0c95c6acb50818134556b462948676cc561a255"
},
"downloads": -1,
"filename": "cumm_cu114-0.7.11-cp313-cp313-win_amd64.whl",
"has_sig": false,
"md5_digest": "d53feaf258653acb4dba821aad7f4edb",
"packagetype": "bdist_wheel",
"python_version": "cp313",
"requires_python": ">=3.8",
"size": 1221986,
"upload_time": "2024-12-15T13:40:28",
"upload_time_iso_8601": "2024-12-15T13:40:28.565769Z",
"url": "https://files.pythonhosted.org/packages/06/23/81f6c9fef0a8c66c305dce5a0fb76251c1592910c2abc01b710bd62b9023/cumm_cu114-0.7.11-cp313-cp313-win_amd64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "ca00faa7e4d532f98ce4defae0123dd72e408e6bde35bced35cf15f5f54a6d7f",
"md5": "645dc571114f70688dc34a0eecef4151",
"sha256": "9637932d71e8596f68c3b3a1aad7c3005bb75f98177180dd1c78efbdfb3c6665"
},
"downloads": -1,
"filename": "cumm_cu114-0.7.11-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"has_sig": false,
"md5_digest": "645dc571114f70688dc34a0eecef4151",
"packagetype": "bdist_wheel",
"python_version": "cp39",
"requires_python": ">=3.8",
"size": 22870866,
"upload_time": "2024-12-15T13:57:37",
"upload_time_iso_8601": "2024-12-15T13:57:37.729326Z",
"url": "https://files.pythonhosted.org/packages/ca/00/faa7e4d532f98ce4defae0123dd72e408e6bde35bced35cf15f5f54a6d7f/cumm_cu114-0.7.11-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "0cdeece6cb67df272eb28f922e7df01e87ed27433bd52136f0f9f060c6cfd691",
"md5": "ac76ebad66a23713f0a5719811262613",
"sha256": "b0b3d5ecb778edeea2bad6802bdee27737d1e8912626fe609cee9dd7eb3bc503"
},
"downloads": -1,
"filename": "cumm_cu114-0.7.11-cp39-cp39-win_amd64.whl",
"has_sig": false,
"md5_digest": "ac76ebad66a23713f0a5719811262613",
"packagetype": "bdist_wheel",
"python_version": "cp39",
"requires_python": ">=3.8",
"size": 1220712,
"upload_time": "2024-12-15T13:37:38",
"upload_time_iso_8601": "2024-12-15T13:37:38.157331Z",
"url": "https://files.pythonhosted.org/packages/0c/de/ece6cb67df272eb28f922e7df01e87ed27433bd52136f0f9f060c6cfd691/cumm_cu114-0.7.11-cp39-cp39-win_amd64.whl",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-15 13:57:17",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "FindDefinition",
"github_project": "cumm",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "cumm-cu114"
}