Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
a371a94
ggml : improve inputs log sched_print_assignments (ggml/1053)
danbev Dec 19, 2024
0d4d69a
tests: add tests for GGUF (llama/10830)
JohannesGaessler Dec 17, 2024
3aa63a8
tts : add OuteTTS support (llama/10784)
ggerganov Dec 18, 2024
7927fce
ggml : fix arm build (llama/10890)
slaren Dec 18, 2024
58d1a1b
ggml: fix arm build with gcc (llama/10895)
angt Dec 19, 2024
011ca37
ggml : add test for SVE and disable when it fails (llama/10906)
slaren Dec 20, 2024
f86cf2b
SYCL: Migrate away from deprecated ggml_tensor->backend (llama/10840)
qnixsynapse Dec 20, 2024
18bfd31
ggml-cpu: replace NEON asm with intrinsics in ggml_gemv_q4_0_4x8_q8_0…
angt Dec 20, 2024
0914a27
vulkan: optimize coopmat2 dequant functions (llama/10855)
jeffbolznv Dec 21, 2024
6c01a1e
vulkan: build fixes for 32b (llama/10927)
jeffbolznv Dec 22, 2024
b1151f9
ggml : fix run-time on FreeBSD in get_executable_path() (llama/10948)
Dec 23, 2024
ac6af9e
ggml : fix const usage in SSE path (llama/10962)
slaren Dec 23, 2024
6d27ca5
ggml : fix arm enabled features check (llama/10961)
slaren Dec 24, 2024
3edc4b0
ggml : use wstring for backend search paths (llama/10960)
slaren Dec 24, 2024
fbaadc2
ggml : more perfo with llamafile tinyblas on x86_64 (llama/10714)
Djip007 Dec 24, 2024
55a5cf3
examples, ggml : fix GCC compiler warnings (llama/10983)
peter277 Dec 26, 2024
aa0887e
vulkan: multi-row k quants (llama/10846)
netrunnereve Dec 26, 2024
980d41e
vulkan: Use push constant offset to handle misaligned descriptors (ll…
jeffbolznv Dec 29, 2024
c43ba37
vulkan: im2col and matmul optimizations for stable diffusion (llama/1…
jeffbolznv Dec 29, 2024
b9ca755
vulkan: optimize mul_mat for small values of N (llama/10991)
jeffbolznv Dec 30, 2024
11d52f5
ggml : fixes for AVXVNNI instruction set with MSVC and Clang (llama/1…
Srihari-mcw Dec 31, 2024
6a0441b
metal : avoid uint (llama/11019)
ggerganov Jan 3, 2025
0024db8
ggml : do not install metal source when embed library (ggml/1054)
ggerganov Jan 3, 2025
1deb9a6
sync : ggml
ggerganov Jan 3, 2025
5e60c6d
ci : fix arm builds
ggerganov Jan 3, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
124 changes: 121 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
name: CI
on: [push, pull_request]

on:
push:
branches:
- master
pull_request:
types: [opened, synchronize, reopened]

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
cancel-in-progress: true

env:
ubuntu_image: "ubuntu:22.04"
Expand All @@ -12,7 +22,7 @@ jobs:
strategy:
fail-fast: false
matrix:
arch: [linux/amd64, linux/arm64, linux/arm/v7, linux/ppc64le]
arch: [linux/amd64, linux/ppc64le]

steps:
- name: Clone
Expand All @@ -32,6 +42,58 @@ jobs:
cmake -B build
cmake --build build --config Release -j $(nproc)'

ubuntu-latest-arm64:
runs-on: ubuntu-latest-arm64

strategy:
fail-fast: false
matrix:
arch: [linux/arm64, linux/arm/v7]

steps:
- name: Clone
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Build ${{ matrix.arch }}
run: |
docker run --platform ${{ matrix.arch }} --rm \
-v ${{ github.workspace }}:/workspace \
-w /workspace ${{ env.ubuntu_image }} /bin/sh -c '
set -e
apt update
apt install -y build-essential libsdl2-dev cmake
cmake -B build -DGGML_NATIVE=OFF -DGGML_CPU_ARM_ARCH=armv8-a
cmake --build build --config Release -j $(nproc)'

ubuntu-latest-arm-v7:
runs-on: ubuntu-latest-arm-v7

strategy:
fail-fast: false
matrix:
arch: [linux/arm64, linux/arm/v7]

steps:
- name: Clone
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Build ${{ matrix.arch }}
run: |
docker run --platform ${{ matrix.arch }} --rm \
-v ${{ github.workspace }}:/workspace \
-w /workspace ${{ env.ubuntu_image }} /bin/sh -c '
set -e
apt update
apt install -y build-essential libsdl2-dev cmake
cmake -B build -DGGML_NATIVE=OFF -DGGML_CPU_ARM_ARCH=armv7-a+fp
cmake --build build --config Release -j $(nproc)'

macOS-latest:
runs-on: macOS-latest

Expand Down Expand Up @@ -74,7 +136,7 @@ jobs:
fail-fast: false
matrix:
build: [Debug, Release]
arch: [linux/amd64, linux/arm64, linux/arm/v7, linux/ppc64le]
arch: [linux/amd64, linux/ppc64le]

steps:
- name: Clone
Expand All @@ -95,6 +157,62 @@ jobs:
make
ctest -L gh --output-on-failure'

ubuntu-latest-gcc-arm64:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
build: [Debug, Release]
arch: [linux/arm64]

steps:
- name: Clone
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Build ${{ matrix.arch }}
run: |
docker run --platform ${{ matrix.arch }} --rm \
-v ${{ github.workspace }}:/workspace \
-w /workspace ${{ env.ubuntu_image }} /bin/sh -c '
set -e
apt update
apt install -y build-essential cmake libsdl2-dev
cmake . -DWHISPER_SDL2=ON -DCMAKE_BUILD_TYPE=${{ matrix.build }} -DGGML_NATIVE=OFF -DGGML_CPU_ARM_ARCH=armv8-a
make
ctest -L gh --output-on-failure'

ubuntu-latest-gcc-arm-v7:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
build: [Debug, Release]
arch: [linux/arm/v7]

steps:
- name: Clone
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Build ${{ matrix.arch }}
run: |
docker run --platform ${{ matrix.arch }} --rm \
-v ${{ github.workspace }}:/workspace \
-w /workspace ${{ env.ubuntu_image }} /bin/sh -c '
set -e
apt update
apt install -y build-essential cmake libsdl2-dev
cmake . -DWHISPER_SDL2=ON -DCMAKE_BUILD_TYPE=${{ matrix.build }} -DGGML_NATIVE=OFF -DGGML_CPU_ARM_ARCH=armv7-a+fp
make
ctest -L gh --output-on-failure'

ubuntu-latest-clang:
runs-on: ubuntu-latest

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
strategy:
matrix:
config:
- { tag: "main", dockerfile: ".devops/main.Dockerfile", platform: "linux/amd64,linux/arm64" }
- { tag: "main", dockerfile: ".devops/main.Dockerfile", platform: "linux/amd64" }
#TODO: the cuda image keeps failing - disable for now
# https://github.com/ggerganov/whisper.cpp/actions/runs/11019444428/job/30602020339
#- { tag: "main-cuda", dockerfile: ".devops/main-cuda.Dockerfile", platform: "linux/amd64" }
Expand Down
31 changes: 6 additions & 25 deletions ggml/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,10 @@ if (NOT GGML_CUDA_GRAPHS_DEFAULT)
endif()

# general
option(GGML_STATIC "ggml: static link libraries" OFF)
option(GGML_NATIVE "ggml: enable -march=native flag" ${GGML_NATIVE_DEFAULT})
option(GGML_LTO "ggml: enable link time optimization" OFF)
option(GGML_CCACHE "ggml: use ccache if available" ON)
option(GGML_STATIC "ggml: static link libraries" OFF)
option(GGML_NATIVE "ggml: optimize the build for the current system" ${GGML_NATIVE_DEFAULT})
option(GGML_LTO "ggml: enable link time optimization" OFF)
option(GGML_CCACHE "ggml: use ccache if available" ON)

# debug
option(GGML_ALL_WARNINGS "ggml: enable all compiler warnings" ON)
Expand Down Expand Up @@ -120,8 +120,9 @@ endif()
option(GGML_LASX "ggml: enable lasx" ON)
option(GGML_LSX "ggml: enable lsx" ON)
option(GGML_RVV "ggml: enable rvv" ON)
option(GGML_SVE "ggml: enable SVE" OFF)

option(GGML_CPU_ALL_VARIANTS "ggml: build all variants of the CPU backend (requires GGML_BACKEND_DL)" OFF)
set(GGML_CPU_ARM_ARCH "" CACHE STRING "ggml: CPU architecture for ARM")


if (WIN32)
Expand Down Expand Up @@ -251,26 +252,6 @@ set_target_properties(ggml PROPERTIES PUBLIC_HEADER "${GGML_PUBLIC_HEADERS}")
install(TARGETS ggml LIBRARY PUBLIC_HEADER)
install(TARGETS ggml-base LIBRARY)

# FIXME: this should be done in the backend cmake files
if (GGML_METAL)
# FIXME: does this need to be installed with GGML_METAL_EMBED_LIBRARY?
install(
FILES src/ggml-metal/ggml-metal.metal
PERMISSIONS
OWNER_READ
OWNER_WRITE
GROUP_READ
WORLD_READ
DESTINATION ${CMAKE_INSTALL_BINDIR})

if (NOT GGML_METAL_EMBED_LIBRARY)
install(
FILES ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/default.metallib
DESTINATION ${CMAKE_INSTALL_BINDIR}
)
endif()
endif()

if (GGML_STANDALONE)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/ggml.pc.in
${CMAKE_CURRENT_BINARY_DIR}/ggml.pc
Expand Down
41 changes: 29 additions & 12 deletions ggml/include/ggml.h
Original file line number Diff line number Diff line change
Expand Up @@ -1564,17 +1564,6 @@ extern "C" {
int d1, // dilation dimension 1
bool is_2D);

GGML_API struct ggml_tensor * ggml_conv_depthwise_2d(
struct ggml_context * ctx,
struct ggml_tensor * a, // convolution kernel
struct ggml_tensor * b, // data
int s0, // stride dimension 0
int s1, // stride dimension 1
int p0, // padding dimension 0
int p1, // padding dimension 1
int d0, // dilation dimension 0
int d1); // dilation dimension 1

GGML_API struct ggml_tensor * ggml_conv_1d(
struct ggml_context * ctx,
struct ggml_tensor * a, // convolution kernel
Expand All @@ -1592,6 +1581,23 @@ extern "C" {
int s, // stride
int d); // dilation

// depthwise
// TODO: this is very likely wrong for some cases! - needs more testing
GGML_API struct ggml_tensor * ggml_conv_1d_dw(
struct ggml_context * ctx,
struct ggml_tensor * a, // convolution kernel
struct ggml_tensor * b, // data
int s0, // stride
int p0, // padding
int d0); // dilation

GGML_API struct ggml_tensor * ggml_conv_1d_dw_ph(
struct ggml_context * ctx,
struct ggml_tensor * a, // convolution kernel
struct ggml_tensor * b, // data
int s0, // stride
int d0); // dilation

GGML_API struct ggml_tensor * ggml_conv_transpose_1d(
struct ggml_context * ctx,
struct ggml_tensor * a, // convolution kernel
Expand All @@ -1611,7 +1617,6 @@ extern "C" {
int d0, // dilation dimension 0
int d1); // dilation dimension 1


// kernel size is a->ne[0] x a->ne[1]
// stride is equal to kernel size
// padding is zero
Expand All @@ -1638,6 +1643,18 @@ extern "C" {
struct ggml_tensor * a,
struct ggml_tensor * b);

// depthwise
GGML_API struct ggml_tensor * ggml_conv_2d_dw(
struct ggml_context * ctx,
struct ggml_tensor * a, // convolution kernel
struct ggml_tensor * b, // data
int s0, // stride dimension 0
int s1, // stride dimension 1
int p0, // padding dimension 0
int p1, // padding dimension 1
int d0, // dilation dimension 0
int d1); // dilation dimension 1

GGML_API struct ggml_tensor * ggml_conv_transpose_2d_p0(
struct ggml_context * ctx,
struct ggml_tensor * a,
Expand Down
5 changes: 3 additions & 2 deletions ggml/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ function(ggml_add_backend_library backend)
# write the shared library to the output directory
set_target_properties(${backend} PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
target_compile_definitions(${backend} PRIVATE GGML_BACKEND_DL)
add_dependencies(ggml ${backend})
else()
add_library(${backend} ${ARGN})
target_link_libraries(ggml PUBLIC ${backend})
Expand Down Expand Up @@ -289,9 +290,9 @@ if (GGML_CPU_ALL_VARIANTS)
ggml_add_cpu_backend_variant(haswell AVX F16C AVX2 FMA)
ggml_add_cpu_backend_variant(skylakex AVX F16C AVX2 FMA AVX512)
ggml_add_cpu_backend_variant(icelake AVX F16C AVX2 FMA AVX512 AVX512_VBMI AVX512_VNNI)
ggml_add_cpu_backend_variant(alderlake AVX F16C AVX2 FMA AVX_VNNI)
if (NOT MSVC)
# MSVC doesn't support AVX-VNNI or AMX
ggml_add_cpu_backend_variant(alderlake AVX F16C AVX2 FMA AVX_VNNI)
# MSVC doesn't support AMX
ggml_add_cpu_backend_variant(sapphirerapids AVX F16C AVX2 FMA AVX512 AVX512_VBMI AVX512_VNNI AVX512_BF16 AMX_TILE AMX_INT8)
endif()
else ()
Expand Down
Loading
Loading