{"id":20513394,"url":"https://github.com/bruce-lee-ly/cuda_hgemv","last_synced_at":"2025-06-17T09:02:35.157Z","repository":{"id":199298627,"uuid":"702527565","full_name":"Bruce-Lee-LY/cuda_hgemv","owner":"Bruce-Lee-LY","description":"Several optimization methods of half-precision general matrix vector multiplication (HGEMV) using CUDA core.","archived":false,"fork":false,"pushed_at":"2024-09-08T01:08:53.000Z","size":470,"stargazers_count":61,"open_issues_count":0,"forks_count":5,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-05-14T08:47:16.638Z","etag":null,"topics":["cublas","cuda","cuda-core","gemm","gemv","gpu","hgemm","hgemv","matrix-multiply","nvidia","tensor-core"],"latest_commit_sha":null,"homepage":"","language":"Cuda","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Bruce-Lee-LY.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2023-10-09T13:41:23.000Z","updated_at":"2025-04-14T09:47:20.000Z","dependencies_parsed_at":null,"dependency_job_id":"44f617a4-4603-4898-96bb-f1f1625d7730","html_url":"https://github.com/Bruce-Lee-LY/cuda_hgemv","commit_stats":{"total_commits":1,"total_committers":1,"mean_commits":1.0,"dds":0.0,"last_synced_commit":"2ac7e4d15d574bdb19aa472d448525b4f9e3ffba"},"previous_names":["bruce-lee-ly/cuda_hgemv"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Bruce-Lee-LY/cuda_hgemv","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bruce-Lee-LY%2Fcuda_hgemv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bruce-Lee-LY%2Fcuda_hgemv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bruce-Lee-LY%2Fcuda_hgemv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bruce-Lee-LY%2Fcuda_hgemv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Bruce-Lee-LY","download_url":"https://codeload.github.com/Bruce-Lee-LY/cuda_hgemv/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bruce-Lee-LY%2Fcuda_hgemv/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260326620,"owners_count":22992373,"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":["cublas","cuda","cuda-core","gemm","gemv","gpu","hgemm","hgemv","matrix-multiply","nvidia","tensor-core"],"created_at":"2024-11-15T21:10:48.249Z","updated_at":"2025-06-17T09:02:35.127Z","avatar_url":"https://github.com/Bruce-Lee-LY.png","language":"Cuda","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CUDA HGEMV\nSeveral optimization methods of half-precision general matrix vector multiplication (HGEMV) using CUDA core. The calculation expression is as follows, where the precision of matrix A (1 * K), B (K * N) and C (1 * N) is FP16. Through exploring various parallel task design, the current performance between 1 to 4096 dimensions is not less than 150% of the performance of cublas.\n```\nC (1 * N) = A (1 * K) * B (K * N)\n```\n\n![hgemv](./media/images/hgemv.png)\n\n# Optimization Method\n- Thread Naive: each thread computes 1 result of C\n- Thread Smem: each thread computes 1 result of C using shared memory\n- Warp1 Naive: each warp computes 1 result of C\n- Warp1 Smem: each warp computes 1 result of C using shared memory\n- Warp2 Naive: each warp computes 2 results of C\n- Warp2 Smem: each warp computes 2 results of C using shared memory\n- Warp4 Naive: each warp computes 4 results of C\n- Warp4 Smem: each warp computes 4 results of C using shared memory\n- Warp8 Naive: each warp computes 8 results of C\n- Warp8 Smem: each warp computes 8 results of C using shared memory\n- Warp16 Naive: each warp computes 16 results of C\n- Warp16 Smem: each warp computes 16 results of C using shared memory\n\n# Compile\n## Environment\n- OS: Linux\n- Cmake Version: \u003e= 3.12\n- GCC Version: \u003e= 4.8\n- CUDA Version: \u003e= 11.0\n- Others: gflags, ccache\n```\nsudo apt-get install libgflags-dev ccache\n```\n\n## Clone\n```\ngit clone https://github.com/Bruce-Lee-LY/cuda_hgemv.git\n```\n\n## Build\n### NVIDIA A100\n```\ncd cuda_hgemv\n./build.sh -a 80 -t Release -b OFF\n./build.sh -a 80 -t Debug -b OFF\n```\n\n### RTX3080Ti / RTX3090 / RTX A6000\n```\ncd cuda_hgemv\n./build.sh -a 86 -t Release -b OFF\n./build.sh -a 86 -t Debug -b OFF\n```\n\n# Run Sample\n```\n./run_sample.sh\n```\n\n# Performance\nProcess the data in the log and plot it as a line chart.\n\n```\ncd tools/performance\n./performance.sh\n```\n\n## RTX3090\n- CUDA Version: 11.8\n- K: 128\n\nPerformance achieved by current optimization methods.\n\n![throughput](./performance/RTX3090/throughput.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbruce-lee-ly%2Fcuda_hgemv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbruce-lee-ly%2Fcuda_hgemv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbruce-lee-ly%2Fcuda_hgemv/lists"}