Skip to content

Commit 6530501

Browse files
committed
Merge branch 'upstream' into concedo_experimental
# Conflicts: # README.md # tests/test-chat-template.cpp
2 parents 2dedea9 + 0df0aa8 commit 6530501

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

examples/sycl/win-build-sycl.bat

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ if %errorlevel% neq 0 goto ERROR
1313

1414
:: for FP16
1515
:: faster for long-prompt inference
16-
:: cmake -G "MinGW Makefiles" .. -DLLAMA_SYCL=ON -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icx -DCMAKE_BUILD_TYPE=Release -DLLAMA_SYCL_F16=ON
16+
:: cmake -G "MinGW Makefiles" .. -DLLAMA_SYCL=ON -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icx -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Release -DLLAMA_SYCL_F16=ON
1717

1818
:: for FP32
19-
cmake -G "MinGW Makefiles" .. -DLLAMA_SYCL=ON -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icx -DCMAKE_BUILD_TYPE=Release
19+
cmake -G "MinGW Makefiles" .. -DLLAMA_SYCL=ON -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icx -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Release
2020
if %errorlevel% neq 0 goto ERROR
2121
:: build example/main only
2222
:: make main

ggml-quants.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12145,7 +12145,7 @@ static void quantize_row_iq2_xxs_impl(const float * restrict x, void * restrict
1214512145
printf("\n");
1214612146
GGML_ASSERT(false);
1214712147
}
12148-
q2[2*ib+0] |= (grid_index << 8*k);
12148+
q2[2*ib+0] |= ((uint32_t) grid_index << 8*k);
1214912149
q2[2*ib+1] |= (block_signs[k] << 7*k);
1215012150
}
1215112151
GGML_ASSERT(scale >= 0);

llama.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18170,6 +18170,15 @@ static int32_t llama_chat_apply_template_internal(
1817018170
}
1817118171
}
1817218172
// llama2 templates seem to not care about "add_generation_prompt"
18173+
} else if (tmpl == "phi3" || (tmpl.find("<|assistant|>") != std::string::npos && tmpl.find("<|end|>") != std::string::npos)) {
18174+
// Phi 3
18175+
for (auto message : chat) {
18176+
std::string role(message->role);
18177+
ss << "<|" << role << "|>\n" << message->content << "<|end|>\n";
18178+
}
18179+
if (add_ass) {
18180+
ss << "<|assistant|>\n";
18181+
}
1817318182
} else if (tmpl == "zephyr" || tmpl.find("<|user|>") != std::string::npos) {
1817418183
// zephyr template
1817518184
for (auto message : chat) {
@@ -18302,15 +18311,6 @@ static int32_t llama_chat_apply_template_internal(
1830218311
if (add_ass) {
1830318312
ss << "<|start_header_id|>assistant<|end_header_id|>\n\n";
1830418313
}
18305-
} else if (tmpl == "phi3" || (tmpl.find("<|assistant|>") != std::string::npos && tmpl.find("<|end|>") != std::string::npos )) {
18306-
// Phi 3
18307-
for (auto message : chat) {
18308-
std::string role(message->role);
18309-
ss << "<|" << role << "|>\n" << trim(message->content) << "<|end|>\n";
18310-
}
18311-
if (add_ass) {
18312-
ss << "<|assistant|>\n";
18313-
}
1831418314
} else {
1831518315
// template not supported
1831618316
return -1;

0 commit comments

Comments
 (0)