{"id":18525098,"url":"https://github.com/enp1s0/shgemm","last_synced_at":"2025-07-31T06:04:20.382Z","repository":{"id":157058433,"uuid":"448873895","full_name":"enp1s0/shgemm","owner":"enp1s0","description":"Fast multiplication of single-precision and half-precision matrices on Tensor Cores","archived":false,"fork":false,"pushed_at":"2023-04-13T10:53:37.000Z","size":191,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-23T03:04:15.979Z","etag":null,"topics":["cuda"],"latest_commit_sha":null,"homepage":"https://arxiv.org/abs/2304.04612","language":"Cuda","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/enp1s0.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-01-17T11:54:08.000Z","updated_at":"2024-05-30T21:53:07.000Z","dependencies_parsed_at":null,"dependency_job_id":"47b5278a-7b73-4a80-b200-3584187348d1","html_url":"https://github.com/enp1s0/shgemm","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enp1s0%2Fshgemm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enp1s0%2Fshgemm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enp1s0%2Fshgemm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enp1s0%2Fshgemm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/enp1s0","download_url":"https://codeload.github.com/enp1s0/shgemm/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250360479,"owners_count":21417721,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cuda"],"created_at":"2024-11-06T17:44:25.875Z","updated_at":"2025-04-23T03:04:22.822Z","avatar_url":"https://github.com/enp1s0.png","language":"Cuda","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SHGEMM - Single and Half precision GEMM on Tensor Cores\n\n## Build\n```\ngit clone https://github.com/enp1s0/shgemm\ncd shgemm\ngit submodule update --init --recursive\n\nmkdir build\ncd build\ncmake ..\nmake -j4\n```\n\n## Usage\n```cuda\n// sample.cu\n// nvcc sample.cu ... -lshgemm ...\n#include \u003cshgemm/shgemm.hpp\u003e\n\nmtk::shgemm::shgemmHandle_t shgemm_handle;\nmtk::shgemm::create(shgemm_handle);\n\n// Optional\nmtk::shgemm::set_cuda_stream(shgemm_handle, cuda_stream);\n\nconst auto compute_type = mtk::shgemm::tf32;\n\n// SHGEMM (A=float, B=half)\nmtk::shgemm::shgemm(\n\t\t\tshgemm_handle,\n\t\t\tmtk::shgemm::op_n, mtk::shgemm::op_n,\n\t\t\tm, n, k,\n\t\t\t\u0026alpha_fp32,\n\t\t\ta_fp32_ptr, lda,\n\t\t\tb_fp16_ptr, ldb,\n\t\t\t\u0026beta_fp32,\n\t\t\tc_fp32_ptr, ldc,\n\t\t\tcompute_type\n\t\t\t);\n\n// HSGEMM (A=half, B=float) is also available\nmtk::shgemm::hsgemm(\n\t\t\tshgemm_handle,\n\t\t\tmtk::shgemm::op_n, mtk::shgemm::op_n,\n\t\t\tm, n, k,\n\t\t\t\u0026alpha_fp32,\n\t\t\ta_fp16_ptr, lda,\n\t\t\tb_fp32_ptr, ldb,\n\t\t\t\u0026beta_fp32,\n\t\t\tc_fp32_ptr, ldc,\n\t\t\tcompute_type\n\t\t\t);\n\nmtk::shgemm::destroy(shgemm_handle);\n```\n\n## Test\nBefore building the library, please change `BUILD_SHGEMM_TEST` in CMakeLists.txt to `ON` and execute the building commonds again.\n```\n./build/shgemm.test\n```\n\n## Publication\n```bibtex\n@inproceedings{ootomo_shgemm_2023,\n  author = {Ootomo, Hiroyuki and Yokota, Rio},\n  title = {Mixed-Precision Random Projection for RandNLA on Tensor Cores},\n  year = {2023},\n  series = {PASC '23}\n}\n```\n\n## License\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fenp1s0%2Fshgemm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fenp1s0%2Fshgemm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fenp1s0%2Fshgemm/lists"}