Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit abb115c

Browse files
authored
fix: clarify lora quant support and small fixes (#792)
1 parent c648001 commit abb115c

File tree

5 files changed

+49
-4
lines changed

5 files changed

+49
-4
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@ test/
44
.cache/
55
*.swp
66
.vscode/
7+
.idea/
78
*.bat
89
*.bin
910
*.exe
1011
*.gguf
1112
output*.png
1213
models*
13-
*.log
14+
*.log

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,9 @@ This provides BLAS acceleration using the ROCm cores of your AMD GPU. Make sure
137137
Windows User Refer to [docs/hipBLAS_on_Windows.md](docs%2FhipBLAS_on_Windows.md) for a comprehensive guide.
138138
139139
```
140-
cmake .. -G "Ninja" -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DSD_HIPBLAS=ON -DCMAKE_BUILD_TYPE=Release -DAMDGPU_TARGETS=gfx1100 -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON
140+
export GFX_NAME=$(rocminfo | grep -m 1 -E "gfx[^0]{1}" | sed -e 's/ *Name: *//' | awk '{$1=$1; print}' || echo "rocminfo missing")
141+
echo $GFX_NAME
142+
cmake .. -G "Ninja" -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DSD_HIPBLAS=ON -DCMAKE_BUILD_TYPE=Release -DGPU_TARGETS=$GFX_NAME -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON
141143
cmake --build . --config Release
142144
```
143145

docs/lora.md

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,30 @@ Here's a simple example:
1010
./bin/sd -m ../models/v1-5-pruned-emaonly.safetensors -p "a lovely cat<lora:marblesh:1>" --lora-model-dir ../models
1111
```
1212

13-
`../models/marblesh.safetensors` or `../models/marblesh.ckpt` will be applied to the model
13+
`../models/marblesh.safetensors` or `../models/marblesh.ckpt` will be applied to the model
14+
15+
# Support matrix
16+
17+
> ℹ️ CUDA `get_rows` support is defined here:
18+
> [ggml-org/ggml/src/ggml-cuda/getrows.cu#L156](https://github.com/ggml-org/ggml/blob/7dee1d6a1e7611f238d09be96738388da97c88ed/src/ggml-cuda/getrows.cu#L156)
19+
> Currently only the basic types + Q4/Q5/Q8 are implemented. K-quants are **not** supported.
20+
21+
NOTE: The other backends may have different support.
22+
23+
| Quant / Type | CUDA |
24+
|--------------|------|
25+
| F32 | ✔️ |
26+
| F16 | ✔️ |
27+
| BF16 | ✔️ |
28+
| I32 | ✔️ |
29+
| Q4_0 | ✔️ |
30+
| Q4_1 | ✔️ |
31+
| Q5_0 | ✔️ |
32+
| Q5_1 | ✔️ |
33+
| Q8_0 | ✔️ |
34+
| Q2_K ||
35+
| Q3_K ||
36+
| Q4_K ||
37+
| Q5_K ||
38+
| Q6_K ||
39+
| Q8_K ||

examples/cli/main.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#include <stdio.h>
22
#include <string.h>
33
#include <time.h>
4+
#include <filesystem>
45
#include <functional>
56
#include <iostream>
67
#include <map>
@@ -1283,6 +1284,21 @@ int main(int argc, const char* argv[]) {
12831284
}
12841285
}
12851286

1287+
// create directory if not exists
1288+
{
1289+
namespace fs = std::filesystem;
1290+
const fs::path out_path = params.output_path;
1291+
if (const fs::path out_dir = out_path.parent_path(); !out_dir.empty()) {
1292+
std::error_code ec;
1293+
fs::create_directories(out_dir, ec); // OK if already exists
1294+
if (ec) {
1295+
fprintf(stderr, "failed to create directory '%s': %s\n",
1296+
out_dir.string().c_str(), ec.message().c_str());
1297+
return 1;
1298+
}
1299+
}
1300+
}
1301+
12861302
std::string base_path;
12871303
std::string file_ext;
12881304
std::string file_ext_lower;

stable-diffusion.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ class StableDiffusionGGML {
330330
if (sd_version_is_dit(version)) {
331331
use_t5xxl = true;
332332
}
333-
if (!ggml_backend_is_cpu(backend) && use_t5xxl) {
333+
if (!clip_on_cpu && !ggml_backend_is_cpu(backend) && use_t5xxl) {
334334
LOG_WARN(
335335
"!!!It appears that you are using the T5 model. Some backends may encounter issues with it."
336336
"If you notice that the generated images are completely black,"

0 commit comments

Comments
 (0)