{"id":15165667,"url":"https://github.com/jjfumero/corellama2.levelzero","last_synced_at":"2026-01-21T20:36:06.511Z","repository":{"id":250855481,"uuid":"824542314","full_name":"jjfumero/corellama2.levelzero","owner":"jjfumero","description":"PoC  for the acceleration of the core Math functions in Llama2.c to run on GPUs with Shared Memory","archived":false,"fork":false,"pushed_at":"2024-08-05T10:08:12.000Z","size":35,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-14T11:32:59.542Z","etag":null,"topics":["hardware-acceleration","level-zero","llama2","llms","proof-of-concept","spir-v"],"latest_commit_sha":null,"homepage":"","language":"Java","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/jjfumero.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":"2024-07-05T10:59:12.000Z","updated_at":"2024-08-05T10:08:16.000Z","dependencies_parsed_at":"2024-08-05T11:41:03.628Z","dependency_job_id":"43c06fb8-4894-49f7-8d5a-73d2316ffea0","html_url":"https://github.com/jjfumero/corellama2.levelzero","commit_stats":{"total_commits":13,"total_committers":1,"mean_commits":13.0,"dds":0.0,"last_synced_commit":"d53eaf72aab86d7e7eb64d804dcbb82b9c655367"},"previous_names":["jjfumero/corellama2.levelzero"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jjfumero%2Fcorellama2.levelzero","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jjfumero%2Fcorellama2.levelzero/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jjfumero%2Fcorellama2.levelzero/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jjfumero%2Fcorellama2.levelzero/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jjfumero","download_url":"https://codeload.github.com/jjfumero/corellama2.levelzero/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247867365,"owners_count":21009240,"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":["hardware-acceleration","level-zero","llama2","llms","proof-of-concept","spir-v"],"created_at":"2024-09-27T04:01:35.626Z","updated_at":"2026-01-21T20:36:06.470Z","avatar_url":"https://github.com/jjfumero.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Core LLama2.c Math Functions in LevelZero \u0026 SPIR-V\n\n**This repo shows a PoC** with the core math functions in Llama2.c written for OpenCL and compiled to SPIR-V binary.\nThe resulting SPIR-V kernels are dispatched using the Intel Level Zero API for Intel GPUs. \nData is shared using Level Zero Shared Memory and Panama Segments. \n\n## Dependencies\n\n- Intel Compute Runtime (GPU Driver): https://github.com/intel/compute-runtime \n- Intel Level Zero Loader: https://github.com/oneapi-src/level-zero\n- Level Zero JNI: [https://github.com/jjfumero/levelzero-jni](https://github.com/beehive-lab/levelzero-jni)\n\n\n## Build\n\n### 1) Build Intel/LLVM (If needed)\n\n#### Compile OpenCL Kernel to SPIR-V \n\nUse CLANG from the Intel/LLVM Fork: \n\n```bash\ngit clone https://github.com/intel/llvm \ncd llvm \npython buildbot/configure.py\npython buildbot/compile.py\n\n## Export PATH to LLVM\nexport PATH=/home/juan/repos/SPIRV/llvm/build/bin:$PATH\n```\n\nCompile the OpenCL C kernels to SPIR-V using LLVM:\n\n```bash\n./createSPIRVCode.sh\n```\n\n### 2) Build Level Zero JNI Dependency\n\n#### 2.1 Compile Intel Level Zero Library\n\n```bash\ncd $LEVEL_ZERO_ROOT\ngit clone https://github.com/oneapi-src/level-zero.git\ncd level-zero\nmkdir build\ncd build\ncmake ..\ncmake --build . --config Release\ncmake --build . --config Release --target package\n```\n\n#### 2.2 Compile the JNI Library    \n\na) Compile the native code: \n\n```bash\ncd $LEVEL_ZERO_JNI\ngit clone https://github.com/beehive-lab/levelzero-jni.git\nexport ZE_SHARED_LOADER=\"$LEVEL_ZERO_ROOT/build/lib/libze_loader.so\"\nexport CPLUS_INCLUDE_PATH=$LEVEL_ZERO_ROOT/include:$CPLUS_INCLUDE_PATH\nexport C_INCLUDE_PATH=$LEVEL_ZERO_ROOT/include:$CPLUS_INCLUDE_PATH\ncd levelzero-jni/levelZeroLib\nmkdir build\ncd build\ncmake ..\nmake\n```\n\nb) Compile the Java library:\n\n```bash\ncd $LEVEL_ZERO_JNI\nmvn clean install\n```\n\n### 3) Compile `corellama2.levelzero` Java PoC Library\n\n```bash\ngit clone https://github.com/jjfumero/corellama2.levelzero\nmvn clean package\n```\n\n## Run\n\n```bash\n/home/juan/repos/SPIRV/levelzero-jni/levelZeroLib/build/\njava -Djava.library.path=$LEVEL_ZERO_JNI/levelZeroLib/build/ \\\n  -cp target/corellama2.levelzero-1.0-SNAPSHOT.jar:$HOME/.m2/repository/beehive-lab/beehive-levelzero-jni/0.1.3/beehive-levelzero-jni-0.1.3.jar \\\n  --enable-native-access=ALL-UNNAMED \\\n  --enable-preview \\\n  computellms.CoreLLama2LZ\n``` \n\n## License \n\n[MIT](https://github.com/jjfumero/corellama2.levelzero)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjjfumero%2Fcorellama2.levelzero","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjjfumero%2Fcorellama2.levelzero","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjjfumero%2Fcorellama2.levelzero/lists"}