Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Segmentation fault for 3.5-large-turbo #449

Open
DanaNikifor opened this issue Oct 26, 2024 · 14 comments
Open

Segmentation fault for 3.5-large-turbo #449

DanaNikifor opened this issue Oct 26, 2024 · 14 comments

Comments

@DanaNikifor
Copy link

Danilka-Netbook:/mnt/e/stable-diffusion.cpp/build/bin$ ./sd -m /mnt/e/Models/sd3.5_large_turbo-Q4_0.gguf --cfg-scale 1 -
-steps 1 -p "masterpiece, best quality, 1girl, aqua eyes, baseball cap, blonde hair, closed mouth, earrings, green backg
round, hat, hoop earrings, jewellery, looking at viewer, shirt, short hair, simple background, solo, upper body, yellow
shirt" -n "low quality, logo on cap" -v
Option:
n_threads: 4
mode: txt2img
model_path: /mnt/e/Models/sd3.5_large_turbo-Q4_0.gguf
wtype: unspecified
clip_l_path:
clip_g_path:
t5xxl_path:
diffusion_model_path:
vae_path:
taesd_path:
esrgan_path:
controlnet_path:
embeddings_path:
stacked_id_embeddings_path:
input_id_images_path:
style ratio: 20.00
normalize input image : false
output_path: output.png
init_img:
control_image:
clip on cpu: false
controlnet cpu: false
vae decoder on cpu:false
strength(control): 0.90
prompt: masterpiece, best quality, 1girl, aqua eyes, baseball cap, blonde hair, closed mouth, earrings, green background, hat, hoop earrings, jewellery, looking at viewer, shirt, short hair, simple background, solo, upper body, yellow shirt
negative_prompt: low quality, logo on cap
min_cfg: 1.00
cfg_scale: 1.00
guidance: 3.50
clip_skip: -1
width: 512
height: 512
sample_method: euler_a
schedule: default
sample_steps: 1
strength(img2img): 0.75
rng: cuda
seed: 42
batch_count: 1
vae_tiling: false
upscale_repeats: 1
System Info:
BLAS = 0
SSE3 = 1
AVX = 0
AVX2 = 0
AVX512 = 0
AVX512_VBMI = 0
AVX512_VNNI = 0
FMA = 0
NEON = 0
ARM_FMA = 0
F16C = 0
FP16_VA = 0
WASM_SIMD = 0
VSX = 0
[DEBUG] stable-diffusion.cpp:182 - Using CPU backend
[INFO ] stable-diffusion.cpp:197 - loading model from '/mnt/e/Models/sd3.5_large_turbo-Q4_0.gguf'
[INFO ] model.cpp:801 - load /mnt/e/Models/sd3.5_large_turbo-Q4_0.gguf using gguf format
[DEBUG] model.cpp:818 - init from '/mnt/e/Models/sd3.5_large_turbo-Q4_0.gguf'
[INFO ] stable-diffusion.cpp:244 - Version: SD3.5 8B
[INFO ] stable-diffusion.cpp:275 - Weight type: q4_0
Segmentation fault

Help fix it, pls

@stduhpf
Copy link
Contributor

stduhpf commented Oct 26, 2024

This look oddly similar to this #442 (comment).
If you're using city96's quants, I think they are incompatible with sdcpp for some obscure reason. Try quantizing yourself, or use these instead: https://huggingface.co/stduhpf/SD3.5-Large-Turbo-GGUF-mixed-sdcpp

@DanaNikifor
Copy link
Author

OK, I'll try to do it soon

@DanaNikifor
Copy link
Author

No. I couldn't run your model. I also tried to run the model from ND911 https://huggingface.co/ND911/stable-diffusion-3.5-large-Turbo-GGUF/blob/main/sd3.5_large_turbo-Q4_0.gguf and also did not start

@stduhpf
Copy link
Contributor

stduhpf commented Oct 26, 2024

That's odd, I couldn't run City96's quant either, but I tested all of mines at least 3 times each....
Does the full model work?

@SkutteOleg
Copy link
Contributor

You have to specify t5xxl, clip_l and clip_g

@DanaNikifor
Copy link
Author

Why, if the model itself has its own clip and there is no need to add t5xxl?

@DanaNikifor
Copy link
Author

If so, where can I download them?

@DanaNikifor
Copy link
Author

I don't think my laptop can do this. I only have 8GB of RAM.

@stduhpf
Copy link
Contributor

stduhpf commented Oct 26, 2024

@DanaNikifor It should be fine, both models don't need to be in memory at the same time.

@DanaNikifor
Copy link
Author

Danilka-Netbook:/mnt/e/Models$ ./sd -m sd3.5_large_turbo.safetensors --steps 1 -p "masterpiece, best quality, 1girl, aqu
a eyes, baseball cap, blonde hair, closed mouth, earrings, green backg round, hat, hoop earrings, jewellery, looking at
viewer, shirt, short hair, simple background, solo, upper body, yellow shirt" -n "low quality, logo on cap" -v --cfg-sca
le 1
Option:
n_threads: 4
mode: txt2img
model_path: sd3.5_large_turbo.safetensors
wtype: unspecified
clip_l_path:
clip_g_path:
t5xxl_path:
diffusion_model_path:
vae_path:
taesd_path:
esrgan_path:
controlnet_path:
embeddings_path:
stacked_id_embeddings_path:
input_id_images_path:
style ratio: 20.00
normalize input image : false
output_path: output.png
init_img:
control_image:
clip on cpu: false
controlnet cpu: false
vae decoder on cpu:false
strength(control): 0.90
prompt: masterpiece, best quality, 1girl, aqua eyes, baseball cap, blonde hair, closed mouth, earrings, green backg round, hat, hoop earrings, jewellery, looking at viewer, shirt, short hair, simple background, solo, upper body, yellow shirt
negative_prompt: low quality, logo on cap
min_cfg: 1.00
cfg_scale: 1.00
guidance: 3.50
clip_skip: -1
width: 512
height: 512
sample_method: euler_a
schedule: default
sample_steps: 1
strength(img2img): 0.75
rng: cuda
seed: 42
batch_count: 1
vae_tiling: false
upscale_repeats: 1
System Info:
BLAS = 0
SSE3 = 1
AVX = 0
AVX2 = 0
AVX512 = 0
AVX512_VBMI = 0
AVX512_VNNI = 0
FMA = 0
NEON = 0
ARM_FMA = 0
F16C = 0
FP16_VA = 0
WASM_SIMD = 0
VSX = 0
[DEBUG] stable-diffusion.cpp:182 - Using CPU backend
[INFO ] stable-diffusion.cpp:197 - loading model from 'sd3.5_large_turbo.safetensors'
[INFO ] model.cpp:804 - load sd3.5_large_turbo.safetensors using safetensors format
[DEBUG] model.cpp:872 - init from 'sd3.5_large_turbo.safetensors'
[INFO ] stable-diffusion.cpp:244 - Version: SD3.5 8B
[INFO ] stable-diffusion.cpp:275 - Weight type: f32
Segmentation fault

Why?

@SkutteOleg
Copy link
Contributor

SkutteOleg commented Oct 27, 2024

You have to specify t5xxl, clip_l and clip_g

Take a look at #445

@DanaNikifor
Copy link
Author

Danilka-Netbook:/mnt/e/stable-diffusion.cpp/build/bin$ ./sd -m ../../../Models/sd3.5_large_turbo.safetensors --clip_l .
./../../Models/clip/clip_l.safetensors --clip_g ../../../Models/clip/clip_g.safetensors --t5xxl ../../../Models/clip/t5x
xl_fp8_e4m3fn.safetensors --steps 1 --cfg-scale 1 -p 'a lovely cat holding a sign says "Stable diffusion 3.5 Large"'
[INFO ] stable-diffusion.cpp:197 - loading model from '../../../Models/sd3.5_large_turbo.safetensors'
[INFO ] model.cpp:804 - load ../../../Models/sd3.5_large_turbo.safetensors using safetensors format
[INFO ] stable-diffusion.cpp:204 - loading clip_l from '../../../Models/clip/clip_l.safetensors'
[INFO ] model.cpp:804 - load ../../../Models/clip/clip_l.safetensors using safetensors format
[INFO ] stable-diffusion.cpp:211 - loading clip_g from '../../../Models/clip/clip_g.safetensors'
[INFO ] model.cpp:804 - load ../../../Models/clip/clip_g.safetensors using safetensors format
[INFO ] stable-diffusion.cpp:218 - loading t5xxl from '../../../Models/clip/t5xxl_fp8_e4m3fn.safetensors'
[INFO ] model.cpp:804 - load ../../../Models/clip/t5xxl_fp8_e4m3fn.safetensors using safetensors format
[INFO ] stable-diffusion.cpp:244 - Version: SD3.5 8B
[INFO ] stable-diffusion.cpp:275 - Weight type: f32
[INFO ] stable-diffusion.cpp:276 - Conditioner weight type: f16
[INFO ] stable-diffusion.cpp:277 - Diffusion model weight type: f16
[INFO ] stable-diffusion.cpp:278 - VAE weight type: f32
ggml_backend_cpu_buffer_type_alloc_buffer: failed to allocate buffer of size 9525022752
[ERROR] ggml_extend.hpp:1039 - t5 alloc params backend buffer failed, num_tensors = 219
ggml_backend_cpu_buffer_type_alloc_buffer: failed to allocate buffer of size 16532522272
[ERROR] ggml_extend.hpp:1039 - mmdit alloc params backend buffer failed, num_tensors = 923
Segmentation fault
I don't understand why this happened. There is enough RAM

@Green-Sky
Copy link
Contributor

Are you running a 32bit system?

@dsignarius
Copy link

try using '--diffusion-model' instead of '-m' on your commandline if using a gguf quant of model

also if using quants, make sure you have a vae somewhere.

the two above cured my segmentation fault at that point... which was line 277/278 in current sd.cpp

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants