Skip to content

Commit de75755

Browse files
authored
Merge branch 'ggml-org:master' into mradermacher
2 parents 0c9af15 + 17fc817 commit de75755

File tree

2 files changed

+22
-7
lines changed

2 files changed

+22
-7
lines changed

.github/workflows/release.yml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -260,16 +260,18 @@ jobs:
260260
architecture: ${{ matrix.arch == 'x64' && 'win64' || 'win64a' }}
261261

262262
- name: Build
263+
shell: cmd
263264
env:
264265
CURL_PATH: ${{ steps.get_libcurl.outputs.curl_path }}
265266
run: |
266-
cmake -S . -B build -G "Ninja Multi-Config" `
267-
-D CMAKE_TOOLCHAIN_FILE=cmake/${{ matrix.arch }}-windows-llvm.cmake `
268-
-DGGML_NATIVE=OFF `
269-
-DGGML_BACKEND_DL=ON `
270-
-DGGML_CPU_ALL_VARIANTS=ON `
271-
-DGGML_OPENMP=OFF `
272-
-DCURL_LIBRARY="$env:CURL_PATH/lib/libcurl.dll.a" -DCURL_INCLUDE_DIR="$env:CURL_PATH/include" `
267+
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" ${{ matrix.arch }}
268+
cmake -S . -B build -G "Ninja Multi-Config" ^
269+
-D CMAKE_TOOLCHAIN_FILE=cmake/${{ matrix.arch }}-windows-llvm.cmake ^
270+
-DGGML_NATIVE=OFF ^
271+
-DGGML_BACKEND_DL=ON ^
272+
-DGGML_CPU_ALL_VARIANTS=${{ matrix.arch == 'x64' && 'ON' || 'OFF' }} ^
273+
-DGGML_OPENMP=ON ^
274+
-DCURL_LIBRARY="%CURL_PATH%/lib/libcurl.dll.a" -DCURL_INCLUDE_DIR="%CURL_PATH%/include" ^
273275
${{ env.CMAKE_ARGS }}
274276
cmake --build build --config Release
275277

ggml/src/ggml-cpu/ggml-cpu.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3484,6 +3484,19 @@ void ggml_cpu_init(void) {
34843484
const uint64_t t_end = ggml_time_us(); UNUSED(t_end);
34853485

34863486
GGML_PRINT_DEBUG("%s: GELU, Quick GELU, SILU and EXP tables initialized in %f ms\n", __func__, (t_end - t_start)/1000.0);
3487+
3488+
#ifdef GGML_USE_OPENMP
3489+
//if (!getenv("OMP_WAIT_POLICY")) {
3490+
// // set the wait policy to active, so that OpenMP threads don't sleep
3491+
// putenv("OMP_WAIT_POLICY=active");
3492+
//}
3493+
3494+
if (!getenv("KMP_BLOCKTIME")) {
3495+
// set the time to wait before sleeping a thread
3496+
// this is less aggressive than setting the wait policy to active, but should achieve similar results in most cases
3497+
putenv("KMP_BLOCKTIME=200"); // 200ms
3498+
}
3499+
#endif
34873500
}
34883501

34893502
#if defined(__ARM_ARCH)

0 commit comments

Comments
 (0)