From 05da43b91002c683edbd87a951b86591dcc7cad1 Mon Sep 17 00:00:00 2001 From: Zhang Date: Tue, 30 Jan 2024 14:37:09 +0800 Subject: [PATCH] fix win build --- .github/workflows/build.yml | 2 +- README-sycl.md | 22 ++++++++++--------- examples/sycl/win-run-llama2.bat | 7 +++--- ...install_windows.bat => install_oneapi.bat} | 7 +++--- 4 files changed, 20 insertions(+), 18 deletions(-) rename scripts/{install_windows.bat => install_oneapi.bat} (86%) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ec747568a..c66aa24fd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -42,7 +42,7 @@ jobs: fetch-depth: 0 - name: Install - run: scripts/install_windows.bat $WINDOWS_BASEKIT_URL $WINDOWS_DPCPP_MKL + run: scripts/install_oneapi.bat $WINDOWS_BASEKIT_URL $WINDOWS_DPCPP_MKL - name: Build id: cmake_build diff --git a/README-sycl.md b/README-sycl.md index e5eb0cc83..0c95bf303 100644 --- a/README-sycl.md +++ b/README-sycl.md @@ -275,28 +275,30 @@ b. Download & install make for windows provided by mingw-w64: https://www.mingw- In oneAPI command line window: ``` -mkdir build +mkdir -p build cd build +@call "C:\Program Files (x86)\Intel\oneAPI\setvars.bat" intel64 --force -#for FP16 -#cmake -G "MinGW Makefiles" .. -DLLAMA_SYCL=ON -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icx -DCMAKE_BUILD_TYPE=Release -DLLAMA_SYCL_F16=ON +:: for FP16 +:: faster for long-prompt inference +:: cmake -G "MinGW Makefiles" .. -DLLAMA_SYCL=ON -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icx -DCMAKE_BUILD_TYPE=Release -DLLAMA_SYCL_F16=ON -#for FP32 +:: for FP32 cmake -G "MinGW Makefiles" .. -DLLAMA_SYCL=ON -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icx -DCMAKE_BUILD_TYPE=Release -#build example/main only -#make main -#build all binary +:: build example/main only +:: make main + +:: build all binary make - cd .. ``` or ``` -.\examples\sycl\win-build.bat +.\examples\sycl\win-build-sycl.bat ``` Note: @@ -358,7 +360,7 @@ Set device ID = 0 by **set GGML_SYCL_DEVICE=0** ``` set GGML_SYCL_DEVICE=0 -build\bin\main.exe -m models\llama-2-7b.Q4_0.gguf -p "${INPUT2}" -n 400 -e -ngl 33 -s 0 +build\bin\main.exe -m models\llama-2-7b.Q4_0.gguf -p "Building a website can be done in 10 simple steps:\nStep 1:" -n 400 -e -ngl 33 -s 0 ``` or run by script: diff --git a/examples/sycl/win-run-llama2.bat b/examples/sycl/win-run-llama2.bat index 09a7b9679..28d935541 100644 --- a/examples/sycl/win-run-llama2.bat +++ b/examples/sycl/win-run-llama2.bat @@ -1,7 +1,6 @@ - -rem MIT license -rem Copyright (C) 2024 Intel Corporation -rem SPDX-License-Identifier: MIT +:: MIT license +:: Copyright (C) 2024 Intel Corporation +:: SPDX-License-Identifier: MIT INPUT2="Building a website can be done in 10 simple steps:\nStep 1:" @call "C:\Program Files (x86)\Intel\oneAPI\setvars.bat" intel64 --force diff --git a/scripts/install_windows.bat b/scripts/install_oneapi.bat similarity index 86% rename from scripts/install_windows.bat rename to scripts/install_oneapi.bat index 36b44de7f..94910b8a7 100644 --- a/scripts/install_windows.bat +++ b/scripts/install_oneapi.bat @@ -1,6 +1,7 @@ -REM SPDX-FileCopyrightText: 2022 Intel Corporation -REM -REM SPDX-License-Identifier: MIT +:: MIT license +:: Copyright (C) 2024 Intel Corporation +:: SPDX-License-Identifier: MIT + set URL=%1 set COMPONENTS=%2