Skip to content

Commit

Permalink
fix win build
Browse files Browse the repository at this point in the history
  • Loading branch information
NeoZhangJianyu committed Jan 30, 2024
1 parent 68fd9f4 commit 05da43b
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
22 changes: 12 additions & 10 deletions README-sycl.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
make
:: build example/main only
:: make main
:: build all binary
make
cd ..
```

or

```
.\examples\sycl\win-build.bat
.\examples\sycl\win-build-sycl.bat
```

Note:
Expand Down Expand Up @@ -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:

Expand Down
7 changes: 3 additions & 4 deletions examples/sycl/win-run-llama2.bat
Original file line number Diff line number Diff line change
@@ -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
Expand Down
7 changes: 4 additions & 3 deletions scripts/install_windows.bat → scripts/install_oneapi.bat
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 05da43b

Please sign in to comment.