LostRuins / koboldcpp

A simple one-file way to run various GGML and GGUF models with KoboldAI's UI
https://github.com/lostruins/koboldcpp
GNU Affero General Public License v3.0
4.36k stars 312 forks source link

try to load llava meta llama 3 gguf #801

Closed fenixlam closed 2 months ago

fenixlam commented 2 months ago
koboldcpp_163.exe --model "knowledge/Meta-Llama-3-8B.Q8_0.gguf" --threads 12 --noshift --smartcontext --contextsize 16384 --usemlock --blasbatchsize 2048 --useclblast 0 0 --gpulayers 2 --bantoken "<0x0A>" --mmproj "knowledge/llava-llama-3-8b-v1_1.Q4_0.gguf" --sdconfig "D:/program/stable-diffusion-webui-directml/models/Stable-diffusion/yesmix_v16Original.safetensors"
***
Welcome to KoboldCpp - Version 1.63
Attempting to use CLBlast library for faster prompt ingestion. A compatible clblast will be required.
Initializing dynamic library: koboldcpp_clblast.dll
==========
Namespace(bantokens=['<0x0A>'], benchmark=None, blasbatchsize=2048, blasthreads=12, chatcompletionsadapter='', config=None, contextsize=16384, debugmode=0, forceversion=0, foreground=False, gpulayers=2, highpriority=False, hordeconfig=None, host='', ignoremissing=False, launch=False, lora=None, mmproj='D:\\program\\koboldcpp\\knowledge\\llava-llama-3-8b-v1_1.Q4_0.gguf', model='knowledge/Meta-Llama-3-8B.Q8_0.gguf', model_param='knowledge/Meta-Llama-3-8B.Q8_0.gguf', multiuser=0, noavx2=False, noblas=False, nocertify=False, nommap=False, noshift=True, onready='', password=None, port=5001, port_param=5001, preloadstory='', quiet=False, remotetunnel=False, ropeconfig=[0.0, 10000.0], sdconfig=['D:/program/stable-diffusion-webui-directml/models/Stable-diffusion/yesmix_v16Original.safetensors'], skiplauncher=False, smartcontext=True, ssl=None, tensor_split=None, threads=12, useclblast=[0, 0], usecublas=None, usemlock=True, usevulkan=None)
==========
Loading model: D:\program\koboldcpp\knowledge\Meta-Llama-3-8B.Q8_0.gguf
[Threads: 12, BlasThreads: 12, SmartContext: True, ContextShift: False]

The reported GGUF Arch is: llama

---
Identified as GGUF model: (ver 6)
Attempting to Load...
---
Using automatic RoPE scaling. If the model has customized RoPE settings, they will be used directly instead!
System Info: AVX = 1 | AVX_VNNI = 0 | AVX2 = 1 | AVX512 = 0 | AVX512_VBMI = 0 | AVX512_VNNI = 0 | FMA = 1 | NEON = 0 | ARM_FMA = 0 | F16C = 1 | FP16_VA = 0 | WASM_SIMD = 0 | BLAS = 1 | SSE3 = 1 | SSSE3 = 1 | VSX = 0 | MATMUL_INT8 = 0 |

Platform:0 Device:0  - AMD Accelerated Parallel Processing with gfx1035
Platform:1 Device:0  - OpenCLOn12 with AMD Radeon(TM) Graphics
Platform:1 Device:1  - OpenCLOn12 with Microsoft Basic Render Driver

ggml_opencl: selecting platform: 'AMD Accelerated Parallel Processing'
ggml_opencl: selecting device: 'gfx1035'
llama_model_loader: loaded meta data with 22 key-value pairs and 291 tensors from D:\program\koboldcpp\knowledge\Meta-Llama-3-8B.Q8_0.gguf (version GGUF V3 (latest))
llm_load_vocab: special tokens definition check successful ( 256/128256 ).
llm_load_print_meta: format           = GGUF V3 (latest)
llm_load_print_meta: arch             = llama
llm_load_print_meta: vocab type       = BPE
llm_load_print_meta: n_vocab          = 128256
llm_load_print_meta: n_merges         = 280147
llm_load_print_meta: n_ctx_train      = 8192
llm_load_print_meta: n_embd           = 4096
llm_load_print_meta: n_head           = 32
llm_load_print_meta: n_head_kv        = 8
llm_load_print_meta: n_layer          = 32
llm_load_print_meta: n_rot            = 128
llm_load_print_meta: n_embd_head_k    = 128
llm_load_print_meta: n_embd_head_v    = 128
llm_load_print_meta: n_gqa            = 4
llm_load_print_meta: n_embd_k_gqa     = 1024
llm_load_print_meta: n_embd_v_gqa     = 1024
llm_load_print_meta: f_norm_eps       = 0.0e+00
llm_load_print_meta: f_norm_rms_eps   = 1.0e-05
llm_load_print_meta: f_clamp_kqv      = 0.0e+00
llm_load_print_meta: f_max_alibi_bias = 0.0e+00
llm_load_print_meta: f_logit_scale    = 0.0e+00
llm_load_print_meta: n_ff             = 14336
llm_load_print_meta: n_expert         = 0
llm_load_print_meta: n_expert_used    = 0
llm_load_print_meta: causal attn      = 1
llm_load_print_meta: pooling type     = 0
llm_load_print_meta: rope type        = 0
llm_load_print_meta: rope scaling     = linear
llm_load_print_meta: freq_base_train  = 500000.0
llm_load_print_meta: freq_scale_train = 1
llm_load_print_meta: n_yarn_orig_ctx  = 8192
llm_load_print_meta: rope_finetuned   = unknown
llm_load_print_meta: ssm_d_conv       = 0
llm_load_print_meta: ssm_d_inner      = 0
llm_load_print_meta: ssm_d_state      = 0
llm_load_print_meta: ssm_dt_rank      = 0
llm_load_print_meta: model type       = 7B
llm_load_print_meta: model ftype      = Q4_0
llm_load_print_meta: model params     = 8.03 B
llm_load_print_meta: model size       = 7.95 GiB (8.50 BPW)
llm_load_print_meta: general.name     = .
llm_load_print_meta: BOS token        = 128000 '<|begin_of_text|>'
llm_load_print_meta: EOS token        = 128001 '<|end_of_text|>'
llm_load_print_meta: LF token         = 128 '?'
llm_load_tensors: ggml ctx size =    0.34 MiB
llm_load_tensors: offloading 2 repeating layers to GPU
llm_load_tensors: offloaded 2/33 layers to GPU
llm_load_tensors:        CPU buffer size =  8137.64 MiB
llm_load_tensors:     OpenCL buffer size =   442.06 MiB
.........................................................................................
Automatic RoPE Scaling: Using (scale:1.000, base:1638400.0).
llama_new_context_with_model: n_ctx      = 16384
llama_new_context_with_model: n_batch    = 2048
llama_new_context_with_model: n_ubatch   = 512
llama_new_context_with_model: freq_base  = 1638400.0
llama_new_context_with_model: freq_scale = 1
llama_kv_cache_init:        CPU KV buffer size =  2048.00 MiB
llama_new_context_with_model: KV self size  = 2048.00 MiB, K (f16): 1024.00 MiB, V (f16): 1024.00 MiB
llama_new_context_with_model:        CPU  output buffer size =     0.49 MiB
llama_new_context_with_model:        CPU compute buffer size =  1088.01 MiB
llama_new_context_with_model: graph nodes  = 1030
llama_new_context_with_model: graph splits = 1

Attempting to apply Multimodal Projector: D:\program\koboldcpp\knowledge\llava-llama-3-8b-v1_1.Q4_0.gguf
key general.description not found in file
Traceback (most recent call last):
  File "koboldcpp.py", line 3220, in <module>
  File "koboldcpp.py", line 2970, in main
  File "koboldcpp.py", line 398, in load_model
OSError: [WinError -1073741569] Windows Error 0xc00000ff
[74840] Failed to execute script 'koboldcpp' due to unhandled exception!

I have checked the sha256 and confirm the llava file does not broken. the llava file is downloaded from: (https://huggingface.co/djward888/llava-llama-3-8b-v1_1-Q4_0-GGUF/blob/main/llava-llama-3-8b-v1_1.Q4_0.gguf) My computer is a GDP4 with 32GB ram, it use AMD 6800U with iGPU, so it shares ram with 3GB vram to load the models. I have try this in mistral 7B with its llava and it run without problem. I wonder if the error is created by memory limit or anything else.

Besides this, when I see the "enable sound, press play" in the 1.63 release page, I do really believe the application begin support sound or music generation, hahahahaa....

LostRuins commented 2 months ago

That is not a mmproj file. You are attempting to load a base model as a projector. The mmproj file should be less than 1gb.

fenixlam commented 2 months ago

Really surprised by the answer, and then I searched huggingface again and found another file. https://huggingface.co/ChaoticNeutrals/Llava_1.5_Llama3_mmproj It works with llama3, really appreciate that. ^_^