Skip to content

Commit 573bb26

Browse files
committed
Merge remote-tracking branch 'upstream/master' into codex/harden-vulkan-turbo4-v-cache
# Conflicts: # tools/ui/CMakeLists.txt
2 parents 6a196d7 + 5d246a7 commit 573bb26

3 files changed

Lines changed: 9 additions & 3 deletions

File tree

examples/convert_legacy_llama.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1308,7 +1308,8 @@ def do_dump_model(model_plus: ModelPlus) -> None:
13081308

13091309
def main(args_in: list[str] | None = None) -> None:
13101310
output_choices = ["f32", "f16"]
1311-
if np.uint32(1) == np.uint32(1).newbyteorder("<"):
1311+
dummy_val = np.uint32(1)
1312+
if dummy_val == dummy_val.view(dummy_val.dtype.newbyteorder("<")):
13121313
# We currently only support Q8_0 output on little endian systems.
13131314
output_choices.append("q8_0")
13141315
parser = argparse.ArgumentParser(description="Convert a LLaMA model to a GGML compatible file")

gguf-py/gguf/quants.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ def quant_shape_from_byte_shape(shape: Sequence[int], quant_type: GGMLQuantizati
2828
# This is faster than np.vectorize and np.apply_along_axis because it works on more than one row at a time
2929
def _apply_over_grouped_rows(func: Callable[[np.ndarray], np.ndarray], arr: np.ndarray, otype: DTypeLike, oshape: tuple[int, ...]) -> np.ndarray:
3030
rows = arr.reshape((-1, arr.shape[-1]))
31+
assert len(rows.shape)
3132
osize = 1
3233
for dim in oshape:
3334
osize *= dim

tools/ui/CMakeLists.txt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,9 @@ if(CMAKE_CROSSCOMPILING)
8787
message(STATUS "UI: building llama-ui-embed with host compiler ${HOST_CXX_COMPILER}")
8888

8989
if(CMAKE_HOST_WIN32)
90-
set(LLAMA_UI_EMBED_EXE "${CMAKE_CURRENT_BINARY_DIR}/llama-ui-embed.exe")
90+
set(LLAMA_UI_EMBED_EXE "${CMAKE_CURRENT_BINARY_DIR}/llama-ui-embed-host.exe")
9191
else()
92-
set(LLAMA_UI_EMBED_EXE "${CMAKE_CURRENT_BINARY_DIR}/llama-ui-embed")
92+
set(LLAMA_UI_EMBED_EXE "${CMAKE_CURRENT_BINARY_DIR}/llama-ui-embed-host")
9393
endif()
9494

9595
add_custom_command(
@@ -146,6 +146,10 @@ add_library(${TARGET} STATIC ${UI_CPP} ${UI_H})
146146
target_compile_features(${TARGET} PRIVATE cxx_std_17)
147147
add_dependencies(${TARGET} llama-ui-assets)
148148

149+
if (BUILD_SHARED_LIBS)
150+
set_target_properties(${TARGET} PROPERTIES POSITION_INDEPENDENT_CODE ON)
151+
endif()
152+
149153
target_include_directories(${TARGET} PUBLIC
150154
${CMAKE_CURRENT_BINARY_DIR}
151155
)

0 commit comments

Comments
 (0)