Show HN: GPULlama3.java:Llama 模型编译为 PTX/OpenCL,现已集成至 Quarkus
1 分•作者: mikepapadim•19 天前
```
wget <a href="https://github.com/beehive-lab/TornadoVM/releases/download/v2.1.0/tornadovm-2.1.0-opencl-linux-amd64.zip" rel="nofollow">https://github.com/beehive-lab/TornadoVM/releases/download/v...</a>
unzip tornadovm-2.1.0-opencl-linux-amd64.zip
# 手动将 <path-to-sdk> 替换为解压后文件夹的绝对路径
export TORNADO_SDK="<path-to-sdk>/tornadovm-2.1.0-opencl"
export PATH=$TORNADO_SDK/bin:$PATH
tornado --devices
tornado --version
# 导航到项目目录
cd GPULlama3.java
# 导入项目特定的环境变量路径 -> 这将确保
source set_paths
# 使用 Maven 构建项目(跳过测试以加快构建速度)
# mvn clean package -DskipTests 或直接使用 make
make
# 运行模型(请确保您已首先下载了模型文件 - 见下文)
./llama-tornado --gpu --verbose-init --opencl --model beehive-llama-3.2-1b-instruct-fp16.gguf --prompt "告诉我一个笑话"
```
查看原文
wget <a href="https://github.com/beehive-lab/TornadoVM/releases/download/v2.1.0/tornadovm-2.1.0-opencl-linux-amd64.zip" rel="nofollow">https://github.com/beehive-lab/TornadoVM/releases/download/v...</a>
unzip tornadovm-2.1.0-opencl-linux-amd64.zip
# Replace <path-to-sdk> manually with the absolute path of the extracted folder
export TORNADO_SDK="<path-to-sdk>/tornadovm-2.1.0-opencl"
export PATH=$TORNADO_SDK/bin:$PATH<p>tornado --devices
tornado --version<p># Navigate to the project directory
cd GPULlama3.java<p># Source the project-specific environment paths -> this will ensure the
source set_paths<p># Build the project using Maven (skip tests for faster build)
# mvn clean package -DskipTests or just make
make<p># Run the model (make sure you have downloaded the model file first - see below)
./llama-tornado --gpu --verbose-init --opencl --model beehive-llama-3.2-1b-instruct-fp16.gguf --prompt "tell me a joke"