Skip to content

Commit 8a0730d

Browse files
committed
Merge branch 'master' into no-text-encoders
2 parents 9a2ef28 + 69b9511 commit 8a0730d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+146218
-2252
lines changed

.clang-tidy

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
Checks: >
2+
modernize-make-shared,
3+
modernize-use-nullptr,
4+
modernize-use-override,
5+
modernize-pass-by-value,
6+
modernize-return-braced-init-list,
7+
modernize-deprecated-headers,
8+
HeaderFilterRegex: '^$'
9+
WarningsAsErrors: ''
10+
FormatStyle: none
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: 🐞 Bug Report
2+
description: Report a bug or unexpected behavior
3+
title: "[Bug] "
4+
labels: ["bug"]
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: |
9+
Please use this template and include as many details as possible to help us reproduce and fix the issue.
10+
- type: textarea
11+
id: commit
12+
attributes:
13+
label: Git commit
14+
description: Which commit are you trying to compile?
15+
placeholder: |
16+
$git rev-parse HEAD
17+
40a6a8710ec15b1b5db6b5a098409f6bc8f654a4
18+
validations:
19+
required: true
20+
- type: input
21+
id: os
22+
attributes:
23+
label: Operating System & Version
24+
placeholder: e.g. “Ubuntu 22.04”, “Windows 11 23H2”, “macOS 14.3”
25+
validations:
26+
required: true
27+
- type: dropdown
28+
id: backends
29+
attributes:
30+
label: GGML backends
31+
description: Which GGML backends do you know to be affected?
32+
options: [CPU, CUDA, HIP, Metal, Musa, SYCL, Vulkan, OpenCL]
33+
multiple: true
34+
validations:
35+
required: true
36+
- type: input
37+
id: cmd_arguments
38+
attributes:
39+
label: Command-line arguments used
40+
placeholder: The full command line you ran (with all flags)
41+
validations:
42+
required: true
43+
- type: textarea
44+
id: steps_to_reproduce
45+
attributes:
46+
label: Steps to reproduce
47+
placeholder: A step-by-step list of what you did
48+
validations:
49+
required: true
50+
- type: textarea
51+
id: expected_behavior
52+
attributes:
53+
label: What you expected to happen
54+
placeholder: Describe the expected behavior or result
55+
validations:
56+
required: true
57+
- type: textarea
58+
id: actual_behavior
59+
attributes:
60+
label: What actually happened
61+
placeholder: Describe what you saw instead (errors, logs, crash, etc.)
62+
validations:
63+
required: true
64+
- type: textarea
65+
id: logs_and_errors
66+
attributes:
67+
label: Logs / error messages / stack trace
68+
placeholder: Paste complete logs or error output
69+
- type: textarea
70+
id: additional_info
71+
attributes:
72+
label: Additional context / environment details
73+
placeholder: e.g. CPU model, GPU, RAM, model file versions, quantization type, etc.
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: 💡 Feature Request
2+
description: Suggest a new feature or improvement
3+
title: "[Feature] "
4+
labels: ["enhancement"]
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: |
9+
Thank you for suggesting an improvement! Please fill in the fields below.
10+
- type: input
11+
id: summary
12+
attributes:
13+
label: Feature Summary
14+
placeholder: A one-line summary of the feature you’d like
15+
validations:
16+
required: true
17+
- type: textarea
18+
id: description
19+
attributes:
20+
label: Detailed Description
21+
placeholder: What problem does this solve? How do you expect it to work?
22+
validations:
23+
required: true
24+
- type: textarea
25+
id: alternatives
26+
attributes:
27+
label: Alternatives you considered
28+
placeholder: Any alternative designs or workarounds you tried
29+
- type: textarea
30+
id: additional_context
31+
attributes:
32+
label: Additional context
33+
placeholder: Any extra information (use cases, related functionalities, constraints)

.github/workflows/build.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ jobs:
149149
runs-on: windows-2025
150150

151151
env:
152-
VULKAN_VERSION: 1.3.261.1
152+
VULKAN_VERSION: 1.4.328.1
153153

154154
strategy:
155155
matrix:
@@ -199,9 +199,9 @@ jobs:
199199
version: 1.11.1
200200
- name: Install Vulkan SDK
201201
id: get_vulkan
202-
if: ${{ matrix.build == 'vulkan' }}
202+
if: ${{ matrix.build == 'vulkan' }} https://sdk.lunarg.com/sdk/download/1.4.328.1/windows/vulkansdk-windows-X64-1.4.328.1.exe
203203
run: |
204-
curl.exe -o $env:RUNNER_TEMP/VulkanSDK-Installer.exe -L "https://sdk.lunarg.com/sdk/download/${env:VULKAN_VERSION}/windows/VulkanSDK-${env:VULKAN_VERSION}-Installer.exe"
204+
curl.exe -o $env:RUNNER_TEMP/VulkanSDK-Installer.exe -L "https://sdk.lunarg.com/sdk/download/${env:VULKAN_VERSION}/windows/vulkansdk-windows-X64-${env:VULKAN_VERSION}.exe"
205205
& "$env:RUNNER_TEMP\VulkanSDK-Installer.exe" --accept-licenses --default-answer --confirm-command install
206206
Add-Content $env:GITHUB_ENV "VULKAN_SDK=C:\VulkanSDK\${env:VULKAN_VERSION}"
207207
Add-Content $env:GITHUB_PATH "C:\VulkanSDK\${env:VULKAN_VERSION}\bin"

CMakeLists.txt

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ option(SD_SYCL "sd: sycl backend" OFF)
3333
option(SD_MUSA "sd: musa backend" OFF)
3434
option(SD_FAST_SOFTMAX "sd: x1.5 faster softmax, indeterministic (sometimes, same seed don't generate same image), cuda only" OFF)
3535
option(SD_BUILD_SHARED_LIBS "sd: build shared libs" OFF)
36+
option(SD_BUILD_SHARED_GGML_LIB "sd: build ggml as a separate shared lib" OFF)
3637
option(SD_USE_SYSTEM_GGML "sd: use system-installed GGML library" OFF)
3738
#option(SD_BUILD_SERVER "sd: build server example" ON)
3839

@@ -86,18 +87,21 @@ file(GLOB SD_LIB_SOURCES
8687
"*.hpp"
8788
)
8889

89-
# we can get only one share lib
9090
if(SD_BUILD_SHARED_LIBS)
9191
message("-- Build shared library")
9292
message(${SD_LIB_SOURCES})
93-
set(BUILD_SHARED_LIBS OFF)
93+
if(NOT SD_BUILD_SHARED_GGML_LIB)
94+
set(BUILD_SHARED_LIBS OFF)
95+
endif()
9496
add_library(${SD_LIB} SHARED ${SD_LIB_SOURCES})
9597
add_definitions(-DSD_BUILD_SHARED_LIB)
9698
target_compile_definitions(${SD_LIB} PRIVATE -DSD_BUILD_DLL)
9799
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
98100
else()
99101
message("-- Build static library")
100-
set(BUILD_SHARED_LIBS OFF)
102+
if(NOT SD_BUILD_SHARED_GGML_LIB)
103+
set(BUILD_SHARED_LIBS OFF)
104+
endif()
101105
add_library(${SD_LIB} STATIC ${SD_LIB_SOURCES})
102106
endif()
103107

Dockerfile

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,21 @@
11
ARG UBUNTU_VERSION=22.04
22

3-
FROM ubuntu:$UBUNTU_VERSION as build
3+
FROM ubuntu:$UBUNTU_VERSION AS build
44

5-
RUN apt-get update && apt-get install -y build-essential git cmake
5+
RUN apt-get update && apt-get install -y --no-install-recommends build-essential git cmake
66

77
WORKDIR /sd.cpp
88

99
COPY . .
1010

11-
RUN mkdir build && cd build && cmake .. && cmake --build . --config Release
11+
RUN cmake . -B ./build
12+
RUN cmake --build ./build --config Release --parallel
1213

13-
FROM ubuntu:$UBUNTU_VERSION as runtime
14+
FROM ubuntu:$UBUNTU_VERSION AS runtime
15+
16+
RUN apt-get update && \
17+
apt-get install --yes --no-install-recommends libgomp1 && \
18+
apt-get clean
1419

1520
COPY --from=build /sd.cpp/build/bin/sd /sd
1621

0 commit comments

Comments
 (0)