@@ -98,45 +98,57 @@ Ensure you have the following installed and configured:
9898
9999- ** Java 21** : Required for Vector API support & TornadoVM.
100100- [ TornadoVM] ( https://github.com/beehive-lab/TornadoVM ) with OpenCL or PTX backends.
101- - [ Maven ] ( https://maven.apache.org/ ) : For building the Java project .
101+ - GCC/G++ 13 or newer: Required to build and run TornadoVM native components .
102102
103103### Install, Build, and Run
104104
105105When cloning this repository, use the ` --recursive ` flag to ensure that TornadoVM is properly included as submodule:
106106
107107``` bash
108108# Clone the repository with all submodules
109- git clone --recursive https://github.com/beehive-lab/GPULlama3.java.git
109+ git clone https://github.com/beehive-lab/GPULlama3.java.git
110+ ```
110111
111- # Navigate to the project directory
112- cd GPULlama3.java
112+ #### Install the TornadoVM SDK on Linux or macOS
113113
114- # Update the submodules to match the exact commit point recorded in this repository
115- git submodule update --recursive
116- ```
114+ Ensure that your JAVA_HOME points to a supported JDK before using the SDK. Download an SDK package matching your OS, architecture, and accelerator backend (opencl, ptx).
115+ All pre-built SDKs are available on the TornadoVM [ Releases Page] ( https://github.com/beehive-lab/TornadoVM/releases ) .
116+ #After extracting the SDK, add its bin/ directory to your PATH so the ` tornado ` command becomes available.
117+
118+ ##### Linux (x86_64)
117119
118- #### On Linux or macOS
119120``` bash
120- # Enter the TornadoVM submodule directory
121- cd external/tornadovm
121+ wget https://github.com/beehive-lab/TornadoVM/releases/download/v2.1.0/tornadovm-2.1.0-opencl-linux-amd64.zip
122+ unzip tornadovm-2.1.0-opencl-linux-amd64.zip
123+ # Replace <path-to-sdk> manually with the absolute path of the extracted folder
124+ export TORNADO_SDK=" <path-to-sdk>/tornadovm-2.1.0-opencl"
125+ export PATH=$TORNADO_SDK /bin:$PATH
126+
127+ tornado --devices
128+ tornado --version
129+ ```
122130
123- # Optional: Create and activate a Python virtual environment if needed
124- python3 -m venv venv
125- source ./venv/bin/activate
131+ ##### macOS (Apple Silicon)
126132
127- # Install TornadoVM with a supported JDK 21 and select the backends (--backend opencl,ptx).
128- # To see the compatible JDKs run: ./bin/tornadovm-installer --listJDKs
129- # For example, to install with OpenJDK 21 and build the OpenCL backend, run:
130- ./bin/tornadovm-installer --jdk jdk21 --backend opencl
133+ ``` bash
134+ wget https://github.com/beehive-lab/TornadoVM/releases/download/v2.1.0/tornadovm-2.1.0-opencl-mac-aarch64.zip
135+ unzip tornadovm-2.1.0-opencl-mac-aarch64.zip
136+ # Replace <path-to-sdk> manually with the absolute path of the extracted folder
137+ export TORNADO_SDK=" <path-to-sdk>/tornadovm-2.1.0-opencl"
138+ export PATH=$TORNADO_SDK /bin:$PATH
139+
140+ tornado --devices
141+ tornado --version
142+ ```
131143
132- # Source the TornadoVM environment variables
133- source setvars.sh
144+ #### Build the GPULlama3.java
134145
135- # Navigate back to the project root directory
136- cd ../../
146+ ``` bash
147+ # Navigate to the project directory
148+ cd GPULlama3.java
137149
138150# Source the project-specific environment paths -> this will ensure the correct paths are set for the project and the TornadoVM SDK
139- # Expect to see: [INFO] Environment configured for Llama3 with TornadoVM at: /home/YOUR_PATH_TO_TORNADOVM
151+ # Expect to see: [INFO] Environment configured for Llama3 with TornadoVM at: $TORNADO_SDK
140152source set_paths
141153
142154# Build the project using Maven (skip tests for faster build)
@@ -147,38 +159,6 @@ make
147159./llama-tornado --gpu --verbose-init --opencl --model beehive-llama-3.2-1b-instruct-fp16.gguf --prompt " tell me a joke"
148160```
149161
150- #### On Windows
151- ``` bash
152- # Enter the TornadoVM submodule directory
153- cd external/tornadovm
154-
155- # Optional: Create and activate a Python virtual environment if needed
156- python -m venv .venv
157- .venv\S cripts\a ctivate.bat
158- .\b in\w indowsMicrosoftStudioTools2022.cmd
159-
160- # Install TornadoVM with a supported JDK 21 and select the backends (--backend opencl,ptx).
161- # To see the compatible JDKs run: ./bin/tornadovm-installer --listJDKs
162- # For example, to install with OpenJDK 21 and build the OpenCL backend, run:
163- python bin\t ornadovm-installer --jdk jdk21 --backend opencl
164-
165- # Source the TornadoVM environment variables
166- setvars.cmd
167-
168- # Navigate back to the project root directory
169- cd ../../
170-
171- # Source the project-specific environment paths -> this will ensure the correct paths are set for the project and the TornadoVM SDK
172- # Expect to see: [INFO] Environment configured for Llama3 with TornadoVM at: C:\Users\YOUR_PATH_TO_TORNADOVM
173- set_paths.cmd
174-
175- # Build the project using Maven (skip tests for faster build)
176- # mvn clean package -DskipTests or just make
177- make
178-
179- # Run the model (make sure you have downloaded the model file first - see below)
180- python llama-tornado --gpu --verbose-init --opencl --model beehive-llama-3.2-1b-instruct-fp16.gguf --prompt " tell me a joke"
181- ```
182162-----------
183163## 📦 Maven Dependency
184164
@@ -261,83 +241,25 @@ llama-tornado --gpu --model beehive-llama-3.2-1b-instruct-fp16.gguf --prompt "te
261241The above model can we swapped with one of the other models, such as ` beehive-llama-3.2-3b-instruct-fp16.gguf ` or ` beehive-llama-3.2-8b-instruct-fp16.gguf ` , depending on your needs.
262242Check models below.
263243
264- ## Download Model Files
265-
266- Download ` FP16 ` quantized ` Llama-3 ` .gguf files from:
267- - https://huggingface.co/beehive-lab/Llama-3.2-1B-Instruct-GGUF-FP16
268- - https://huggingface.co/beehive-lab/Llama-3.2-3B-Instruct-GGUF-FP16
269- - https://huggingface.co/beehive-lab/Llama-3.2-8B-Instruct-GGUF-FP16
270-
271- Download ` FP16 ` quantized ` Mistral ` .gguf files from:
272- - https://huggingface.co/collections/beehive-lab/mistral-gpullama3java-684afabb206136d2e9cd47e0
244+ ## Collection of Tested Models
273245
274- Download ` FP16 ` quantized ` Qwen3 ` .gguf files from:
275- - https://huggingface.co/ggml-org/Qwen3-0.6B-GGUF
276- - https://huggingface.co/ggml-org/Qwen3-1.7B-GGUF
277- - https://huggingface.co/ggml-org/Qwen3-4B-GGUF
278- - https://huggingface.co/ggml-org/Qwen3-8B-GGUF
279-
280- Download ` FP16 ` quantized ` Qwen2.5 ` .gguf files from:
281- - https://huggingface.co/bartowski/Qwen2.5-0.5B-Instruct-GGUF
282- - https://huggingface.co/Qwen/Qwen2.5-1.5B-Instruct-GGUF
283-
284- Download ` FP16 ` quantized ` DeepSeek-R1-Distill-Qwen ` .gguf files from:
285- - https://huggingface.co/hdnh2006/DeepSeek-R1-Distill-Qwen-1.5B-GGUF
286-
287- Please be gentle with [ huggingface.co] ( https://huggingface.co ) servers:
288-
289- ** Note** FP16 models are first-class citizens for the current version.
290- ```
291- # Llama 3.2 (1B) - FP16
292- wget https://huggingface.co/beehive-lab/Llama-3.2-1B-Instruct-GGUF-FP16/resolve/main/beehive-llama-3.2-1b-instruct-fp16.gguf
246+ ### Llama3.2 Collection
247+ [ https://huggingface.co/collections/beehive-lab/llama3-gpullama3java ] ( https://huggingface.co/collections/beehive-lab/llama3-gpullama3java )
293248
294- # Llama 3.2 (3B) - FP16
295- wget https://huggingface.co/beehive-lab/Llama-3.2-3B-Instruct-GGUF-FP16/resolve/main/ beehive-llama-3.2-3b-instruct-fp16.gguf
249+ ### Qwen 2.5 Collection
250+ [ https://huggingface.co/collections/ beehive-lab/qwen-25-gpullama3java ] ( https://huggingface.co/collections/ beehive-lab/qwen-25-gpullama3java )
296251
297- # Llama 3 (8B) - FP16
298- wget https://huggingface.co/beehive-lab/Llama-3.2-8B-Instruct-GGUF-FP16/resolve/main/ beehive-llama-3.2-8b-instruct-fp16.gguf
252+ ### Qwen 3 Collection
253+ [ https://huggingface.co/collections/ beehive-lab/llama3-gpullama3java ] ( https://huggingface.co/collections/ beehive-lab/qwen-3-gpullama3java )
299254
300- # Mistral (7B) - FP16
301- wget https://huggingface.co/MaziyarPanahi/Mistral-7B-Instruct-v0.3-GGUF/resolve/main/Mistral-7B-Instruct-v0.3.fp16.gguf
255+ ### Phi-3 Collection
256+ [ https://huggingface.co/collections/beehive-lab/llama3-gpullama3java ] ( https://huggingface.co/collections/beehive-lab/phi-3-gpullama3java )
302257
303- # Qwen3 (0.6B) - FP16
304- wget https://huggingface.co/ggml-org/Qwen3-0.6B-GGUF/resolve/main/Qwen3-0.6B-f16.gguf
258+ ### Mistral Collection
259+ [ https://huggingface.co/collections/beehive-lab/llama3-gpullama3java ] ( https://huggingface.co/collections/beehive-lab/mistral-gpullama3java )
305260
306- # Qwen3 (1.7B) - FP16
307- wget https://huggingface.co/ggml-org/Qwen3-0.6B-GGUF/resolve/main/Qwen3-1.7B-f16.gguf
308-
309- # Qwen3 (4B) - FP16
310- wget https://huggingface.co/ggml-org/Qwen3-0.6B-GGUF/resolve/main/Qwen3-4B-f16.gguf
311-
312- # Qwen3 (8B) - FP16
313- wget https://huggingface.co/ggml-org/Qwen3-0.6B-GGUF/resolve/main/Qwen3-8B-f16.gguf
314-
315- # Phi-3-mini-4k - FP16
316- wget https://huggingface.co/microsoft/Phi-3-mini-4k-instruct-gguf/resolve/main/Phi-3-mini-4k-instruct-fp16.gguf
317-
318- # Qwen2.5 (0.5B)
319- wget https://huggingface.co/bartowski/Qwen2.5-0.5B-Instruct-GGUF/resolve/main/Qwen2.5-0.5B-Instruct-f16.gguf
320-
321- # Qwen2.5 (1.5B)
322- wget https://huggingface.co/Qwen/Qwen2.5-1.5B-Instruct-GGUF/resolve/main/qwen2.5-1.5b-instruct-fp16.gguf
323-
324- # DeepSeek-R1-Distill-Qwen (1.5B)
325- wget https://huggingface.co/hdnh2006/DeepSeek-R1-Distill-Qwen-1.5B-GGUF/resolve/main/DeepSeek-R1-Distill-Qwen-1.5B-F16.gguf
326- ```
327-
328- ** [ Experimental] ** you can download the Q8 and Q4 used in the original implementation of Llama3.java, but for now are going to be dequanted to FP16 for TornadoVM support:
329- ```
330- # Llama 3.2 (1B) - Q4_0
331- curl -L -O https://huggingface.co/mukel/Llama-3.2-1B-Instruct-GGUF/resolve/main/Llama-3.2-1B-Instruct-Q4_0.gguf
332- # Llama 3.2 (3B) - Q4_0
333- curl -L -O https://huggingface.co/mukel/Llama-3.2-3B-Instruct-GGUF/resolve/main/Llama-3.2-3B-Instruct-Q4_0.gguf
334- # Llama 3 (8B) - Q4_0
335- curl -L -O https://huggingface.co/mukel/Meta-Llama-3-8B-Instruct-GGUF/resolve/main/Meta-Llama-3-8B-Instruct-Q4_0.gguf
336- # Llama 3.2 (1B) - Q8_0
337- curl -L -O https://huggingface.co/mukel/Llama-3.2-1B-Instruct-GGUF/resolve/main/Llama-3.2-1B-Instruct-Q8_0.gguf
338- # Llama 3.1 (8B) - Q8_0
339- curl -L -O https://huggingface.co/mukel/Meta-Llama-3.1-8B-Instruct-GGUF/resolve/main/Meta-Llama-3.1-8B-Instruct-Q4_0.gguf
340- ```
261+ ### DeepSeek-R1-Distill-Qwen Collection
262+ [ https://huggingface.co/collections/beehive-lab/deepseek-r1-distill-qwen-gpullama3java ] ( https://huggingface.co/collections/beehive-lab/deepseek-r1-distill-qwen-gpullama3java )
341263
342264-----------
343265
0 commit comments