bug: Failed to create context on M5
Issue description
Consistent "Failed to create context" error from users with Apple M5, no matter the model
Expected Behavior
I would expect models to load correctly on M5 as it does on any other Mac architecture.
Actual Behavior
I am observing a consistent "Failed to create context" error from users with Apple M5 when they try to load the model, no matter the model.
Steps to reproduce
Here's how I load the model and create context:
const llama = await getLlama();
// Load the model using the provided path
const model = await llama.loadModel({
modelPath,
defaultContextFlashAttention: true
});
// Initialize the model context
const context = await model.createContext({
contextSize: {max:4096}
});
// Load the session
const session = new LlamaChatSession({
contextSequence: context.getSequence(),
});
My Environment
| Dependency | Version |
|---|---|
| Operating System | macOS 24.3.0 |
| CPU | Apple M4 Pro |
| Node.js version | 22.21.1 |
| Typescript version | 5.9.3 |
node-llama-cpp version |
3.14.5 |
npx --yes node-llama-cpp inspect gpu output:
Result of running `npx --yes node-llama-cpp inspect gpu`
Additional Context
Please note I have M4 Pro, this issue is related to M5. I noticed it from users analytics but there's no way for me to reproduce. Also note I am using version 3.14.5. I tried to update to the latest 3.15.1 but I experienced this error "A context size of 24 is too large for the available VRAM" frequently and unpredictably for all models.
Relevant Features Used
- [ ] Metal support
- [ ] CUDA support
- [ ] Vulkan support
- [ ] Grammar
- [ ] Function calling
Are you willing to resolve this issue by submitting a Pull Request?
No, I don’t have the time and I’m okay to wait for the community / maintainers to resolve this issue.
@ittaboba I don't have access to an M5 machine to test this, do you have debug logs you could share with me?
In getLlama you can set the logLevel option to "debug" and also set a custom logger to save those logs to a place where you can read them.
Regarding the A context size of 24 is too large for the available VRAM error, it usually happens when you try to create a context with a model that you forced to offload too many layers of to the GPU, and so then the GPU don't have enough VRAM left to create a new context. I recommend leaving the gpuLayers empty (or configuring it to {fitContext: <context size>} if you have a desired context size) so node-llama-cpp could resolve the number of layers to a value that leaves enough VRAM for the context.
On Apple silicone Macs, even though they have unified memory, not all of the memory can be used by Metal; you can see how much memory is available to Metal by running npx --yes node-llama-cpp inspect gpu (or calling llama.getVramState()).
It'd be very helpful if you could run npx --yes node-llama-cpp inspect gpu on your machine and share it with me, as well as running npx --yes node-llama-cpp chat --debug --fa <model URI> with a model that fails to load on you machine so that I can investigate it.
Please also provide me with the link to the model that you used so I can investigate further.
Also, if you can try running npx --yes node-llama-cpp inspect measure --fa <model URI> with the same model it'd be very helpful as well.
Thanks @giladgd, I've never set gpuLayers and I don't have M5 logs atm unfortunately, I'll try to get them in future releases.
Please find below the logs you requested (I run them right after this model failed)
npx --yes node-llama-cpp inspect gpu
OS: macOS 24.3.0 (arm64)
Node: 22.21.1 (arm64)
TypeScript: 5.9.3
node-llama-cpp: 3.15.1
Prebuilt binaries: b7836
Metal: available
Metal device: Apple M4 Pro
Metal used VRAM: 0% (464KB/16GB)
Metal free VRAM: 99.99% (16GB/16GB)
Metal unified memory: 16GB (100%)
CPU model: Apple M4 Pro
Math cores: 8
Used RAM: 97.84% (23.48GB/24GB)
Free RAM: 2.15% (528.95MB/24GB)
Used swap: 0% (0B/0B)
Max swap size: dynamic
mmap: supported
ggml_metal_device_init: tensor API disabled for pre-M5 and pre-A19 devices
npx --yes node-llama-cpp chat --debug --fa '../gpt-oss-20b.MXFP4.gguf'
Log level: debug
load_backend: loaded BLAS backend from /Users/lorenzo/Projects/app/node_modules/@node-llama-cpp/mac-arm64-metal/bins/mac-arm64-metal/libggml-blas.so
ggml_metal_device_init: tensor API disabled for pre-M5 and pre-A19 devices
ggml_metal_library_init: using embedded metal library
ggml_metal_library_init: loaded in 0.007 sec
ggml_metal_rsets_init: creating a residency set collection (keep_alive = 180 s)
ggml_metal_device_init: GPU name: Apple M4 Pro
ggml_metal_device_init: GPU family: MTLGPUFamilyApple9 (1009)
ggml_metal_device_init: GPU family: MTLGPUFamilyCommon3 (3003)
ggml_metal_device_init: GPU family: MTLGPUFamilyMetal3 (5001)
ggml_metal_device_init: simdgroup reduction = true
ggml_metal_device_init: simdgroup matrix mul. = true
ggml_metal_device_init: has unified memory = true
ggml_metal_device_init: has bfloat = true
ggml_metal_device_init: has tensor = false
ggml_metal_device_init: use residency sets = true
ggml_metal_device_init: use shared buffers = true
ggml_metal_device_init: recommendedMaxWorkingSetSize = 17179.89 MB
load_backend: loaded Metal backend from /Users/lorenzo/Projects/app/node_modules/@node-llama-cpp/mac-arm64-metal/bins/mac-arm64-metal/libggml-metal.so
load_backend: loaded CPU backend from /Users/lorenzo/Projects/app/node_modules/@node-llama-cpp/mac-arm64-metal/bins/mac-arm64-metal/libggml-cpu.so
◷ Loading model
llama_model_load_from_file_impl: using device Metal (Apple M4 Pro) (unknown id) - 16383 MiB free
llama_model_loader: direct I/O is not available, using mmap
llama_model_loader: loaded meta data with 38 key-value pairs and 459 tensors from /Users/lorenzo/Library/Application Support/App/models/gpt-oss-20b.MXFP4.gguf (version GGUF V3 (latest))
llama_model_loader: Dumping metadata keys/values. Note: KV overrides do not apply in this output.
llama_model_loader: - kv 0: general.architecture str = gpt-oss
llama_model_loader: - kv 1: general.type str = model
llama_model_loader: - kv 2: general.name str = Gpt Oss 20b
llama_model_loader: - kv 3: general.basename str = gpt-oss
llama_model_loader: - kv 4: general.size_label str = 20B
llama_model_loader: - kv 5: general.license str = apache-2.0
llama_model_loader: - kv 6: general.tags arr[str,2] = ["vllm", "text-generation"]
llama_model_loader: - kv 7: gpt-oss.block_count u32 = 24
llama_model_loader: - kv 8: gpt-oss.context_length u32 = 131072
llama_model_loader: - kv 9: gpt-oss.embedding_length u32 = 2880
llama_model_loader: - kv 10: gpt-oss.feed_forward_length u32 = 2880
llama_model_loader: - kv 11: gpt-oss.attention.head_count u32 = 64
llama_model_loader: - kv 12: gpt-oss.attention.head_count_kv u32 = 8
llama_model_loader: - kv 13: gpt-oss.rope.freq_base f32 = 150000.000000
llama_model_loader: - kv 14: gpt-oss.attention.layer_norm_rms_epsilon f32 = 0.000010
llama_model_loader: - kv 15: gpt-oss.expert_count u32 = 32
llama_model_loader: - kv 16: gpt-oss.expert_used_count u32 = 4
llama_model_loader: - kv 17: gpt-oss.attention.key_length u32 = 64
llama_model_loader: - kv 18: gpt-oss.attention.value_length u32 = 64
llama_model_loader: - kv 19: gpt-oss.attention.sliding_window u32 = 128
llama_model_loader: - kv 20: gpt-oss.expert_feed_forward_length u32 = 2880
llama_model_loader: - kv 21: gpt-oss.rope.scaling.type str = yarn
llama_model_loader: - kv 22: gpt-oss.rope.scaling.factor f32 = 32.000000
llama_model_loader: - kv 23: gpt-oss.rope.scaling.original_context_length u32 = 4096
llama_model_loader: - kv 24: tokenizer.ggml.model str = gpt2
llama_model_loader: - kv 25: tokenizer.ggml.pre str = gpt-4o
llama_model_loader: - kv 26: tokenizer.ggml.tokens arr[str,201088] = ["!", "\"", "#", "$", "%", "&", "'", ...
llama_model_loader: - kv 27: tokenizer.ggml.token_type arr[i32,201088] = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, ...
llama_model_loader: - kv 28: tokenizer.ggml.merges arr[str,446189] = ["Ġ Ġ", "Ġ ĠĠĠ", "ĠĠ ĠĠ", "...
llama_model_loader: - kv 29: tokenizer.ggml.bos_token_id u32 = 199998
llama_model_loader: - kv 30: tokenizer.ggml.eos_token_id u32 = 200002
llama_model_loader: - kv 31: tokenizer.ggml.padding_token_id u32 = 199999
llama_model_loader: - kv 32: giladgd.version str = 1
llama_model_loader: - kv 33: giladgd.quantized_by str = giladgd
llama_model_loader: - kv 34: giladgd.quantized_at str = 2025-08-09T09:45:25+00:00
llama_model_loader: - kv 35: giladgd.source_type str = hf
llama_model_loader: - kv 36: general.quantization_version u32 = 2
llama_model_loader: - kv 37: general.file_type u32 = 38
llama_model_loader: - type f32: 289 tensors
llama_model_loader: - type q8_0: 98 tensors
llama_model_loader: - type mxfp4: 72 tensors
print_info: file format = GGUF V3 (latest)
print_info: file type = MXFP4 MoE
print_info: file size = 11.27 GiB (4.63 BPW)
init_tokenizer: initializing tokenizer for type 2
load: 0 unused tokens
load: control token: 200018 '<|endofprompt|>' is not marked as EOG
load: control token: 200013 '<|reserved_200013|>' is not marked as EOG
load: control token: 200009 '<|reserved_200009|>' is not marked as EOG
load: control token: 200008 '<|message|>' is not marked as EOG
load: control token: 200003 '<|constrain|>' is not marked as EOG
load: control token: 200001 '<|reserved_200001|>' is not marked as EOG
load: control token: 200000 '<|reserved_200000|>' is not marked as EOG
load: control token: 200005 '<|channel|>' is not marked as EOG
load: control token: 200010 '<|reserved_200010|>' is not marked as EOG
load: control token: 199998 '<|startoftext|>' is not marked as EOG
load: control token: 200006 '<|start|>' is not marked as EOG
load: control token: 200017 '<|reserved_200017|>' is not marked as EOG
load: control token: 200016 '<|reserved_200016|>' is not marked as EOG
load: control token: 200004 '<|reserved_200004|>' is not marked as EOG
load: control token: 200014 '<|reserved_200014|>' is not marked as EOG
load: control token: 200015 '<|reserved_200015|>' is not marked as EOG
load: control token: 200011 '<|reserved_200011|>' is not marked as EOG
load: setting token '<|message|>' (200008) attribute to USER_DEFINED (16), old attributes: 8
load: setting token '<|constrain|>' (200003) attribute to USER_DEFINED (16), old attributes: 8
load: setting token '<|channel|>' (200005) attribute to USER_DEFINED (16), old attributes: 8
load: setting token '<|start|>' (200006) attribute to USER_DEFINED (16), old attributes: 8
load: printing all EOG tokens:
load: - 199999 ('<|endoftext|>')
load: - 200002 ('<|return|>')
load: - 200007 ('<|end|>')
load: - 200012 ('<|call|>')
load: special_eog_ids contains both '<|return|>' and '<|call|>', or '<|calls|>' and '<|flush|>' tokens, removing '<|end|>' token from EOG list
load: special tokens cache size = 21
load: token to piece cache size = 1.3332 MB
print_info: arch = gpt-oss
print_info: vocab_only = 0
print_info: no_alloc = 0
print_info: n_ctx_train = 131072
print_info: n_embd = 2880
print_info: n_embd_inp = 2880
print_info: n_layer = 24
print_info: n_head = 64
print_info: n_head_kv = 8
print_info: n_rot = 64
print_info: n_swa = 128
print_info: is_swa_any = 1
print_info: n_embd_head_k = 64
print_info: n_embd_head_v = 64
print_info: n_gqa = 8
print_info: n_embd_k_gqa = 512
print_info: n_embd_v_gqa = 512
print_info: f_norm_eps = 0.0e+00
print_info: f_norm_rms_eps = 1.0e-05
print_info: f_clamp_kqv = 0.0e+00
print_info: f_max_alibi_bias = 0.0e+00
print_info: f_logit_scale = 0.0e+00
print_info: f_attn_scale = 0.0e+00
print_info: n_ff = 2880
print_info: n_expert = 32
print_info: n_expert_used = 4
print_info: n_expert_groups = 0
print_info: n_group_used = 0
print_info: causal attn = 1
print_info: pooling type = 0
print_info: rope type = 2
print_info: rope scaling = yarn
print_info: freq_base_train = 150000.0
print_info: freq_scale_train = 0.03125
print_info: freq_base_swa = 150000.0
print_info: freq_scale_swa = 0.03125
print_info: n_ctx_orig_yarn = 4096
print_info: rope_yarn_log_mul = 0.0000
print_info: rope_finetuned = unknown
print_info: model type = 20B
print_info: model params = 20.91 B
print_info: general.name = Gpt Oss 20b
print_info: n_ff_exp = 2880
print_info: vocab type = BPE
print_info: n_vocab = 201088
print_info: n_merges = 446189
print_info: BOS token = 199998 '<|startoftext|>'
print_info: EOS token = 200002 '<|return|>'
print_info: EOT token = 200007 '<|end|>'
print_info: PAD token = 199999 '<|endoftext|>'
print_info: LF token = 198 'Ċ'
print_info: EOG token = 199999 '<|endoftext|>'
print_info: EOG token = 200002 '<|return|>'
print_info: EOG token = 200012 '<|call|>'
print_info: max token length = 256
load_tensors: loading model tensors, this can take a while... (mmap = true, direct_io = false)
load_tensors: layer 0 assigned to device Metal, is_swa = 1
load_tensors: layer 1 assigned to device Metal, is_swa = 0
load_tensors: layer 2 assigned to device Metal, is_swa = 1
load_tensors: layer 3 assigned to device Metal, is_swa = 0
load_tensors: layer 4 assigned to device Metal, is_swa = 1
load_tensors: layer 5 assigned to device Metal, is_swa = 0
load_tensors: layer 6 assigned to device Metal, is_swa = 1
load_tensors: layer 7 assigned to device Metal, is_swa = 0
load_tensors: layer 8 assigned to device Metal, is_swa = 1
load_tensors: layer 9 assigned to device Metal, is_swa = 0
load_tensors: layer 10 assigned to device Metal, is_swa = 1
load_tensors: layer 11 assigned to device Metal, is_swa = 0
load_tensors: layer 12 assigned to device Metal, is_swa = 1
load_tensors: layer 13 assigned to device Metal, is_swa = 0
load_tensors: layer 14 assigned to device Metal, is_swa = 1
load_tensors: layer 15 assigned to device Metal, is_swa = 0
load_tensors: layer 16 assigned to device Metal, is_swa = 1
load_tensors: layer 17 assigned to device Metal, is_swa = 0
load_tensors: layer 18 assigned to device Metal, is_swa = 1
load_tensors: layer 19 assigned to device Metal, is_swa = 0
load_tensors: layer 20 assigned to device Metal, is_swa = 1
load_tensors: layer 21 assigned to device Metal, is_swa = 0
load_tensors: layer 22 assigned to device Metal, is_swa = 1
load_tensors: layer 23 assigned to device Metal, is_swa = 0
load_tensors: layer 24 assigned to device Metal, is_swa = 0
create_tensor: loading tensor token_embd.weight
create_tensor: loading tensor output_norm.weight
create_tensor: loading tensor output.weight
create_tensor: loading tensor blk.0.attn_norm.weight
create_tensor: loading tensor blk.0.post_attention_norm.weight
create_tensor: loading tensor blk.0.attn_q.weight
create_tensor: loading tensor blk.0.attn_k.weight
create_tensor: loading tensor blk.0.attn_v.weight
create_tensor: loading tensor blk.0.attn_output.weight
create_tensor: loading tensor blk.0.attn_sinks.weight
create_tensor: loading tensor blk.0.ffn_gate_inp.weight
create_tensor: loading tensor blk.0.ffn_gate_exps.weight
create_tensor: loading tensor blk.0.ffn_down_exps.weight
create_tensor: loading tensor blk.0.ffn_up_exps.weight
create_tensor: loading tensor blk.0.attn_q.bias
create_tensor: loading tensor blk.0.attn_k.bias
create_tensor: loading tensor blk.0.attn_v.bias
create_tensor: loading tensor blk.0.attn_output.bias
create_tensor: loading tensor blk.0.ffn_gate_inp.bias
create_tensor: loading tensor blk.0.ffn_gate_exps.bias
create_tensor: loading tensor blk.0.ffn_down_exps.bias
create_tensor: loading tensor blk.0.ffn_up_exps.bias
create_tensor: loading tensor blk.1.attn_norm.weight
create_tensor: loading tensor blk.1.post_attention_norm.weight
create_tensor: loading tensor blk.1.attn_q.weight
create_tensor: loading tensor blk.1.attn_k.weight
create_tensor: loading tensor blk.1.attn_v.weight
create_tensor: loading tensor blk.1.attn_output.weight
create_tensor: loading tensor blk.1.attn_sinks.weight
create_tensor: loading tensor blk.1.ffn_gate_inp.weight
create_tensor: loading tensor blk.1.ffn_gate_exps.weight
create_tensor: loading tensor blk.1.ffn_down_exps.weight
create_tensor: loading tensor blk.1.ffn_up_exps.weight
create_tensor: loading tensor blk.1.attn_q.bias
create_tensor: loading tensor blk.1.attn_k.bias
create_tensor: loading tensor blk.1.attn_v.bias
create_tensor: loading tensor blk.1.attn_output.bias
create_tensor: loading tensor blk.1.ffn_gate_inp.bias
create_tensor: loading tensor blk.1.ffn_gate_exps.bias
create_tensor: loading tensor blk.1.ffn_down_exps.bias
create_tensor: loading tensor blk.1.ffn_up_exps.bias
create_tensor: loading tensor blk.2.attn_norm.weight
create_tensor: loading tensor blk.2.post_attention_norm.weight
create_tensor: loading tensor blk.2.attn_q.weight
create_tensor: loading tensor blk.2.attn_k.weight
create_tensor: loading tensor blk.2.attn_v.weight
create_tensor: loading tensor blk.2.attn_output.weight
create_tensor: loading tensor blk.2.attn_sinks.weight
create_tensor: loading tensor blk.2.ffn_gate_inp.weight
create_tensor: loading tensor blk.2.ffn_gate_exps.weight
create_tensor: loading tensor blk.2.ffn_down_exps.weight
create_tensor: loading tensor blk.2.ffn_up_exps.weight
create_tensor: loading tensor blk.2.attn_q.bias
create_tensor: loading tensor blk.2.attn_k.bias
create_tensor: loading tensor blk.2.attn_v.bias
create_tensor: loading tensor blk.2.attn_output.bias
create_tensor: loading tensor blk.2.ffn_gate_inp.bias
create_tensor: loading tensor blk.2.ffn_gate_exps.bias
create_tensor: loading tensor blk.2.ffn_down_exps.bias
create_tensor: loading tensor blk.2.ffn_up_exps.bias
create_tensor: loading tensor blk.3.attn_norm.weight
create_tensor: loading tensor blk.3.post_attention_norm.weight
create_tensor: loading tensor blk.3.attn_q.weight
create_tensor: loading tensor blk.3.attn_k.weight
create_tensor: loading tensor blk.3.attn_v.weight
create_tensor: loading tensor blk.3.attn_output.weight
create_tensor: loading tensor blk.3.attn_sinks.weight
create_tensor: loading tensor blk.3.ffn_gate_inp.weight
create_tensor: loading tensor blk.3.ffn_gate_exps.weight
create_tensor: loading tensor blk.3.ffn_down_exps.weight
create_tensor: loading tensor blk.3.ffn_up_exps.weight
create_tensor: loading tensor blk.3.attn_q.bias
create_tensor: loading tensor blk.3.attn_k.bias
create_tensor: loading tensor blk.3.attn_v.bias
create_tensor: loading tensor blk.3.attn_output.bias
create_tensor: loading tensor blk.3.ffn_gate_inp.bias
create_tensor: loading tensor blk.3.ffn_gate_exps.bias
create_tensor: loading tensor blk.3.ffn_down_exps.bias
create_tensor: loading tensor blk.3.ffn_up_exps.bias
create_tensor: loading tensor blk.4.attn_norm.weight
create_tensor: loading tensor blk.4.post_attention_norm.weight
create_tensor: loading tensor blk.4.attn_q.weight
create_tensor: loading tensor blk.4.attn_k.weight
create_tensor: loading tensor blk.4.attn_v.weight
create_tensor: loading tensor blk.4.attn_output.weight
create_tensor: loading tensor blk.4.attn_sinks.weight
create_tensor: loading tensor blk.4.ffn_gate_inp.weight
create_tensor: loading tensor blk.4.ffn_gate_exps.weight
create_tensor: loading tensor blk.4.ffn_down_exps.weight
create_tensor: loading tensor blk.4.ffn_up_exps.weight
create_tensor: loading tensor blk.4.attn_q.bias
create_tensor: loading tensor blk.4.attn_k.bias
create_tensor: loading tensor blk.4.attn_v.bias
create_tensor: loading tensor blk.4.attn_output.bias
create_tensor: loading tensor blk.4.ffn_gate_inp.bias
create_tensor: loading tensor blk.4.ffn_gate_exps.bias
create_tensor: loading tensor blk.4.ffn_down_exps.bias
create_tensor: loading tensor blk.4.ffn_up_exps.bias
create_tensor: loading tensor blk.5.attn_norm.weight
create_tensor: loading tensor blk.5.post_attention_norm.weight
create_tensor: loading tensor blk.5.attn_q.weight
create_tensor: loading tensor blk.5.attn_k.weight
create_tensor: loading tensor blk.5.attn_v.weight
create_tensor: loading tensor blk.5.attn_output.weight
create_tensor: loading tensor blk.5.attn_sinks.weight
create_tensor: loading tensor blk.5.ffn_gate_inp.weight
create_tensor: loading tensor blk.5.ffn_gate_exps.weight
create_tensor: loading tensor blk.5.ffn_down_exps.weight
create_tensor: loading tensor blk.5.ffn_up_exps.weight
create_tensor: loading tensor blk.5.attn_q.bias
create_tensor: loading tensor blk.5.attn_k.bias
create_tensor: loading tensor blk.5.attn_v.bias
create_tensor: loading tensor blk.5.attn_output.bias
create_tensor: loading tensor blk.5.ffn_gate_inp.bias
create_tensor: loading tensor blk.5.ffn_gate_exps.bias
create_tensor: loading tensor blk.5.ffn_down_exps.bias
create_tensor: loading tensor blk.5.ffn_up_exps.bias
create_tensor: loading tensor blk.6.attn_norm.weight
create_tensor: loading tensor blk.6.post_attention_norm.weight
create_tensor: loading tensor blk.6.attn_q.weight
create_tensor: loading tensor blk.6.attn_k.weight
create_tensor: loading tensor blk.6.attn_v.weight
create_tensor: loading tensor blk.6.attn_output.weight
create_tensor: loading tensor blk.6.attn_sinks.weight
create_tensor: loading tensor blk.6.ffn_gate_inp.weight
create_tensor: loading tensor blk.6.ffn_gate_exps.weight
create_tensor: loading tensor blk.6.ffn_down_exps.weight
create_tensor: loading tensor blk.6.ffn_up_exps.weight
create_tensor: loading tensor blk.6.attn_q.bias
create_tensor: loading tensor blk.6.attn_k.bias
create_tensor: loading tensor blk.6.attn_v.bias
create_tensor: loading tensor blk.6.attn_output.bias
create_tensor: loading tensor blk.6.ffn_gate_inp.bias
create_tensor: loading tensor blk.6.ffn_gate_exps.bias
create_tensor: loading tensor blk.6.ffn_down_exps.bias
create_tensor: loading tensor blk.6.ffn_up_exps.bias
create_tensor: loading tensor blk.7.attn_norm.weight
create_tensor: loading tensor blk.7.post_attention_norm.weight
create_tensor: loading tensor blk.7.attn_q.weight
create_tensor: loading tensor blk.7.attn_k.weight
create_tensor: loading tensor blk.7.attn_v.weight
create_tensor: loading tensor blk.7.attn_output.weight
create_tensor: loading tensor blk.7.attn_sinks.weight
create_tensor: loading tensor blk.7.ffn_gate_inp.weight
create_tensor: loading tensor blk.7.ffn_gate_exps.weight
create_tensor: loading tensor blk.7.ffn_down_exps.weight
create_tensor: loading tensor blk.7.ffn_up_exps.weight
create_tensor: loading tensor blk.7.attn_q.bias
create_tensor: loading tensor blk.7.attn_k.bias
create_tensor: loading tensor blk.7.attn_v.bias
create_tensor: loading tensor blk.7.attn_output.bias
create_tensor: loading tensor blk.7.ffn_gate_inp.bias
create_tensor: loading tensor blk.7.ffn_gate_exps.bias
create_tensor: loading tensor blk.7.ffn_down_exps.bias
create_tensor: loading tensor blk.7.ffn_up_exps.bias
create_tensor: loading tensor blk.8.attn_norm.weight
create_tensor: loading tensor blk.8.post_attention_norm.weight
create_tensor: loading tensor blk.8.attn_q.weight
create_tensor: loading tensor blk.8.attn_k.weight
create_tensor: loading tensor blk.8.attn_v.weight
create_tensor: loading tensor blk.8.attn_output.weight
create_tensor: loading tensor blk.8.attn_sinks.weight
create_tensor: loading tensor blk.8.ffn_gate_inp.weight
create_tensor: loading tensor blk.8.ffn_gate_exps.weight
create_tensor: loading tensor blk.8.ffn_down_exps.weight
create_tensor: loading tensor blk.8.ffn_up_exps.weight
create_tensor: loading tensor blk.8.attn_q.bias
create_tensor: loading tensor blk.8.attn_k.bias
create_tensor: loading tensor blk.8.attn_v.bias
create_tensor: loading tensor blk.8.attn_output.bias
create_tensor: loading tensor blk.8.ffn_gate_inp.bias
create_tensor: loading tensor blk.8.ffn_gate_exps.bias
create_tensor: loading tensor blk.8.ffn_down_exps.bias
create_tensor: loading tensor blk.8.ffn_up_exps.bias
create_tensor: loading tensor blk.9.attn_norm.weight
create_tensor: loading tensor blk.9.post_attention_norm.weight
create_tensor: loading tensor blk.9.attn_q.weight
create_tensor: loading tensor blk.9.attn_k.weight
create_tensor: loading tensor blk.9.attn_v.weight
create_tensor: loading tensor blk.9.attn_output.weight
create_tensor: loading tensor blk.9.attn_sinks.weight
create_tensor: loading tensor blk.9.ffn_gate_inp.weight
create_tensor: loading tensor blk.9.ffn_gate_exps.weight
create_tensor: loading tensor blk.9.ffn_down_exps.weight
create_tensor: loading tensor blk.9.ffn_up_exps.weight
create_tensor: loading tensor blk.9.attn_q.bias
create_tensor: loading tensor blk.9.attn_k.bias
create_tensor: loading tensor blk.9.attn_v.bias
create_tensor: loading tensor blk.9.attn_output.bias
create_tensor: loading tensor blk.9.ffn_gate_inp.bias
create_tensor: loading tensor blk.9.ffn_gate_exps.bias
create_tensor: loading tensor blk.9.ffn_down_exps.bias
create_tensor: loading tensor blk.9.ffn_up_exps.bias
create_tensor: loading tensor blk.10.attn_norm.weight
create_tensor: loading tensor blk.10.post_attention_norm.weight
create_tensor: loading tensor blk.10.attn_q.weight
create_tensor: loading tensor blk.10.attn_k.weight
create_tensor: loading tensor blk.10.attn_v.weight
create_tensor: loading tensor blk.10.attn_output.weight
create_tensor: loading tensor blk.10.attn_sinks.weight
create_tensor: loading tensor blk.10.ffn_gate_inp.weight
create_tensor: loading tensor blk.10.ffn_gate_exps.weight
create_tensor: loading tensor blk.10.ffn_down_exps.weight
create_tensor: loading tensor blk.10.ffn_up_exps.weight
create_tensor: loading tensor blk.10.attn_q.bias
create_tensor: loading tensor blk.10.attn_k.bias
create_tensor: loading tensor blk.10.attn_v.bias
create_tensor: loading tensor blk.10.attn_output.bias
create_tensor: loading tensor blk.10.ffn_gate_inp.bias
create_tensor: loading tensor blk.10.ffn_gate_exps.bias
create_tensor: loading tensor blk.10.ffn_down_exps.bias
create_tensor: loading tensor blk.10.ffn_up_exps.bias
create_tensor: loading tensor blk.11.attn_norm.weight
create_tensor: loading tensor blk.11.post_attention_norm.weight
create_tensor: loading tensor blk.11.attn_q.weight
create_tensor: loading tensor blk.11.attn_k.weight
create_tensor: loading tensor blk.11.attn_v.weight
create_tensor: loading tensor blk.11.attn_output.weight
create_tensor: loading tensor blk.11.attn_sinks.weight
create_tensor: loading tensor blk.11.ffn_gate_inp.weight
create_tensor: loading tensor blk.11.ffn_gate_exps.weight
create_tensor: loading tensor blk.11.ffn_down_exps.weight
create_tensor: loading tensor blk.11.ffn_up_exps.weight
create_tensor: loading tensor blk.11.attn_q.bias
create_tensor: loading tensor blk.11.attn_k.bias
create_tensor: loading tensor blk.11.attn_v.bias
create_tensor: loading tensor blk.11.attn_output.bias
create_tensor: loading tensor blk.11.ffn_gate_inp.bias
create_tensor: loading tensor blk.11.ffn_gate_exps.bias
create_tensor: loading tensor blk.11.ffn_down_exps.bias
create_tensor: loading tensor blk.11.ffn_up_exps.bias
create_tensor: loading tensor blk.12.attn_norm.weight
create_tensor: loading tensor blk.12.post_attention_norm.weight
create_tensor: loading tensor blk.12.attn_q.weight
create_tensor: loading tensor blk.12.attn_k.weight
create_tensor: loading tensor blk.12.attn_v.weight
create_tensor: loading tensor blk.12.attn_output.weight
create_tensor: loading tensor blk.12.attn_sinks.weight
create_tensor: loading tensor blk.12.ffn_gate_inp.weight
create_tensor: loading tensor blk.12.ffn_gate_exps.weight
create_tensor: loading tensor blk.12.ffn_down_exps.weight
create_tensor: loading tensor blk.12.ffn_up_exps.weight
create_tensor: loading tensor blk.12.attn_q.bias
create_tensor: loading tensor blk.12.attn_k.bias
create_tensor: loading tensor blk.12.attn_v.bias
create_tensor: loading tensor blk.12.attn_output.bias
create_tensor: loading tensor blk.12.ffn_gate_inp.bias
create_tensor: loading tensor blk.12.ffn_gate_exps.bias
create_tensor: loading tensor blk.12.ffn_down_exps.bias
create_tensor: loading tensor blk.12.ffn_up_exps.bias
create_tensor: loading tensor blk.13.attn_norm.weight
create_tensor: loading tensor blk.13.post_attention_norm.weight
create_tensor: loading tensor blk.13.attn_q.weight
create_tensor: loading tensor blk.13.attn_k.weight
create_tensor: loading tensor blk.13.attn_v.weight
create_tensor: loading tensor blk.13.attn_output.weight
create_tensor: loading tensor blk.13.attn_sinks.weight
create_tensor: loading tensor blk.13.ffn_gate_inp.weight
create_tensor: loading tensor blk.13.ffn_gate_exps.weight
create_tensor: loading tensor blk.13.ffn_down_exps.weight
create_tensor: loading tensor blk.13.ffn_up_exps.weight
create_tensor: loading tensor blk.13.attn_q.bias
create_tensor: loading tensor blk.13.attn_k.bias
create_tensor: loading tensor blk.13.attn_v.bias
create_tensor: loading tensor blk.13.attn_output.bias
create_tensor: loading tensor blk.13.ffn_gate_inp.bias
create_tensor: loading tensor blk.13.ffn_gate_exps.bias
create_tensor: loading tensor blk.13.ffn_down_exps.bias
create_tensor: loading tensor blk.13.ffn_up_exps.bias
create_tensor: loading tensor blk.14.attn_norm.weight
create_tensor: loading tensor blk.14.post_attention_norm.weight
create_tensor: loading tensor blk.14.attn_q.weight
create_tensor: loading tensor blk.14.attn_k.weight
create_tensor: loading tensor blk.14.attn_v.weight
create_tensor: loading tensor blk.14.attn_output.weight
create_tensor: loading tensor blk.14.attn_sinks.weight
create_tensor: loading tensor blk.14.ffn_gate_inp.weight
create_tensor: loading tensor blk.14.ffn_gate_exps.weight
create_tensor: loading tensor blk.14.ffn_down_exps.weight
create_tensor: loading tensor blk.14.ffn_up_exps.weight
create_tensor: loading tensor blk.14.attn_q.bias
create_tensor: loading tensor blk.14.attn_k.bias
create_tensor: loading tensor blk.14.attn_v.bias
create_tensor: loading tensor blk.14.attn_output.bias
create_tensor: loading tensor blk.14.ffn_gate_inp.bias
create_tensor: loading tensor blk.14.ffn_gate_exps.bias
create_tensor: loading tensor blk.14.ffn_down_exps.bias
create_tensor: loading tensor blk.14.ffn_up_exps.bias
create_tensor: loading tensor blk.15.attn_norm.weight
create_tensor: loading tensor blk.15.post_attention_norm.weight
create_tensor: loading tensor blk.15.attn_q.weight
create_tensor: loading tensor blk.15.attn_k.weight
create_tensor: loading tensor blk.15.attn_v.weight
create_tensor: loading tensor blk.15.attn_output.weight
create_tensor: loading tensor blk.15.attn_sinks.weight
create_tensor: loading tensor blk.15.ffn_gate_inp.weight
create_tensor: loading tensor blk.15.ffn_gate_exps.weight
create_tensor: loading tensor blk.15.ffn_down_exps.weight
create_tensor: loading tensor blk.15.ffn_up_exps.weight
create_tensor: loading tensor blk.15.attn_q.bias
create_tensor: loading tensor blk.15.attn_k.bias
create_tensor: loading tensor blk.15.attn_v.bias
create_tensor: loading tensor blk.15.attn_output.bias
create_tensor: loading tensor blk.15.ffn_gate_inp.bias
create_tensor: loading tensor blk.15.ffn_gate_exps.bias
create_tensor: loading tensor blk.15.ffn_down_exps.bias
create_tensor: loading tensor blk.15.ffn_up_exps.bias
create_tensor: loading tensor blk.16.attn_norm.weight
create_tensor: loading tensor blk.16.post_attention_norm.weight
create_tensor: loading tensor blk.16.attn_q.weight
create_tensor: loading tensor blk.16.attn_k.weight
create_tensor: loading tensor blk.16.attn_v.weight
create_tensor: loading tensor blk.16.attn_output.weight
create_tensor: loading tensor blk.16.attn_sinks.weight
create_tensor: loading tensor blk.16.ffn_gate_inp.weight
create_tensor: loading tensor blk.16.ffn_gate_exps.weight
create_tensor: loading tensor blk.16.ffn_down_exps.weight
create_tensor: loading tensor blk.16.ffn_up_exps.weight
create_tensor: loading tensor blk.16.attn_q.bias
create_tensor: loading tensor blk.16.attn_k.bias
create_tensor: loading tensor blk.16.attn_v.bias
create_tensor: loading tensor blk.16.attn_output.bias
create_tensor: loading tensor blk.16.ffn_gate_inp.bias
create_tensor: loading tensor blk.16.ffn_gate_exps.bias
create_tensor: loading tensor blk.16.ffn_down_exps.bias
create_tensor: loading tensor blk.16.ffn_up_exps.bias
create_tensor: loading tensor blk.17.attn_norm.weight
create_tensor: loading tensor blk.17.post_attention_norm.weight
create_tensor: loading tensor blk.17.attn_q.weight
create_tensor: loading tensor blk.17.attn_k.weight
create_tensor: loading tensor blk.17.attn_v.weight
create_tensor: loading tensor blk.17.attn_output.weight
create_tensor: loading tensor blk.17.attn_sinks.weight
create_tensor: loading tensor blk.17.ffn_gate_inp.weight
create_tensor: loading tensor blk.17.ffn_gate_exps.weight
create_tensor: loading tensor blk.17.ffn_down_exps.weight
create_tensor: loading tensor blk.17.ffn_up_exps.weight
create_tensor: loading tensor blk.17.attn_q.bias
create_tensor: loading tensor blk.17.attn_k.bias
create_tensor: loading tensor blk.17.attn_v.bias
create_tensor: loading tensor blk.17.attn_output.bias
create_tensor: loading tensor blk.17.ffn_gate_inp.bias
create_tensor: loading tensor blk.17.ffn_gate_exps.bias
create_tensor: loading tensor blk.17.ffn_down_exps.bias
create_tensor: loading tensor blk.17.ffn_up_exps.bias
create_tensor: loading tensor blk.18.attn_norm.weight
create_tensor: loading tensor blk.18.post_attention_norm.weight
create_tensor: loading tensor blk.18.attn_q.weight
create_tensor: loading tensor blk.18.attn_k.weight
create_tensor: loading tensor blk.18.attn_v.weight
create_tensor: loading tensor blk.18.attn_output.weight
create_tensor: loading tensor blk.18.attn_sinks.weight
create_tensor: loading tensor blk.18.ffn_gate_inp.weight
create_tensor: loading tensor blk.18.ffn_gate_exps.weight
create_tensor: loading tensor blk.18.ffn_down_exps.weight
create_tensor: loading tensor blk.18.ffn_up_exps.weight
create_tensor: loading tensor blk.18.attn_q.bias
create_tensor: loading tensor blk.18.attn_k.bias
create_tensor: loading tensor blk.18.attn_v.bias
create_tensor: loading tensor blk.18.attn_output.bias
create_tensor: loading tensor blk.18.ffn_gate_inp.bias
create_tensor: loading tensor blk.18.ffn_gate_exps.bias
create_tensor: loading tensor blk.18.ffn_down_exps.bias
create_tensor: loading tensor blk.18.ffn_up_exps.bias
create_tensor: loading tensor blk.19.attn_norm.weight
create_tensor: loading tensor blk.19.post_attention_norm.weight
create_tensor: loading tensor blk.19.attn_q.weight
create_tensor: loading tensor blk.19.attn_k.weight
create_tensor: loading tensor blk.19.attn_v.weight
create_tensor: loading tensor blk.19.attn_output.weight
create_tensor: loading tensor blk.19.attn_sinks.weight
create_tensor: loading tensor blk.19.ffn_gate_inp.weight
create_tensor: loading tensor blk.19.ffn_gate_exps.weight
create_tensor: loading tensor blk.19.ffn_down_exps.weight
create_tensor: loading tensor blk.19.ffn_up_exps.weight
create_tensor: loading tensor blk.19.attn_q.bias
create_tensor: loading tensor blk.19.attn_k.bias
create_tensor: loading tensor blk.19.attn_v.bias
create_tensor: loading tensor blk.19.attn_output.bias
create_tensor: loading tensor blk.19.ffn_gate_inp.bias
create_tensor: loading tensor blk.19.ffn_gate_exps.bias
create_tensor: loading tensor blk.19.ffn_down_exps.bias
create_tensor: loading tensor blk.19.ffn_up_exps.bias
create_tensor: loading tensor blk.20.attn_norm.weight
create_tensor: loading tensor blk.20.post_attention_norm.weight
create_tensor: loading tensor blk.20.attn_q.weight
create_tensor: loading tensor blk.20.attn_k.weight
create_tensor: loading tensor blk.20.attn_v.weight
create_tensor: loading tensor blk.20.attn_output.weight
create_tensor: loading tensor blk.20.attn_sinks.weight
create_tensor: loading tensor blk.20.ffn_gate_inp.weight
create_tensor: loading tensor blk.20.ffn_gate_exps.weight
create_tensor: loading tensor blk.20.ffn_down_exps.weight
create_tensor: loading tensor blk.20.ffn_up_exps.weight
create_tensor: loading tensor blk.20.attn_q.bias
create_tensor: loading tensor blk.20.attn_k.bias
create_tensor: loading tensor blk.20.attn_v.bias
create_tensor: loading tensor blk.20.attn_output.bias
create_tensor: loading tensor blk.20.ffn_gate_inp.bias
create_tensor: loading tensor blk.20.ffn_gate_exps.bias
create_tensor: loading tensor blk.20.ffn_down_exps.bias
create_tensor: loading tensor blk.20.ffn_up_exps.bias
create_tensor: loading tensor blk.21.attn_norm.weight
create_tensor: loading tensor blk.21.post_attention_norm.weight
create_tensor: loading tensor blk.21.attn_q.weight
create_tensor: loading tensor blk.21.attn_k.weight
create_tensor: loading tensor blk.21.attn_v.weight
create_tensor: loading tensor blk.21.attn_output.weight
create_tensor: loading tensor blk.21.attn_sinks.weight
create_tensor: loading tensor blk.21.ffn_gate_inp.weight
create_tensor: loading tensor blk.21.ffn_gate_exps.weight
create_tensor: loading tensor blk.21.ffn_down_exps.weight
create_tensor: loading tensor blk.21.ffn_up_exps.weight
create_tensor: loading tensor blk.21.attn_q.bias
create_tensor: loading tensor blk.21.attn_k.bias
create_tensor: loading tensor blk.21.attn_v.bias
create_tensor: loading tensor blk.21.attn_output.bias
create_tensor: loading tensor blk.21.ffn_gate_inp.bias
create_tensor: loading tensor blk.21.ffn_gate_exps.bias
create_tensor: loading tensor blk.21.ffn_down_exps.bias
create_tensor: loading tensor blk.21.ffn_up_exps.bias
create_tensor: loading tensor blk.22.attn_norm.weight
create_tensor: loading tensor blk.22.post_attention_norm.weight
create_tensor: loading tensor blk.22.attn_q.weight
create_tensor: loading tensor blk.22.attn_k.weight
create_tensor: loading tensor blk.22.attn_v.weight
create_tensor: loading tensor blk.22.attn_output.weight
create_tensor: loading tensor blk.22.attn_sinks.weight
create_tensor: loading tensor blk.22.ffn_gate_inp.weight
create_tensor: loading tensor blk.22.ffn_gate_exps.weight
create_tensor: loading tensor blk.22.ffn_down_exps.weight
create_tensor: loading tensor blk.22.ffn_up_exps.weight
create_tensor: loading tensor blk.22.attn_q.bias
create_tensor: loading tensor blk.22.attn_k.bias
create_tensor: loading tensor blk.22.attn_v.bias
create_tensor: loading tensor blk.22.attn_output.bias
create_tensor: loading tensor blk.22.ffn_gate_inp.bias
create_tensor: loading tensor blk.22.ffn_gate_exps.bias
create_tensor: loading tensor blk.22.ffn_down_exps.bias
create_tensor: loading tensor blk.22.ffn_up_exps.bias
create_tensor: loading tensor blk.23.attn_norm.weight
create_tensor: loading tensor blk.23.post_attention_norm.weight
create_tensor: loading tensor blk.23.attn_q.weight
create_tensor: loading tensor blk.23.attn_k.weight
create_tensor: loading tensor blk.23.attn_v.weight
create_tensor: loading tensor blk.23.attn_output.weight
create_tensor: loading tensor blk.23.attn_sinks.weight
create_tensor: loading tensor blk.23.ffn_gate_inp.weight
create_tensor: loading tensor blk.23.ffn_gate_exps.weight
create_tensor: loading tensor blk.23.ffn_down_exps.weight
create_tensor: loading tensor blk.23.ffn_up_exps.weight
create_tensor: loading tensor blk.23.attn_q.bias
create_tensor: loading tensor blk.23.attn_k.bias
create_tensor: loading tensor blk.23.attn_v.bias
create_tensor: loading tensor blk.23.attn_output.bias
create_tensor: loading tensor blk.23.ffn_gate_inp.bias
create_tensor: loading tensor blk.23.ffn_gate_exps.bias
create_tensor: loading tensor blk.23.ffn_down_exps.bias
create_tensor: loading tensor blk.23.ffn_up_exps.bias
load_tensors: tensor 'token_embd.weight' (q8_0) (and 0 others) cannot be used with preferred buffer type CPU_REPACK, using CPU instead
ggml_metal_log_allocated_size: allocated buffer, size = 11536.20 MiB, (11536.66 / 16384.02)
load_tensors: offloading output layer to GPU
load_tensors: offloading 23 repeating layers to GPU
load_tensors: offloaded 25/25 layers to GPU
load_tensors: CPU_Mapped model buffer size = 586.82 MiB
load_tensors: Metal_Mapped model buffer size = 11536.18 MiB
.................................................................................
✔ Model loaded
◷ Creating context
llama_context: constructing llama_context
llama_context: n_seq_max = 1
llama_context: n_ctx = 110592
llama_context: n_ctx_seq = 110592
llama_context: n_batch = 513
llama_context: n_ubatch = 513
llama_context: causal_attn = 1
llama_context: flash_attn = enabled
llama_context: kv_unified = false
llama_context: freq_base = 150000.0
llama_context: freq_scale = 0.03125
llama_context: n_ctx_seq (110592) < n_ctx_train (131072) -- the full capacity of the model will not be utilized
ggml_metal_init: allocating
ggml_metal_init: found device: Apple M4 Pro
ggml_metal_init: picking default device: Apple M4 Pro
ggml_metal_init: use fusion = true
ggml_metal_init: use concurrency = true
ggml_metal_init: use graph optimize = true
set_abort_callback: call
llama_context: CPU output buffer size = 0.77 MiB
llama_kv_cache_iswa: creating non-SWA KV cache, size = 110592 cells
llama_kv_cache: layer 0: filtered
llama_kv_cache: layer 1: dev = Metal
llama_kv_cache: layer 2: filtered
llama_kv_cache: layer 3: dev = Metal
llama_kv_cache: layer 4: filtered
llama_kv_cache: layer 5: dev = Metal
llama_kv_cache: layer 6: filtered
llama_kv_cache: layer 7: dev = Metal
llama_kv_cache: layer 8: filtered
llama_kv_cache: layer 9: dev = Metal
llama_kv_cache: layer 10: filtered
llama_kv_cache: layer 11: dev = Metal
llama_kv_cache: layer 12: filtered
llama_kv_cache: layer 13: dev = Metal
llama_kv_cache: layer 14: filtered
llama_kv_cache: layer 15: dev = Metal
llama_kv_cache: layer 16: filtered
llama_kv_cache: layer 17: dev = Metal
llama_kv_cache: layer 18: filtered
llama_kv_cache: layer 19: dev = Metal
llama_kv_cache: layer 20: filtered
llama_kv_cache: layer 21: dev = Metal
llama_kv_cache: layer 22: filtered
llama_kv_cache: layer 23: dev = Metal
llama_kv_cache: Metal KV buffer size = 2592.00 MiB
llama_kv_cache: size = 2592.00 MiB (110592 cells, 12 layers, 1/1 seqs), K (f16): 1296.00 MiB, V (f16): 1296.00 MiB
llama_kv_cache_iswa: creating SWA KV cache, size = 768 cells
llama_kv_cache: layer 0: dev = Metal
llama_kv_cache: layer 1: filtered
llama_kv_cache: layer 2: dev = Metal
llama_kv_cache: layer 3: filtered
llama_kv_cache: layer 4: dev = Metal
llama_kv_cache: layer 5: filtered
llama_kv_cache: layer 6: dev = Metal
llama_kv_cache: layer 7: filtered
llama_kv_cache: layer 8: dev = Metal
llama_kv_cache: layer 9: filtered
llama_kv_cache: layer 10: dev = Metal
llama_kv_cache: layer 11: filtered
llama_kv_cache: layer 12: dev = Metal
llama_kv_cache: layer 13: filtered
llama_kv_cache: layer 14: dev = Metal
llama_kv_cache: layer 15: filtered
llama_kv_cache: layer 16: dev = Metal
llama_kv_cache: layer 17: filtered
llama_kv_cache: layer 18: dev = Metal
llama_kv_cache: layer 19: filtered
llama_kv_cache: layer 20: dev = Metal
llama_kv_cache: layer 21: filtered
llama_kv_cache: layer 22: dev = Metal
llama_kv_cache: layer 23: filtered
llama_kv_cache: Metal KV buffer size = 18.00 MiB
llama_kv_cache: size = 18.00 MiB ( 768 cells, 12 layers, 1/1 seqs), K (f16): 9.00 MiB, V (f16): 9.00 MiB
llama_context: enumerating backends
llama_context: backend_ptrs.size() = 3
sched_reserve: reserving ...
sched_reserve: max_nodes = 3672
sched_reserve: reserving full memory module
sched_reserve: worst-case: n_tokens = 513, n_seqs = 1, n_outputs = 1
graph_reserve: reserving a graph for ubatch with n_tokens = 513, n_seqs = 1, n_outputs = 513
graph_reserve: reserving a graph for ubatch with n_tokens = 1, n_seqs = 1, n_outputs = 1
graph_reserve: reserving a graph for ubatch with n_tokens = 513, n_seqs = 1, n_outputs = 513
sched_reserve: Metal compute buffer size = 404.79 MiB
sched_reserve: CPU compute buffer size = 229.22 MiB
sched_reserve: graph nodes = 1352
sched_reserve: graph splits = 2
sched_reserve: reserve took 113.64 ms, sched copies = 1
state_write_data: writing state
state_write_data: - writing model info
state_write_data: - writing output ids
state_write_data: - writing logits
state_write_data: - writing embeddings
state_write_data: - writing memory module
✔ Context created
GPU Type: Metal VRAM: 16GB Name: Apple M4 Pro
Model Type: gpt-oss 20B MXFP4 MoE Size: 11.27GB GPU layers: 25/25 offloaded (100%) mmap: enabled BOS: <|startoftext|> EOS: <|return|> Train context size: 131,072
Context Size: 110,592 Threads: 8 Flash attention: enabled
Chat Wrapper: Harmony Repeat penalty: 1.1 (apply to last 64 tokens)
> ggml_metal_library_compile_pipeline: compiling pipeline: base = 'kernel_rms_norm_mul_f32_4', name = 'kernel_rms_norm_mul_f32_4'
ggml_metal_library_compile_pipeline: loaded kernel_rms_norm_mul_f32_4 0x1194f6800 | th_max = 1024 | th_width = 32
ggml_metal_library_compile_pipeline: compiling pipeline: base = 'kernel_mul_mm_q8_0_f32', name = 'kernel_mul_mm_q8_0_f32_bci=0_bco=0'
ggml_metal_library_compile_pipeline: loaded kernel_mul_mm_q8_0_f32_bci=0_bco=0 0x17ae05a30 | th_max = 1024 | th_width = 32
ggml_metal_library_compile_pipeline: compiling pipeline: base = 'kernel_add_row_c4_fuse_1', name = 'kernel_add_row_c4_fuse_1'
ggml_metal_library_compile_pipeline: loaded kernel_add_row_c4_fuse_1 0x11ed0bfd0 | th_max = 1024 | th_width = 32
ggml_metal_library_compile_pipeline: compiling pipeline: base = 'kernel_rope_neox_f32', name = 'kernel_rope_neox_f32_imrope=0'
ggml_metal_library_compile_pipeline: loaded kernel_rope_neox_f32_imrope=0 0x17ae069e0 | th_max = 1024 | th_width = 32
ggml_metal_library_compile_pipeline: compiling pipeline: base = 'kernel_set_rows_f16_i64', name = 'kernel_set_rows_f16_i64'
ggml_metal_library_compile_pipeline: loaded kernel_set_rows_f16_i64 0x17ae07ca0 | th_max = 1024 | th_width = 32
ggml_metal_library_compile_pipeline: compiling pipeline: base = 'kernel_cpy_f32_f16', name = 'kernel_cpy_f32_f16'
ggml_metal_library_compile_pipeline: loaded kernel_cpy_f32_f16 0x119312780 | th_max = 1024 | th_width = 32
ggml_metal_library_compile_pipeline: compiling pipeline: base = 'kernel_flash_attn_ext_blk', name = 'kernel_flash_attn_ext_blk_nqptg=8_ncpsg=64'
ggml_metal_library_compile_pipeline: loaded kernel_flash_attn_ext_blk_nqptg=8_ncpsg=64 0x119314f70 | th_max = 1024 | th_width = 32
ggml_metal_library_compile_pipeline: compiling pipeline: base = 'kernel_flash_attn_ext_f16_dk64_dv64', name = 'kernel_flash_attn_ext_f16_dk64_dv64_mask=1_sinks=1_bias=0_scap=0_kvpad=0_bcm=0_ns10=512_ns20=512_nsg=4'
ggml_metal_library_compile_pipeline: loaded kernel_flash_attn_ext_f16_dk64_dv64_mask=1_sinks=1_bias=0_scap=0_kvpad=0_bcm=0_ns10=512_ns20=512_nsg=4 0x119314910 | th_max = 1024 | th_width = 32
ggml_metal_library_compile_pipeline: compiling pipeline: base = 'kernel_add_fuse_1', name = 'kernel_add_fuse_1'
ggml_metal_library_compile_pipeline: loaded kernel_add_fuse_1 0x17ae06ca0 | th_max = 1024 | th_width = 32
ggml_metal_library_compile_pipeline: compiling pipeline: base = 'kernel_mul_mm_f32_f32', name = 'kernel_mul_mm_f32_f32_bci=0_bco=1'
ggml_metal_library_compile_pipeline: loaded kernel_mul_mm_f32_f32_bci=0_bco=1 0x11ed0e7b0 | th_max = 1024 | th_width = 32
ggml_metal_library_compile_pipeline: compiling pipeline: base = 'kernel_argsort_f32_i32_desc', name = 'kernel_argsort_f32_i32_desc'
ggml_metal_library_compile_pipeline: loaded kernel_argsort_f32_i32_desc 0x17ae081c0 | th_max = 1024 | th_width = 32
ggml_metal_library_compile_pipeline: compiling pipeline: base = 'kernel_argsort_merge_f32_i32_desc', name = 'kernel_argsort_merge_f32_i32_desc'
ggml_metal_library_compile_pipeline: loaded kernel_argsort_merge_f32_i32_desc 0x17ae08c90 | th_max = 1024 | th_width = 32
ggml_metal_library_compile_pipeline: compiling pipeline: base = 'kernel_get_rows_f32', name = 'kernel_get_rows_f32'
ggml_metal_library_compile_pipeline: loaded kernel_get_rows_f32 0x17ae09770 | th_max = 1024 | th_width = 32
ggml_metal_library_compile_pipeline: compiling pipeline: base = 'kernel_soft_max_f32_4', name = 'kernel_soft_max_f32_4'
ggml_metal_library_compile_pipeline: loaded kernel_soft_max_f32_4 0x17ae0a140 | th_max = 1024 | th_width = 32
ggml_metal_library_compile_pipeline: compiling pipeline: base = 'kernel_mul_mm_id_map0_ne20_4', name = 'kernel_mul_mm_id_map0_ne20_4_ne02=32'
ggml_metal_library_compile_pipeline: loaded kernel_mul_mm_id_map0_ne20_4_ne02=32 0x17ae0b380 | th_max = 1024 | th_width = 32
ggml_metal_library_compile_pipeline: compiling pipeline: base = 'kernel_mul_mm_id_mxfp4_f32', name = 'kernel_mul_mm_id_mxfp4_f32_bci=0'
ggml_metal_library_compile_pipeline: loaded kernel_mul_mm_id_mxfp4_f32_bci=0 0x17ae0b860 | th_max = 1024 | th_width = 32
ggml_metal_library_compile_pipeline: compiling pipeline: base = 'kernel_add_id', name = 'kernel_add_id'
ggml_metal_library_compile_pipeline: loaded kernel_add_id 0x17ae0c150 | th_max = 1024 | th_width = 32
ggml_metal_library_compile_pipeline: compiling pipeline: base = 'kernel_swiglu_oai_f32', name = 'kernel_swiglu_oai_f32'
ggml_metal_library_compile_pipeline: loaded kernel_swiglu_oai_f32 0x17ae09a30 | th_max = 1024 | th_width = 32
ggml_metal_library_compile_pipeline: compiling pipeline: base = 'kernel_mul_fuse_1', name = 'kernel_mul_fuse_1'
ggml_metal_library_compile_pipeline: loaded kernel_mul_fuse_1 0x17ae0da90 | th_max = 1024 | th_width = 32
ggml_metal_library_compile_pipeline: compiling pipeline: base = 'kernel_add_fuse_3', name = 'kernel_add_fuse_3'
ggml_metal_library_compile_pipeline: loaded kernel_add_fuse_3 0x17ae0e8e0 | th_max = 1024 | th_width = 32
/Users/runner/work/node-llama-cpp/node-llama-cpp/llama/llama.cpp/ggml/src/ggml-metal/ggml-metal-context.m:235: fatal error
WARNING: Using native backtrace. Set GGML_BACKTRACE_LLDB for more info.
WARNING: GGML_BACKTRACE_LLDB may cause native MacOS Terminal.app to crash.
See: https://github.com/ggml-org/llama.cpp/pull/17869
ggml_metal_synchronize: error: command buffer 0 failed with status 5
error: Insufficient Memory (00000008:kIOGPUCommandBufferCallbackErrorOutOfMemory)
0 libggml-base.dylib 0x000000011c00144c ggml_print_backtrace + 276
1 libggml-base.dylib 0x000000011c001638 ggml_abort + 156
2 libggml-metal.so 0x000000011c0adfd0 ggml_metal_synchronize + 208
3 libggml-base.dylib 0x000000011c01e03c ggml_backend_sched_synchronize + 84
4 libllama.metal.b7836.dylib 0x000000011c21e5bc _ZN13llama_context11synchronizeEv + 28
5 llama-addon.node 0x000000011970a11c _ZN29AddonContextDecodeBatchWorker7ExecuteEv + 180
6 llama-addon.node 0x0000000119708a98 _ZN4Napi11AsyncWorker9OnExecuteENS_3EnvE + 32
7 node 0x0000000102460a68 _ZZN4node14ThreadPoolWork12ScheduleWorkEvENKUlP9uv_work_sE_clES2_ + 244
8 node 0x0000000102460968 _ZZN4node14ThreadPoolWork12ScheduleWorkEvENUlP9uv_work_sE_8__invokeES2_ + 24
9 node 0x00000001030829ec worker + 268
10 libsystem_pthread.dylib 0x00000001861d42e4 _pthread_start + 136
11 libsystem_pthread.dylib 0x00000001861cf0fc thread_start + 8
zsh: abort npx --yes node-llama-cpp chat --debug --fa
npx --yes node-llama-cpp inspect measure --fa '~/gpt-oss-20b.MXFP4.gguf'
File: ~/gpt-oss-20b.MXFP4.gguf
GPU: Metal (last build)
mmap: enabled
| Type | Layers | Context size | Estimated model VRAM | Model VRAM | Diff | Estimated context VRAM | Context VRAM | Diff | VRAM usage
* | Model | 25 | | 11.27GB | 11.27GB | -26.75KB (-0.00%) | | | | 70.41% (11.27GB/16GB)
| Context | 25 | 110592 | 11.27GB | 11.27GB | -26.75KB (-0.00%) | 3.77GB | 2.94GB | 845.39MB (28.04%) | 88.81% (14.21GB/16GB)
| Context | 25 | 82688 | 11.27GB | 11.27GB | -26.75KB (-0.00%) | 2.92GB | 2.31GB | 627.39MB (26.58%) | 84.82% (13.57GB/16GB)
| Context | 25 | 50944 | 11.27GB | 11.27GB | -26.75KB (-0.00%) | 1.95GB | 1.58GB | 379.39MB (23.47%) | 80.28% (12.85GB/16GB)
| Context | 25 | 25344 | 11.27GB | 11.27GB | -26.75KB (-0.00%) | 1.17GB | 1011.16MB | 185.04MB (18.30%) | 76.59% (12.25GB/16GB)
| Context | 25 | 4096 | 11.27GB | 11.27GB | -26.75KB (-0.00%) | 532.19MB | 518.8MB | 13.39MB (02.58%) | 73.58% (11.77GB/16GB)
| Context | 25 | 2048 | 11.27GB | 11.27GB | -26.75KB (-0.00%) | 468.19MB | 465.16MB | 3.04MB (00.65%) | 73.25% (11.72GB/16GB)
| Context | 25 | 1024 | 11.27GB | 11.27GB | -26.75KB (-0.00%) | 436.19MB | 441.16MB | -4.96MB (-1.13%) | 73.11% (11.7GB/16GB)
| Context | 25 | 512 | 11.27GB | 11.27GB | -26.75KB (-0.00%) | 418.19MB | 422.38MB | -4.18MB (-0.99%) | 72.99% (11.68GB/16GB)
| | | | | | | | | |
| Type | Layers | Context size | Estimated model VRAM | Model VRAM | Diff | Estimated context VRAM | Context VRAM | Diff | VRAM usage
| Model | 24 | | 10.12GB | 11.27GB | -1.15GB (-10.17%) | | | | 70.41% (11.27GB/16GB)
| Context | 24 | 110592 | 10.12GB | 11.27GB | -1.15GB (-10.17%) | 3.77GB | 2.94GB | 852.54MB (28.35%) | 88.77% (14.2GB/16GB)
| Context | 24 | 82688 | 10.12GB | 11.27GB | -1.15GB (-10.17%) | 2.92GB | 2.3GB | 634.54MB (26.96%) | 84.78% (13.56GB/16GB)
| Context | 24 | 50944 | 10.12GB | 11.27GB | -1.15GB (-10.17%) | 1.95GB | 1.57GB | 386.54MB (24.01%) | 80.24% (12.84GB/16GB)
| Context | 24 | 25344 | 10.12GB | 11.27GB | -1.15GB (-10.17%) | 1.17GB | 1009.66MB | 186.54MB (18.48%) | 76.58% (12.25GB/16GB)
| Context | 24 | 4096 | 10.12GB | 11.27GB | -1.15GB (-10.17%) | 532.19MB | 511.66MB | 20.54MB (04.01%) | 73.54% (11.77GB/16GB)
| Context | 24 | 2048 | 10.12GB | 11.27GB | -1.15GB (-10.17%) | 468.19MB | 463.66MB | 4.54MB (00.98%) | 73.24% (11.72GB/16GB)
| Context | 24 | 1024 | 10.12GB | 11.27GB | -1.15GB (-10.17%) | 436.19MB | 439.66MB | -3.46MB (-0.79%) | 73.10% (11.7GB/16GB)
| Context | 24 | 512 | 10.12GB | 11.27GB | -1.15GB (-10.17%) | 418.19MB | 421.38MB | -3.18MB (-0.76%) | 72.99% (11.68GB/16GB)
| | | | | | | | | |
| Type | Layers | Context size | Estimated model VRAM | Model VRAM | Diff | Estimated context VRAM | Context VRAM | Diff | VRAM usage
| Model | 23 | | 9.7GB | 11.27GB | -1.57GB (-13.92%) | | | | 70.41% (11.27GB/16GB)
| Context | 23 | 110592 | 9.7GB | 11.27GB | -1.57GB (-13.92%) | 3.77GB | 2.73GB | 1.04GB (38.27%) | 87.45% (13.99GB/16GB)
| Context | 23 | 82688 | 9.7GB | 11.27GB | -1.57GB (-13.92%) | 2.92GB | 2.14GB | 795.98MB (36.31%) | 83.79% (13.41GB/16GB)
| Context | 23 | 50944 | 9.7GB | 11.27GB | -1.57GB (-13.92%) | 1.95GB | 1.47GB | 485.98MB (32.18%) | 79.63% (12.74GB/16GB)
| Context | 23 | 25344 | 9.7GB | 11.27GB | -1.57GB (-13.92%) | 1.17GB | 960.16MB | 235.98MB (24.58%) | 76.27% (12.2GB/16GB)
| Context | 23 | 4096 | 9.7GB | 11.27GB | -1.57GB (-13.92%) | 532.14MB | 503.66MB | 28.48MB (05.65%) | 73.49% (11.76GB/16GB)
| Context | 23 | 2048 | 9.7GB | 11.27GB | -1.57GB (-13.92%) | 468.14MB | 459.66MB | 8.48MB (01.84%) | 73.22% (11.72GB/16GB)
| Context | 23 | 1024 | 9.7GB | 11.27GB | -1.57GB (-13.92%) | 436.14MB | 437.66MB | -1.52MB (-0.35%) | 73.09% (11.69GB/16GB)
| Context | 23 | 512 | 9.7GB | 11.27GB | -1.57GB (-13.92%) | 418.14MB | 420.38MB | -2.24MB (-0.53%) | 72.98% (11.68GB/16GB)
| | | | | | | | | |
| Type | Layers | Context size | Estimated model VRAM | Model VRAM | Diff | Estimated context VRAM | Context VRAM | Diff | VRAM usage
| Model | 22 | | 9.28GB | 11.27GB | -1.99GB (-17.66%) | | | | 70.41% (11.27GB/16GB)
| Context | 22 | 115456 | 9.28GB | 11.27GB | -1.99GB (-17.66%) | 3.77GB | 2.83GB | 966.67MB (33.40%) | 88.08% (14.09GB/16GB)
| Context | 22 | 82688 | 9.28GB | 11.27GB | -1.99GB (-17.66%) | 2.81GB | 2.14GB | 689.34MB (31.47%) | 83.78% (13.41GB/16GB)
| Context | 22 | 50944 | 9.28GB | 11.27GB | -1.99GB (-17.66%) | 1.88GB | 1.47GB | 420.67MB (27.88%) | 79.62% (12.74GB/16GB)
| Context | 22 | 25344 | 9.28GB | 11.27GB | -1.99GB (-17.66%) | 1.14GB | 958.66MB | 204.01MB (21.28%) | 76.27% (12.2GB/16GB)
| Context | 22 | 4096 | 9.28GB | 11.27GB | -1.99GB (-17.66%) | 526.33MB | 502.16MB | 24.17MB (04.81%) | 73.48% (11.76GB/16GB)
| Context | 22 | 2048 | 9.28GB | 11.27GB | -1.99GB (-17.66%) | 465MB | 458.16MB | 6.84MB (01.49%) | 73.21% (11.71GB/16GB)
| Context | 22 | 1024 | 9.28GB | 11.27GB | -1.99GB (-17.66%) | 434.33MB | 436.16MB | -1.83MB (-0.42%) | 73.08% (11.69GB/16GB)
| Context | 22 | 512 | 9.28GB | 11.27GB | -1.99GB (-17.66%) | 417.08MB | 419.38MB | -2.3MB (-0.55%) | 72.97% (11.68GB/16GB)
| | | | | | | | | |
| Type | Layers | Context size | Estimated model VRAM | Model VRAM | Diff | Estimated context VRAM | Context VRAM | Diff | VRAM usage
| Model | 21 | | 8.85GB | 11.27GB | -2.41GB (-21.40%) | | | | 70.41% (11.27GB/16GB)
| Context | 21 | 120576 | 8.85GB | 11.27GB | -2.41GB (-21.40%) | 3.77GB | 2.7GB | 1.06GB (39.29%) | 87.32% (13.97GB/16GB)
| Context | 21 | 82688 | 8.85GB | 11.27GB | -2.41GB (-21.40%) | 2.71GB | 1.98GB | 742.7MB (36.60%) | 82.80% (13.25GB/16GB)
| Context | 21 | 50944 | 8.85GB | 11.27GB | -2.41GB (-21.40%) | 1.82GB | 1.38GB | 453.37MB (32.17%) | 79.01% (12.64GB/16GB)
| Context | 21 | 25344 | 8.85GB | 11.27GB | -2.41GB (-21.40%) | 1.1GB | 909.16MB | 220.03MB (24.20%) | 75.96% (12.15GB/16GB)
| Context | 21 | 4096 | 8.85GB | 11.27GB | -2.41GB (-21.40%) | 520.52MB | 494.16MB | 26.37MB (05.34%) | 73.43% (11.75GB/16GB)
| Context | 21 | 2048 | 8.85GB | 11.27GB | -2.41GB (-21.40%) | 461.86MB | 454.16MB | 7.7MB (01.70%) | 73.19% (11.71GB/16GB)
| Context | 21 | 1024 | 8.85GB | 11.27GB | -2.41GB (-21.40%) | 432.52MB | 434.16MB | -1.63MB (-0.38%) | 73.06% (11.69GB/16GB)
| Context | 21 | 512 | 8.85GB | 11.27GB | -2.41GB (-21.40%) | 416.02MB | 418.38MB | -2.35MB (-0.56%) | 72.97% (11.67GB/16GB)
| | | | | | | | | |
| Type | Layers | Context size | Estimated model VRAM | Model VRAM | Diff | Estimated context VRAM | Context VRAM | Diff | VRAM usage
| Model | 20 | | 8.43GB | 11.27GB | -2.83GB (-25.14%) | | | | 70.41% (11.27GB/16GB)
| Context | 20 | 126464 | 8.43GB | 11.27GB | -2.83GB (-25.14%) | 3.77GB | 2.82GB | 978.06MB (33.93%) | 88.01% (14.08GB/16GB)
| Context | 20 | 125184 | 8.43GB | 11.27GB | -2.83GB (-25.14%) | 3.74GB | 2.79GB | 968.06MB (33.88%) | 87.86% (14.06GB/16GB)
| Context | 20 | 82688 | 8.43GB | 11.27GB | -2.83GB (-25.14%) | 2.6GB | 1.98GB | 636.06MB (31.37%) | 82.79% (13.25GB/16GB)
| Context | 20 | 50944 | 8.43GB | 11.27GB | -2.83GB (-25.14%) | 1.75GB | 1.37GB | 388.06MB (27.57%) | 79.01% (12.64GB/16GB)
| Context | 20 | 25344 | 8.43GB | 11.27GB | -2.83GB (-25.14%) | 1.07GB | 907.66MB | 188.06MB (20.72%) | 75.95% (12.15GB/16GB)
| Context | 20 | 4096 | 8.43GB | 11.27GB | -2.83GB (-25.14%) | 514.72MB | 492.66MB | 22.06MB (04.48%) | 73.42% (11.75GB/16GB)
| Context | 20 | 2048 | 8.43GB | 11.27GB | -2.83GB (-25.14%) | 458.72MB | 452.66MB | 6.06MB (01.34%) | 73.18% (11.71GB/16GB)
| Context | 20 | 1024 | 8.43GB | 11.27GB | -2.83GB (-25.14%) | 430.72MB | 432.66MB | -1.94MB (-0.45%) | 73.05% (11.69GB/16GB)
| Context | 20 | 512 | 8.43GB | 11.27GB | -2.83GB (-25.14%) | 414.97MB | 417.38MB | -2.41MB (-0.58%) | 72.96% (11.67GB/16GB)
| | | | | | | | | |
| Type | Layers | Context size | Estimated model VRAM | Model VRAM | Diff | Estimated context VRAM | Context VRAM | Diff | VRAM usage
| Model | 19 | | 8.01GB | 11.27GB | -3.25GB (-28.89%) | | | | 70.41% (11.27GB/16GB)
| Context | 19 | 131072 | 8.01GB | 11.27GB | -3.25GB (-28.89%) | 3.73GB | 2.65GB | 1.07GB (40.45%) | 87.00% (13.92GB/16GB)
| Context | 19 | 125184 | 8.01GB | 11.27GB | -3.25GB (-28.89%) | 3.58GB | 2.55GB | 1.02GB (40.15%) | 86.36% (13.82GB/16GB)
| Context | 19 | 82688 | 8.01GB | 11.27GB | -3.25GB (-28.89%) | 2.5GB | 1.82GB | 689.42MB (36.94%) | 81.80% (13.09GB/16GB)
| Context | 19 | 50944 | 8.01GB | 11.27GB | -3.25GB (-28.89%) | 1.69GB | 1.28GB | 420.76MB (32.16%) | 78.40% (12.54GB/16GB)
| Context | 19 | 25344 | 8.01GB | 11.27GB | -3.25GB (-28.89%) | 1.04GB | 858.16MB | 204.09MB (23.78%) | 75.65% (12.1GB/16GB)
| Context | 19 | 4096 | 8.01GB | 11.27GB | -3.25GB (-28.89%) | 508.91MB | 484.66MB | 24.26MB (05.00%) | 73.37% (11.74GB/16GB)
| Context | 19 | 2048 | 8.01GB | 11.27GB | -3.25GB (-28.89%) | 455.58MB | 448.66MB | 6.92MB (01.54%) | 73.15% (11.7GB/16GB)
| Context | 19 | 1024 | 8.01GB | 11.27GB | -3.25GB (-28.89%) | 428.91MB | 430.66MB | -1.74MB (-0.41%) | 73.04% (11.69GB/16GB)
| Context | 19 | 512 | 8.01GB | 11.27GB | -3.25GB (-28.89%) | 413.91MB | 416.38MB | -2.46MB (-0.59%) | 72.96% (11.67GB/16GB)
| | | | | | | | | |
| Type | Layers | Context size | Estimated model VRAM | Model VRAM | Diff | Estimated context VRAM | Context VRAM | Diff | VRAM usage
| Model | 18 | | 7.59GB | 11.27GB | -3.68GB (-32.63%) | | | | 70.41% (11.27GB/16GB)
| Context | 18 | 131072 | 7.59GB | 11.27GB | -3.68GB (-32.63%) | 3.56GB | 2.65GB | 929.28MB (34.23%) | 86.99% (13.92GB/16GB)
| Context | 18 | 125184 | 7.59GB | 11.27GB | -3.68GB (-32.63%) | 3.42GB | 2.55GB | 887.12MB (33.97%) | 86.35% (13.82GB/16GB)
| Context | 18 | 82688 | 7.59GB | 11.27GB | -3.68GB (-32.63%) | 2.39GB | 1.82GB | 582.78MB (31.25%) | 81.80% (13.09GB/16GB)
| Context | 18 | 50944 | 7.59GB | 11.27GB | -3.68GB (-32.63%) | 1.62GB | 1.28GB | 355.45MB (27.20%) | 78.39% (12.54GB/16GB)
| Context | 18 | 25344 | 7.59GB | 11.27GB | -3.68GB (-32.63%) | 1GB | 856.66MB | 172.12MB (20.09%) | 75.64% (12.1GB/16GB)
| Context | 18 | 4096 | 7.59GB | 11.27GB | -3.68GB (-32.63%) | 503.11MB | 483.16MB | 19.95MB (04.13%) | 73.36% (11.74GB/16GB)
| Context | 18 | 2048 | 7.59GB | 11.27GB | -3.68GB (-32.63%) | 452.44MB | 447.16MB | 5.28MB (01.18%) | 73.14% (11.7GB/16GB)
| Context | 18 | 1024 | 7.59GB | 11.27GB | -3.68GB (-32.63%) | 427.11MB | 429.16MB | -2.05MB (-0.48%) | 73.03% (11.69GB/16GB)
| Context | 18 | 512 | 7.59GB | 11.27GB | -3.68GB (-32.63%) | 412.86MB | 415.38MB | -2.52MB (-0.61%) | 72.95% (11.67GB/16GB)
| | | | | | | | | |
| Type | Layers | Context size | Estimated model VRAM | Model VRAM | Diff | Estimated context VRAM | Context VRAM | Diff | VRAM usage
| Model | 17 | | 7.17GB | 11.27GB | -4.1GB (-36.37%) | | | | 70.41% (11.27GB/16GB)
| Context | 17 | 131072 | 7.17GB | 11.27GB | -4.1GB (-36.37%) | 3.39GB | 2.4GB | 1014.14MB (41.24%) | 85.42% (13.67GB/16GB)
| Context | 17 | 125184 | 7.17GB | 11.27GB | -4.1GB (-36.37%) | 3.26GB | 2.31GB | 968.14MB (40.90%) | 84.86% (13.58GB/16GB)
| Context | 17 | 82688 | 7.17GB | 11.27GB | -4.1GB (-36.37%) | 2.28GB | 1.66GB | 636.14MB (37.35%) | 80.81% (12.93GB/16GB)
| Context | 17 | 50944 | 7.17GB | 11.27GB | -4.1GB (-36.37%) | 1.56GB | 1.18GB | 388.14MB (32.15%) | 77.78% (12.45GB/16GB)
| Context | 17 | 25344 | 7.17GB | 11.27GB | -4.1GB (-36.37%) | 995.3MB | 807.16MB | 188.14MB (23.31%) | 75.34% (12.05GB/16GB)
| Context | 17 | 4096 | 7.17GB | 11.27GB | -4.1GB (-36.37%) | 497.3MB | 475.16MB | 22.14MB (04.66%) | 73.31% (11.73GB/16GB)
| Context | 17 | 2048 | 7.17GB | 11.27GB | -4.1GB (-36.37%) | 449.3MB | 443.16MB | 6.14MB (01.39%) | 73.12% (11.7GB/16GB)
| Context | 17 | 1024 | 7.17GB | 11.27GB | -4.1GB (-36.37%) | 425.3MB | 427.16MB | -1.86MB (-0.43%) | 73.02% (11.68GB/16GB)
| Context | 17 | 512 | 7.17GB | 11.27GB | -4.1GB (-36.37%) | 411.8MB | 414.38MB | -2.58MB (-0.62%) | 72.94% (11.67GB/16GB)
| | | | | | | | | |
| Type | Layers | Context size | Estimated model VRAM | Model VRAM | Diff | Estimated context VRAM | Context VRAM | Diff | VRAM usage
| Model | 16 | | 6.75GB | 11.27GB | -4.52GB (-40.12%) | | | | 70.41% (11.27GB/16GB)
| Context | 16 | 131072 | 6.75GB | 11.27GB | -4.52GB (-40.12%) | 3.22GB | 2.4GB | 844.5MB (34.36%) | 85.41% (13.67GB/16GB)
| Context | 16 | 125184 | 6.75GB | 11.27GB | -4.52GB (-40.12%) | 3.1GB | 2.31GB | 806.17MB (34.08%) | 84.85% (13.58GB/16GB)
| Context | 16 | 82688 | 6.75GB | 11.27GB | -4.52GB (-40.12%) | 2.18GB | 1.66GB | 529.5MB (31.12%) | 80.80% (12.93GB/16GB)
| Context | 16 | 50944 | 6.75GB | 11.27GB | -4.52GB (-40.12%) | 1.49GB | 1.18GB | 322.84MB (26.78%) | 77.77% (12.44GB/16GB)
| Context | 16 | 25344 | 6.75GB | 11.27GB | -4.52GB (-40.12%) | 961.83MB | 805.66MB | 156.17MB (19.38%) | 75.33% (12.05GB/16GB)
| Context | 16 | 4096 | 6.75GB | 11.27GB | -4.52GB (-40.12%) | 491.49MB | 473.66MB | 17.84MB (03.77%) | 73.31% (11.73GB/16GB)
| Context | 16 | 2048 | 6.75GB | 11.27GB | -4.52GB (-40.12%) | 446.16MB | 441.66MB | 4.5MB (01.02%) | 73.11% (11.7GB/16GB)
| Context | 16 | 1024 | 6.75GB | 11.27GB | -4.52GB (-40.12%) | 423.49MB | 425.66MB | -2.16MB (-0.51%) | 73.01% (11.68GB/16GB)
| Context | 16 | 512 | 6.75GB | 11.27GB | -4.52GB (-40.12%) | 410.74MB | 413.38MB | -2.63MB (-0.64%) | 72.94% (11.67GB/16GB)
| | | | | | | | | |
| Type | Layers | Context size | Estimated model VRAM | Model VRAM | Diff | Estimated context VRAM | Context VRAM | Diff | VRAM usage
| Model | 15 | | 6.32GB | 11.27GB | -4.94GB (-43.86%) | | | | 70.41% (11.27GB/16GB)
| Context | 15 | 131072 | 6.32GB | 11.27GB | -4.94GB (-43.86%) | 3.06GB | 2.15GB | 929.36MB (42.21%) | 83.85% (13.42GB/16GB)
| Context | 15 | 125184 | 6.32GB | 11.27GB | -4.94GB (-43.86%) | 2.94GB | 2.07GB | 887.2MB (41.83%) | 83.36% (13.34GB/16GB)
| Context | 15 | 82688 | 6.32GB | 11.27GB | -4.94GB (-43.86%) | 2.07GB | 1.5GB | 582.86MB (37.84%) | 79.81% (12.77GB/16GB)
| Context | 15 | 50944 | 6.32GB | 11.27GB | -4.94GB (-43.86%) | 1.43GB | 1.08GB | 355.53MB (32.14%) | 77.17% (12.35GB/16GB)
| Context | 15 | 25344 | 6.32GB | 11.27GB | -4.94GB (-43.86%) | 928.35MB | 756.16MB | 172.2MB (22.77%) | 75.03% (12GB/16GB)
| Context | 15 | 4096 | 6.32GB | 11.27GB | -4.94GB (-43.86%) | 485.69MB | 465.66MB | 20.03MB (04.30%) | 73.26% (11.72GB/16GB)
| Context | 15 | 2048 | 6.32GB | 11.27GB | -4.94GB (-43.86%) | 443.02MB | 437.66MB | 5.36MB (01.23%) | 73.09% (11.69GB/16GB)
| Context | 15 | 1024 | 6.32GB | 11.27GB | -4.94GB (-43.86%) | 421.69MB | 423.66MB | -1.97MB (-0.46%) | 73.00% (11.68GB/16GB)
| Context | 15 | 512 | 6.32GB | 11.27GB | -4.94GB (-43.86%) | 409.69MB | 412.38MB | -2.69MB (-0.65%) | 72.93% (11.67GB/16GB)
| | | | | | | | | |
| Type | Layers | Context size | Estimated model VRAM | Model VRAM | Diff | Estimated context VRAM | Context VRAM | Diff | VRAM usage
| Model | 14 | | 5.9GB | 11.27GB | -5.36GB (-47.60%) | | | | 70.41% (11.27GB/16GB)
| Context | 14 | 131072 | 5.9GB | 11.27GB | -5.36GB (-47.60%) | 2.89GB | 2.15GB | 759.73MB (34.53%) | 83.84% (13.41GB/16GB)
| Context | 14 | 125184 | 5.9GB | 11.27GB | -5.36GB (-47.60%) | 2.78GB | 2.07GB | 725.23MB (34.21%) | 83.35% (13.34GB/16GB)
| Context | 14 | 82688 | 5.9GB | 11.27GB | -5.36GB (-47.60%) | 1.97GB | 1.5GB | 476.23MB (30.95%) | 79.81% (12.77GB/16GB)
| Context | 14 | 50944 | 5.9GB | 11.27GB | -5.36GB (-47.60%) | 1.36GB | 1.08GB | 290.23MB (26.27%) | 77.16% (12.35GB/16GB)
| Context | 14 | 25344 | 5.9GB | 11.27GB | -5.36GB (-47.60%) | 894.88MB | 754.66MB | 140.23MB (18.58%) | 75.02% (12GB/16GB)
| Context | 14 | 4096 | 5.9GB | 11.27GB | -5.36GB (-47.60%) | 479.88MB | 464.16MB | 15.73MB (03.39%) | 73.25% (11.72GB/16GB)
| Context | 14 | 2048 | 5.9GB | 11.27GB | -5.36GB (-47.60%) | 439.88MB | 436.16MB | 3.73MB (00.85%) | 73.08% (11.69GB/16GB)
| Context | 14 | 1024 | 5.9GB | 11.27GB | -5.36GB (-47.60%) | 419.88MB | 422.16MB | -2.27MB (-0.54%) | 72.99% (11.68GB/16GB)
| Context | 14 | 512 | 5.9GB | 11.27GB | -5.36GB (-47.60%) | 408.63MB | 411.38MB | -2.74MB (-0.67%) | 72.92% (11.67GB/16GB)
| | | | | | | | | |
| Type | Layers | Context size | Estimated model VRAM | Model VRAM | Diff | Estimated context VRAM | Context VRAM | Diff | VRAM usage
| Model | 13 | | 5.48GB | 11.27GB | -5.78GB (-51.34%) | | | | 70.41% (11.27GB/16GB)
| Context | 13 | 131072 | 5.48GB | 11.27GB | -5.78GB (-51.34%) | 2.72GB | 1.9GB | 844.54MB (43.44%) | 82.28% (13.16GB/16GB)
| Context | 13 | 125184 | 5.48GB | 11.27GB | -5.78GB (-51.34%) | 2.62GB | 1.83GB | 806.2MB (42.99%) | 81.86% (13.1GB/16GB)
| Context | 13 | 82688 | 5.48GB | 11.27GB | -5.78GB (-51.34%) | 1.86GB | 1.34GB | 529.54MB (38.45%) | 78.82% (12.61GB/16GB)
| Context | 13 | 50944 | 5.48GB | 11.27GB | -5.78GB (-51.34%) | 1.3GB | 1005.16MB | 322.87MB (32.12%) | 76.55% (12.25GB/16GB)
| Context | 13 | 25344 | 5.48GB | 11.27GB | -5.78GB (-51.34%) | 861.36MB | 705.16MB | 156.2MB (22.15%) | 74.72% (11.95GB/16GB)
| Context | 13 | 4096 | 5.48GB | 11.27GB | -5.78GB (-51.34%) | 474.03MB | 456.16MB | 17.87MB (03.92%) | 73.20% (11.71GB/16GB)
| Context | 13 | 2048 | 5.48GB | 11.27GB | -5.78GB (-51.34%) | 436.69MB | 432.16MB | 4.54MB (01.05%) | 73.05% (11.69GB/16GB)
| Context | 13 | 1024 | 5.48GB | 11.27GB | -5.78GB (-51.34%) | 418.03MB | 420.16MB | -2.13MB (-0.51%) | 72.98% (11.68GB/16GB)
| Context | 13 | 512 | 5.48GB | 11.27GB | -5.78GB (-51.34%) | 407.53MB | 410.38MB | -2.85MB (-0.69%) | 72.92% (11.67GB/16GB)
| | | | | | | | | |
| Type | Layers | Context size | Estimated model VRAM | Model VRAM | Diff | Estimated context VRAM | Context VRAM | Diff | VRAM usage
| Model | 12 | | 5.06GB | 11.27GB | -6.21GB (-55.09%) | | | | 70.41% (11.27GB/16GB)
| Context | 12 | 131072 | 5.06GB | 11.27GB | -6.21GB (-55.09%) | 2.56GB | 1.9GB | 674.9MB (34.74%) | 82.27% (13.16GB/16GB)
| Context | 12 | 125184 | 5.06GB | 11.27GB | -6.21GB (-55.09%) | 2.46GB | 1.83GB | 644.23MB (34.38%) | 81.85% (13.1GB/16GB)
| Context | 12 | 82688 | 5.06GB | 11.27GB | -6.21GB (-55.09%) | 1.76GB | 1.34GB | 422.9MB (30.74%) | 78.81% (12.61GB/16GB)
| Context | 12 | 50944 | 5.06GB | 11.27GB | -6.21GB (-55.09%) | 1.23GB | 1003.66MB | 257.57MB (25.66%) | 76.54% (12.25GB/16GB)
| Context | 12 | 25344 | 5.06GB | 11.27GB | -6.21GB (-55.09%) | 827.89MB | 703.66MB | 124.23MB (17.66%) | 74.71% (11.95GB/16GB)
| Context | 12 | 4096 | 5.06GB | 11.27GB | -6.21GB (-55.09%) | 468.22MB | 454.66MB | 13.57MB (02.98%) | 73.19% (11.71GB/16GB)
| Context | 12 | 2048 | 5.06GB | 11.27GB | -6.21GB (-55.09%) | 433.56MB | 430.66MB | 2.9MB (00.67%) | 73.04% (11.69GB/16GB)
| Context | 12 | 1024 | 5.06GB | 11.27GB | -6.21GB (-55.09%) | 416.22MB | 418.66MB | -2.43MB (-0.58%) | 72.97% (11.68GB/16GB)
| Context | 12 | 512 | 5.06GB | 11.27GB | -6.21GB (-55.09%) | 406.47MB | 409.38MB | -2.9MB (-0.71%) | 72.91% (11.67GB/16GB)
| | | | | | | | | |
| Type | Layers | Context size | Estimated model VRAM | Model VRAM | Diff | Estimated context VRAM | Context VRAM | Diff | VRAM usage
| Model | 11 | | 4.64GB | 11.27GB | -6.63GB (-58.83%) | | | | 70.41% (11.27GB/16GB)
| Context | 11 | 131072 | 4.64GB | 11.27GB | -6.63GB (-58.83%) | 2.39GB | 1.65GB | 759.76MB (45.05%) | 80.71% (12.91GB/16GB)
| Context | 11 | 125184 | 4.64GB | 11.27GB | -6.63GB (-58.83%) | 2.3GB | 1.59GB | 725.26MB (44.52%) | 80.36% (12.86GB/16GB)
| Context | 11 | 82688 | 4.64GB | 11.27GB | -6.63GB (-58.83%) | 1.65GB | 1.19GB | 476.26MB (39.23%) | 77.82% (12.45GB/16GB)
| Context | 11 | 50944 | 4.64GB | 11.27GB | -6.63GB (-58.83%) | 1.17GB | 904.16MB | 290.26MB (32.10%) | 75.93% (12.15GB/16GB)
| Context | 11 | 25344 | 4.64GB | 11.27GB | -6.63GB (-58.83%) | 794.42MB | 654.16MB | 140.26MB (21.44%) | 74.41% (11.91GB/16GB)
| Context | 11 | 4096 | 4.64GB | 11.27GB | -6.63GB (-58.83%) | 462.42MB | 446.66MB | 15.76MB (03.53%) | 73.14% (11.7GB/16GB)
| Context | 11 | 2048 | 4.64GB | 11.27GB | -6.63GB (-58.83%) | 430.42MB | 426.66MB | 3.76MB (00.88%) | 73.02% (11.68GB/16GB)
| Context | 11 | 1024 | 4.64GB | 11.27GB | -6.63GB (-58.83%) | 414.42MB | 416.66MB | -2.24MB (-0.54%) | 72.96% (11.67GB/16GB)
| Context | 11 | 512 | 4.64GB | 11.27GB | -6.63GB (-58.83%) | 405.42MB | 408.38MB | -2.96MB (-0.72%) | 72.91% (11.67GB/16GB)
| | | | | | | | | |
| Type | Layers | Context size | Estimated model VRAM | Model VRAM | Diff | Estimated context VRAM | Context VRAM | Diff | VRAM usage
| Model | 10 | | 4.22GB | 11.27GB | -7.05GB (-62.57%) | | | | 70.41% (11.27GB/16GB)
| Context | 10 | 131072 | 4.22GB | 11.27GB | -7.05GB (-62.57%) | 2.22GB | 1.65GB | 590.12MB (35.02%) | 80.70% (12.91GB/16GB)
| Context | 10 | 125184 | 4.22GB | 11.27GB | -7.05GB (-62.57%) | 2.14GB | 1.59GB | 563.29MB (34.61%) | 80.35% (12.86GB/16GB)
| Context | 10 | 82688 | 4.22GB | 11.27GB | -7.05GB (-62.57%) | 1.55GB | 1.18GB | 369.62MB (30.48%) | 77.82% (12.45GB/16GB)
| Context | 10 | 50944 | 4.22GB | 11.27GB | -7.05GB (-62.57%) | 1.1GB | 902.66MB | 224.95MB (24.92%) | 75.92% (12.15GB/16GB)
| Context | 10 | 25344 | 4.22GB | 11.27GB | -7.05GB (-62.57%) | 760.94MB | 652.66MB | 108.29MB (16.59%) | 74.40% (11.9GB/16GB)
| Context | 10 | 4096 | 4.22GB | 11.27GB | -7.05GB (-62.57%) | 456.61MB | 445.16MB | 11.45MB (02.57%) | 73.13% (11.7GB/16GB)
| Context | 10 | 2048 | 4.22GB | 11.27GB | -7.05GB (-62.57%) | 427.28MB | 425.16MB | 2.12MB (00.50%) | 73.01% (11.68GB/16GB)
| Context | 10 | 1024 | 4.22GB | 11.27GB | -7.05GB (-62.57%) | 412.61MB | 415.16MB | -2.55MB (-0.61%) | 72.95% (11.67GB/16GB)
| Context | 10 | 512 | 4.22GB | 11.27GB | -7.05GB (-62.57%) | 404.36MB | 407.38MB | -3.02MB (-0.74%) | 72.90% (11.66GB/16GB)
| | | | | | | | | |
| Type | Layers | Context size | Estimated model VRAM | Model VRAM | Diff | Estimated context VRAM | Context VRAM | Diff | VRAM usage
| Model | 9 | | 3.79GB | 11.27GB | -7.47GB (-66.32%) | | | | 70.41% (11.27GB/16GB)
| Context | 9 | 131072 | 3.79GB | 11.27GB | -7.47GB (-66.32%) | 2.05GB | 1.4GB | 674.98MB (47.23%) | 79.14% (12.66GB/16GB)
| Context | 9 | 125184 | 3.79GB | 11.27GB | -7.47GB (-66.32%) | 1.98GB | 1.35GB | 644.31MB (46.58%) | 78.86% (12.62GB/16GB)
| Context | 9 | 82688 | 3.79GB | 11.27GB | -7.47GB (-66.32%) | 1.44GB | 1.03GB | 422.98MB (40.24%) | 76.83% (12.29GB/16GB)
| Context | 9 | 50944 | 3.79GB | 11.27GB | -7.47GB (-66.32%) | 1.04GB | 803.16MB | 257.65MB (32.08%) | 75.32% (12.05GB/16GB)
| Context | 9 | 25344 | 3.79GB | 11.27GB | -7.47GB (-66.32%) | 727.47MB | 603.16MB | 124.31MB (20.61%) | 74.10% (11.86GB/16GB)
| Context | 9 | 4096 | 3.79GB | 11.27GB | -7.47GB (-66.32%) | 450.8MB | 437.16MB | 13.65MB (03.12%) | 73.08% (11.69GB/16GB)
| Context | 9 | 2048 | 3.79GB | 11.27GB | -7.47GB (-66.32%) | 424.14MB | 421.16MB | 2.98MB (00.71%) | 72.98% (11.68GB/16GB)
| Context | 9 | 1024 | 3.79GB | 11.27GB | -7.47GB (-66.32%) | 410.8MB | 413.16MB | -2.35MB (-0.57%) | 72.94% (11.67GB/16GB)
| Context | 9 | 512 | 3.79GB | 11.27GB | -7.47GB (-66.32%) | 403.3MB | 406.38MB | -3.07MB (-0.76%) | 72.89% (11.66GB/16GB)
| | | | | | | | | |
| Type | Layers | Context size | Estimated model VRAM | Model VRAM | Diff | Estimated context VRAM | Context VRAM | Diff | VRAM usage
| Model | 8 | | 3.37GB | 11.27GB | -7.89GB (-70.06%) | | | | 70.41% (11.27GB/16GB)
| Context | 8 | 131072 | 3.37GB | 11.27GB | -7.89GB (-70.06%) | 1.89GB | 1.39GB | 505.34MB (35.40%) | 79.13% (12.66GB/16GB)
| Context | 8 | 125184 | 3.37GB | 11.27GB | -7.89GB (-70.06%) | 1.82GB | 1.35GB | 482.34MB (34.91%) | 78.85% (12.62GB/16GB)
| Context | 8 | 82688 | 3.37GB | 11.27GB | -7.89GB (-70.06%) | 1.33GB | 1.03GB | 316.34MB (30.14%) | 76.82% (12.29GB/16GB)
| Context | 8 | 50944 | 3.37GB | 11.27GB | -7.89GB (-70.06%) | 994MB | 801.66MB | 192.34MB (23.99%) | 75.31% (12.05GB/16GB)
| Context | 8 | 25344 | 3.37GB | 11.27GB | -7.89GB (-70.06%) | 694MB | 601.66MB | 92.34MB (15.35%) | 74.09% (11.85GB/16GB)
| Context | 8 | 4096 | 3.37GB | 11.27GB | -7.89GB (-70.06%) | 445MB | 435.66MB | 9.34MB (02.14%) | 73.07% (11.69GB/16GB)
| Context | 8 | 2048 | 3.37GB | 11.27GB | -7.89GB (-70.06%) | 421MB | 419.66MB | 1.34MB (00.32%) | 72.98% (11.68GB/16GB)
| Context | 8 | 1024 | 3.37GB | 11.27GB | -7.89GB (-70.06%) | 409MB | 411.66MB | -2.66MB (-0.65%) | 72.93% (11.67GB/16GB)
| Context | 8 | 512 | 3.37GB | 11.27GB | -7.89GB (-70.06%) | 402.25MB | 405.38MB | -3.13MB (-0.77%) | 72.89% (11.66GB/16GB)
| | | | | | | | | |
| Type | Layers | Context size | Estimated model VRAM | Model VRAM | Diff | Estimated context VRAM | Context VRAM | Diff | VRAM usage
| Model | 7 | | 2.95GB | 11.27GB | -8.31GB (-73.80%) | | | | 70.41% (11.27GB/16GB)
| Context | 7 | 131072 | 2.95GB | 11.27GB | -8.31GB (-73.80%) | 1.72GB | 1.14GB | 590.2MB (50.37%) | 77.57% (12.41GB/16GB)
| Context | 7 | 125184 | 2.95GB | 11.27GB | -8.31GB (-73.80%) | 1.66GB | 1.11GB | 563.37MB (49.54%) | 77.35% (12.38GB/16GB)
| Context | 7 | 82688 | 2.95GB | 11.27GB | -8.31GB (-73.80%) | 1.23GB | 888.16MB | 369.7MB (41.63%) | 75.83% (12.13GB/16GB)
| Context | 7 | 50944 | 2.95GB | 11.27GB | -8.31GB (-73.80%) | 927.19MB | 702.16MB | 225.04MB (32.05%) | 74.70% (11.95GB/16GB)
| Context | 7 | 25344 | 2.95GB | 11.27GB | -8.31GB (-73.80%) | 660.53MB | 552.16MB | 108.37MB (19.63%) | 73.78% (11.81GB/16GB)
| Context | 7 | 4096 | 2.95GB | 11.27GB | -8.31GB (-73.80%) | 439.19MB | 427.66MB | 11.54MB (02.70%) | 73.02% (11.68GB/16GB)
| Context | 7 | 2048 | 2.95GB | 11.27GB | -8.31GB (-73.80%) | 417.86MB | 415.66MB | 2.2MB (00.53%) | 72.95% (11.67GB/16GB)
| Context | 7 | 1024 | 2.95GB | 11.27GB | -8.31GB (-73.80%) | 407.19MB | 409.66MB | -2.46MB (-0.60%) | 72.91% (11.67GB/16GB)
| Context | 7 | 512 | 2.95GB | 11.27GB | -8.31GB (-73.80%) | 401.19MB | 404.38MB | -3.18MB (-0.79%) | 72.88% (11.66GB/16GB)
| | | | | | | | | |
| Type | Layers | Context size | Estimated model VRAM | Model VRAM | Diff | Estimated context VRAM | Context VRAM | Diff | VRAM usage
| Model | 6 | | 2.53GB | 11.27GB | -8.74GB (-77.54%) | | | | 70.41% (11.27GB/16GB)
| Context | 6 | 131072 | 2.53GB | 11.27GB | -8.74GB (-77.54%) | 1.55GB | 1.14GB | 420.54MB (35.94%) | 77.56% (12.41GB/16GB)
| Context | 6 | 125184 | 2.53GB | 11.27GB | -8.74GB (-77.54%) | 1.5GB | 1.11GB | 401.37MB (35.34%) | 77.35% (12.38GB/16GB)
| Context | 6 | 82688 | 2.53GB | 11.27GB | -8.74GB (-77.54%) | 1.12GB | 886.66MB | 263.04MB (29.67%) | 75.83% (12.13GB/16GB)
| Context | 6 | 50944 | 2.53GB | 11.27GB | -8.74GB (-77.54%) | 860.36MB | 700.66MB | 159.71MB (22.79%) | 74.69% (11.95GB/16GB)
| Context | 6 | 25344 | 2.53GB | 11.27GB | -8.74GB (-77.54%) | 627.03MB | 550.66MB | 76.37MB (13.87%) | 73.78% (11.8GB/16GB)
| Context | 6 | 4096 | 2.53GB | 11.27GB | -8.74GB (-77.54%) | 433.36MB | 426.16MB | 7.21MB (01.69%) | 73.02% (11.68GB/16GB)
| Context | 6 | 2048 | 2.53GB | 11.27GB | -8.74GB (-77.54%) | 414.7MB | 414.16MB | 552.02KB (00.13%) | 72.94% (11.67GB/16GB)
| Context | 6 | 1024 | 2.53GB | 11.27GB | -8.74GB (-77.54%) | 405.36MB | 408.16MB | -2.79MB (-0.68%) | 72.91% (11.66GB/16GB)
| Context | 6 | 512 | 2.53GB | 11.27GB | -8.74GB (-77.54%) | 400.11MB | 403.38MB | -3.26MB (-0.81%) | 72.88% (11.66GB/16GB)
| | | | | | | | | |
| Type | Layers | Context size | Estimated model VRAM | Model VRAM | Diff | Estimated context VRAM | Context VRAM | Diff | VRAM usage
| Model | 5 | | 2.11GB | 11.27GB | -9.16GB (-81.29%) | | | | 70.41% (11.27GB/16GB)
| Context | 5 | 131072 | 2.11GB | 11.27GB | -9.16GB (-81.29%) | 1.39GB | 914.16MB | 505.4MB (55.29%) | 75.99% (12.16GB/16GB)
| Context | 5 | 125184 | 2.11GB | 11.27GB | -9.16GB (-81.29%) | 1.34GB | 891.16MB | 482.4MB (54.13%) | 75.85% (12.14GB/16GB)
| Context | 5 | 82688 | 2.11GB | 11.27GB | -9.16GB (-81.29%) | 1.02GB | 725.16MB | 316.4MB (43.63%) | 74.84% (11.97GB/16GB)
| Context | 5 | 50944 | 2.11GB | 11.27GB | -9.16GB (-81.29%) | 793.56MB | 601.16MB | 192.4MB (32.00%) | 74.08% (11.85GB/16GB)
| Context | 5 | 25344 | 2.11GB | 11.27GB | -9.16GB (-81.29%) | 593.56MB | 501.16MB | 92.4MB (18.44%) | 73.47% (11.76GB/16GB)
| Context | 5 | 4096 | 2.11GB | 11.27GB | -9.16GB (-81.29%) | 427.56MB | 418.16MB | 9.4MB (02.25%) | 72.97% (11.67GB/16GB)
| Context | 5 | 2048 | 2.11GB | 11.27GB | -9.16GB (-81.29%) | 411.56MB | 410.16MB | 1.4MB (00.34%) | 72.92% (11.67GB/16GB)
| Context | 5 | 1024 | 2.11GB | 11.27GB | -9.16GB (-81.29%) | 403.56MB | 406.16MB | -2.6MB (-0.64%) | 72.89% (11.66GB/16GB)
| Context | 5 | 512 | 2.11GB | 11.27GB | -9.16GB (-81.29%) | 399.06MB | 402.38MB | -3.32MB (-0.82%) | 72.87% (11.66GB/16GB)
| | | | | | | | | |
| Type | Layers | Context size | Estimated model VRAM | Model VRAM | Diff | Estimated context VRAM | Context VRAM | Diff | VRAM usage
| Model | 4 | | 1.69GB | 11.27GB | -9.58GB (-85.03%) | | | | 70.41% (11.27GB/16GB)
| Context | 4 | 131072 | 1.69GB | 11.27GB | -9.58GB (-85.03%) | 1.22GB | 912.66MB | 335.76MB (36.79%) | 75.98% (12.16GB/16GB)
| Context | 4 | 125184 | 1.69GB | 11.27GB | -9.58GB (-85.03%) | 1.18GB | 889.66MB | 320.43MB (36.02%) | 75.84% (12.14GB/16GB)
| Context | 4 | 82688 | 1.69GB | 11.27GB | -9.58GB (-85.03%) | 933.42MB | 723.66MB | 209.76MB (28.99%) | 74.83% (11.97GB/16GB)
| Context | 4 | 50944 | 1.69GB | 11.27GB | -9.58GB (-85.03%) | 726.75MB | 599.66MB | 127.09MB (21.19%) | 74.07% (11.85GB/16GB)
| Context | 4 | 25344 | 1.69GB | 11.27GB | -9.58GB (-85.03%) | 560.08MB | 499.66MB | 60.43MB (12.09%) | 73.46% (11.75GB/16GB)
| Context | 4 | 4096 | 1.69GB | 11.27GB | -9.58GB (-85.03%) | 421.75MB | 416.66MB | 5.09MB (01.22%) | 72.96% (11.67GB/16GB)
| Context | 4 | 2048 | 1.69GB | 11.27GB | -9.58GB (-85.03%) | 408.42MB | 408.66MB | -245.4KB (-0.06%) | 72.91% (11.67GB/16GB)
| Context | 4 | 1024 | 1.69GB | 11.27GB | -9.58GB (-85.03%) | 401.75MB | 404.66MB | -2.91MB (-0.72%) | 72.88% (11.66GB/16GB)
| Context | 4 | 512 | 1.69GB | 11.27GB | -9.58GB (-85.03%) | 398MB | 401.38MB | -3.38MB (-0.84%) | 72.86% (11.66GB/16GB)
| | | | | | | | | |
| Type | Layers | Context size | Estimated model VRAM | Model VRAM | Diff | Estimated context VRAM | Context VRAM | Diff | VRAM usage
| Model | 3 | | 1.26GB | 11.27GB | -10GB (-88.77%) | | | | 70.41% (11.27GB/16GB)
| Context | 3 | 131072 | 1.26GB | 11.27GB | -10GB (-88.77%) | 1.05GB | 656.66MB | 420.61MB (64.05%) | 74.42% (11.91GB/16GB)
| Context | 3 | 125184 | 1.26GB | 11.27GB | -10GB (-88.77%) | 1.02GB | 645.16MB | 401.44MB (62.22%) | 74.35% (11.9GB/16GB)
| Context | 3 | 82688 | 1.26GB | 11.27GB | -10GB (-88.77%) | 825.27MB | 562.16MB | 263.11MB (46.80%) | 73.85% (11.82GB/16GB)
| Context | 3 | 50944 | 1.26GB | 11.27GB | -10GB (-88.77%) | 659.93MB | 500.16MB | 159.78MB (31.95%) | 73.47% (11.75GB/16GB)
| Context | 3 | 25344 | 1.26GB | 11.27GB | -10GB (-88.77%) | 526.6MB | 450.16MB | 76.44MB (16.98%) | 73.16% (11.71GB/16GB)
| Context | 3 | 4096 | 1.26GB | 11.27GB | -10GB (-88.77%) | 415.93MB | 408.66MB | 7.28MB (01.78%) | 72.91% (11.67GB/16GB)
| Context | 3 | 2048 | 1.26GB | 11.27GB | -10GB (-88.77%) | 405.27MB | 404.66MB | 623.8KB (00.15%) | 72.88% (11.66GB/16GB)
| Context | 3 | 1024 | 1.26GB | 11.27GB | -10GB (-88.77%) | 399.93MB | 402.66MB | -2.72MB (-0.68%) | 72.87% (11.66GB/16GB)
| Context | 3 | 512 | 1.26GB | 11.27GB | -10GB (-88.77%) | 396.93MB | 400.38MB | -3.44MB (-0.86%) | 72.86% (11.66GB/16GB)
| | | | | | | | | |
| Type | Layers | Context size | Estimated model VRAM | Model VRAM | Diff | Estimated context VRAM | Context VRAM | Diff | VRAM usage
| Model | 2 | | 863.54MB | 11.27GB | -10.42GB (-92.51%) | | | | 70.41% (11.27GB/16GB)
| Context | 2 | 131072 | 863.54MB | 11.27GB | -10.42GB (-92.51%) | 906.13MB | 655.16MB | 250.97MB (38.31%) | 74.41% (11.91GB/16GB)
| Context | 2 | 125184 | 863.54MB | 11.27GB | -10.42GB (-92.51%) | 883.13MB | 643.66MB | 239.47MB (37.20%) | 74.34% (11.89GB/16GB)
| Context | 2 | 82688 | 863.54MB | 11.27GB | -10.42GB (-92.51%) | 717.13MB | 560.66MB | 156.47MB (27.91%) | 73.84% (11.81GB/16GB)
| Context | 2 | 50944 | 863.54MB | 11.27GB | -10.42GB (-92.51%) | 593.13MB | 498.66MB | 94.47MB (18.94%) | 73.46% (11.75GB/16GB)
| Context | 2 | 25344 | 863.54MB | 11.27GB | -10.42GB (-92.51%) | 493.13MB | 448.66MB | 44.47MB (09.91%) | 73.15% (11.7GB/16GB)
| Context | 2 | 4096 | 863.54MB | 11.27GB | -10.42GB (-92.51%) | 410.13MB | 407.16MB | 2.97MB (00.73%) | 72.90% (11.66GB/16GB)
| Context | 2 | 2048 | 863.54MB | 11.27GB | -10.42GB (-92.51%) | 402.13MB | 403.16MB | -1.03MB (-0.26%) | 72.87% (11.66GB/16GB)
| Context | 2 | 1024 | 863.54MB | 11.27GB | -10.42GB (-92.51%) | 398.13MB | 401.16MB | -3.03MB (-0.76%) | 72.86% (11.66GB/16GB)
| Context | 2 | 512 | 863.54MB | 11.27GB | -10.42GB (-92.51%) | 395.88MB | 399.38MB | -3.5MB (-0.88%) | 72.85% (11.66GB/16GB)
| | | | | | | | | |
| Type | Layers | Context size | Estimated model VRAM | Model VRAM | Diff | Estimated context VRAM | Context VRAM | Diff | VRAM usage
| Model | 1 | | 431.77MB | 586.86MB | -155.09MB (-26.43%) | | | | 03.58% (587.31MB/16GB)
| Context | 1 | 131072 | 431.77MB | 586.86MB | -155.09MB (-26.43%) | 734.98MB | 427.36MB | 307.62MB (71.98%) | 06.19% (1014.67MB/16GB)
| Context | 1 | 125184 | 431.77MB | 586.86MB | -155.09MB (-26.43%) | 719.65MB | 427.36MB | 292.29MB (68.39%) | 06.19% (1014.67MB/16GB)
| Context | 1 | 82688 | 431.77MB | 586.86MB | -155.09MB (-26.43%) | 608.98MB | 427.36MB | 181.62MB (42.50%) | 06.19% (1014.67MB/16GB)
| Context | 1 | 50944 | 431.77MB | 586.86MB | -155.09MB (-26.43%) | 526.31MB | 427.36MB | 98.95MB (23.15%) | 06.19% (1014.67MB/16GB)
| Context | 1 | 25344 | 431.77MB | 586.86MB | -155.09MB (-26.43%) | 459.65MB | 427.36MB | 32.29MB (07.56%) | 06.19% (1014.67MB/16GB)
| Context | 1 | 4096 | 431.77MB | 586.86MB | -155.09MB (-26.43%) | 404.31MB | 427.36MB | -23.05MB (-5.39%) | 06.19% (1014.67MB/16GB)
| Context | 1 | 2048 | 431.77MB | 586.86MB | -155.09MB (-26.43%) | 398.98MB | 427.36MB | -28.38MB (-6.64%) | 06.19% (1014.67MB/16GB)
| Context | 1 | 1024 | 431.77MB | 586.86MB | -155.09MB (-26.43%) | 396.31MB | 427.36MB | -31.05MB (-7.26%) | 06.19% (1014.67MB/16GB)
| Context | 1 | 512 | 431.77MB | 586.86MB | -155.09MB (-26.43%) | 394.81MB | 426.52MB | -31.7MB (-7.43%) | 06.19% (1013.83MB/16GB)
@ittaboba Thanks for sharing all these logs with me!
I think the current implementation didn't take into account the how much memory is needed for compute buffers. To check whether my hypothesis is correct, can you please try running this command?
npx --yes node-llama-cpp chat --debug --fa hf:giladgd/gpt-oss-20b-GGUF/gpt-oss-20b.MXFP4.gguf --prompt 'Hi there!' --contextSize 40000 --printTimings
It'd also be helpful if you can try customizing the vramPadding option to reserve more space for the compute buffers:
const llama = await getLlama({
// debug: true,
vramPadding(totalVram) {
return Math.floor(Math.min(totalVram * 0.10, 2 * Math.pow(1024, 3)));
}
});
Here are my logs for the command npx --yes node-llama-cpp chat --debug --fa hf:giladgd/gpt-oss-20b-GGUF/gpt-oss-20b.MXFP4.gguf --prompt 'Hi there!' --contextSize 40000 --printTimings
Log level: debug
load_backend: loaded BLAS backend from /Users/lorenzo/Projects/app/node_modules/@node-llama-cpp/mac-arm64-metal/bins/mac-arm64-metal/libggml-blas.so
ggml_metal_device_init: tensor API disabled for pre-M5 and pre-A19 devices
ggml_metal_library_init: using embedded metal library
ggml_metal_library_init: loaded in 0.006 sec
ggml_metal_rsets_init: creating a residency set collection (keep_alive = 180 s)
ggml_metal_device_init: GPU name: Apple M4 Pro
ggml_metal_device_init: GPU family: MTLGPUFamilyApple9 (1009)
ggml_metal_device_init: GPU family: MTLGPUFamilyCommon3 (3003)
ggml_metal_device_init: GPU family: MTLGPUFamilyMetal3 (5001)
ggml_metal_device_init: simdgroup reduction = true
ggml_metal_device_init: simdgroup matrix mul. = true
ggml_metal_device_init: has unified memory = true
ggml_metal_device_init: has bfloat = true
ggml_metal_device_init: has tensor = false
ggml_metal_device_init: use residency sets = true
ggml_metal_device_init: use shared buffers = true
ggml_metal_device_init: recommendedMaxWorkingSetSize = 17179.89 MB
load_backend: loaded Metal backend from /Users/lorenzo/Projects/app/node_modules/@node-llama-cpp/mac-arm64-metal/bins/mac-arm64-metal/libggml-metal.so
load_backend: loaded CPU backend from /Users/lorenzo/Projects/app/node_modules/@node-llama-cpp/mac-arm64-metal/bins/mac-arm64-metal/libggml-cpu.so
◷ Loading model
llama_model_load_from_file_impl: using device Metal (Apple M4 Pro) (unknown id) - 16383 MiB free
llama_model_loader: direct I/O is not available, using mmap
llama_model_loader: loaded meta data with 38 key-value pairs and 459 tensors from /Users/lorenzo/Library/Application Support/App/models/gpt-oss-20b.MXFP4.gguf (version GGUF V3 (latest))
llama_model_loader: Dumping metadata keys/values. Note: KV overrides do not apply in this output.
llama_model_loader: - kv 0: general.architecture str = gpt-oss
llama_model_loader: - kv 1: general.type str = model
llama_model_loader: - kv 2: general.name str = Gpt Oss 20b
llama_model_loader: - kv 3: general.basename str = gpt-oss
llama_model_loader: - kv 4: general.size_label str = 20B
llama_model_loader: - kv 5: general.license str = apache-2.0
llama_model_loader: - kv 6: general.tags arr[str,2] = ["vllm", "text-generation"]
llama_model_loader: - kv 7: gpt-oss.block_count u32 = 24
llama_model_loader: - kv 8: gpt-oss.context_length u32 = 131072
llama_model_loader: - kv 9: gpt-oss.embedding_length u32 = 2880
llama_model_loader: - kv 10: gpt-oss.feed_forward_length u32 = 2880
llama_model_loader: - kv 11: gpt-oss.attention.head_count u32 = 64
llama_model_loader: - kv 12: gpt-oss.attention.head_count_kv u32 = 8
llama_model_loader: - kv 13: gpt-oss.rope.freq_base f32 = 150000.000000
llama_model_loader: - kv 14: gpt-oss.attention.layer_norm_rms_epsilon f32 = 0.000010
llama_model_loader: - kv 15: gpt-oss.expert_count u32 = 32
llama_model_loader: - kv 16: gpt-oss.expert_used_count u32 = 4
llama_model_loader: - kv 17: gpt-oss.attention.key_length u32 = 64
llama_model_loader: - kv 18: gpt-oss.attention.value_length u32 = 64
llama_model_loader: - kv 19: gpt-oss.attention.sliding_window u32 = 128
llama_model_loader: - kv 20: gpt-oss.expert_feed_forward_length u32 = 2880
llama_model_loader: - kv 21: gpt-oss.rope.scaling.type str = yarn
llama_model_loader: - kv 22: gpt-oss.rope.scaling.factor f32 = 32.000000
llama_model_loader: - kv 23: gpt-oss.rope.scaling.original_context_length u32 = 4096
llama_model_loader: - kv 24: tokenizer.ggml.model str = gpt2
llama_model_loader: - kv 25: tokenizer.ggml.pre str = gpt-4o
llama_model_loader: - kv 26: tokenizer.ggml.tokens arr[str,201088] = ["!", "\"", "#", "$", "%", "&", "'", ...
llama_model_loader: - kv 27: tokenizer.ggml.token_type arr[i32,201088] = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, ...
llama_model_loader: - kv 28: tokenizer.ggml.merges arr[str,446189] = ["Ġ Ġ", "Ġ ĠĠĠ", "ĠĠ ĠĠ", "...
llama_model_loader: - kv 29: tokenizer.ggml.bos_token_id u32 = 199998
llama_model_loader: - kv 30: tokenizer.ggml.eos_token_id u32 = 200002
llama_model_loader: - kv 31: tokenizer.ggml.padding_token_id u32 = 199999
llama_model_loader: - kv 32: giladgd.version str = 1
llama_model_loader: - kv 33: giladgd.quantized_by str = giladgd
llama_model_loader: - kv 34: giladgd.quantized_at str = 2025-08-09T09:45:25+00:00
llama_model_loader: - kv 35: giladgd.source_type str = hf
llama_model_loader: - kv 36: general.quantization_version u32 = 2
llama_model_loader: - kv 37: general.file_type u32 = 38
llama_model_loader: - type f32: 289 tensors
llama_model_loader: - type q8_0: 98 tensors
llama_model_loader: - type mxfp4: 72 tensors
print_info: file format = GGUF V3 (latest)
print_info: file type = MXFP4 MoE
print_info: file size = 11.27 GiB (4.63 BPW)
init_tokenizer: initializing tokenizer for type 2
load: 0 unused tokens
load: control token: 200018 '<|endofprompt|>' is not marked as EOG
load: control token: 200013 '<|reserved_200013|>' is not marked as EOG
load: control token: 200009 '<|reserved_200009|>' is not marked as EOG
load: control token: 200008 '<|message|>' is not marked as EOG
load: control token: 200003 '<|constrain|>' is not marked as EOG
load: control token: 200001 '<|reserved_200001|>' is not marked as EOG
load: control token: 200000 '<|reserved_200000|>' is not marked as EOG
load: control token: 200005 '<|channel|>' is not marked as EOG
load: control token: 200010 '<|reserved_200010|>' is not marked as EOG
load: control token: 199998 '<|startoftext|>' is not marked as EOG
load: control token: 200006 '<|start|>' is not marked as EOG
load: control token: 200017 '<|reserved_200017|>' is not marked as EOG
load: control token: 200016 '<|reserved_200016|>' is not marked as EOG
load: control token: 200004 '<|reserved_200004|>' is not marked as EOG
load: control token: 200014 '<|reserved_200014|>' is not marked as EOG
load: control token: 200015 '<|reserved_200015|>' is not marked as EOG
load: control token: 200011 '<|reserved_200011|>' is not marked as EOG
load: setting token '<|message|>' (200008) attribute to USER_DEFINED (16), old attributes: 8
load: setting token '<|constrain|>' (200003) attribute to USER_DEFINED (16), old attributes: 8
load: setting token '<|channel|>' (200005) attribute to USER_DEFINED (16), old attributes: 8
load: setting token '<|start|>' (200006) attribute to USER_DEFINED (16), old attributes: 8
load: printing all EOG tokens:
load: - 199999 ('<|endoftext|>')
load: - 200002 ('<|return|>')
load: - 200007 ('<|end|>')
load: - 200012 ('<|call|>')
load: special_eog_ids contains both '<|return|>' and '<|call|>', or '<|calls|>' and '<|flush|>' tokens, removing '<|end|>' token from EOG list
load: special tokens cache size = 21
load: token to piece cache size = 1.3332 MB
print_info: arch = gpt-oss
print_info: vocab_only = 0
print_info: no_alloc = 0
print_info: n_ctx_train = 131072
print_info: n_embd = 2880
print_info: n_embd_inp = 2880
print_info: n_layer = 24
print_info: n_head = 64
print_info: n_head_kv = 8
print_info: n_rot = 64
print_info: n_swa = 128
print_info: is_swa_any = 1
print_info: n_embd_head_k = 64
print_info: n_embd_head_v = 64
print_info: n_gqa = 8
print_info: n_embd_k_gqa = 512
print_info: n_embd_v_gqa = 512
print_info: f_norm_eps = 0.0e+00
print_info: f_norm_rms_eps = 1.0e-05
print_info: f_clamp_kqv = 0.0e+00
print_info: f_max_alibi_bias = 0.0e+00
print_info: f_logit_scale = 0.0e+00
print_info: f_attn_scale = 0.0e+00
print_info: n_ff = 2880
print_info: n_expert = 32
print_info: n_expert_used = 4
print_info: n_expert_groups = 0
print_info: n_group_used = 0
print_info: causal attn = 1
print_info: pooling type = 0
print_info: rope type = 2
print_info: rope scaling = yarn
print_info: freq_base_train = 150000.0
print_info: freq_scale_train = 0.03125
print_info: freq_base_swa = 150000.0
print_info: freq_scale_swa = 0.03125
print_info: n_ctx_orig_yarn = 4096
print_info: rope_yarn_log_mul = 0.0000
print_info: rope_finetuned = unknown
print_info: model type = 20B
print_info: model params = 20.91 B
print_info: general.name = Gpt Oss 20b
print_info: n_ff_exp = 2880
print_info: vocab type = BPE
print_info: n_vocab = 201088
print_info: n_merges = 446189
print_info: BOS token = 199998 '<|startoftext|>'
print_info: EOS token = 200002 '<|return|>'
print_info: EOT token = 200007 '<|end|>'
print_info: PAD token = 199999 '<|endoftext|>'
print_info: LF token = 198 'Ċ'
print_info: EOG token = 199999 '<|endoftext|>'
print_info: EOG token = 200002 '<|return|>'
print_info: EOG token = 200012 '<|call|>'
print_info: max token length = 256
load_tensors: loading model tensors, this can take a while... (mmap = true, direct_io = false)
load_tensors: layer 0 assigned to device Metal, is_swa = 1
load_tensors: layer 1 assigned to device Metal, is_swa = 0
load_tensors: layer 2 assigned to device Metal, is_swa = 1
load_tensors: layer 3 assigned to device Metal, is_swa = 0
load_tensors: layer 4 assigned to device Metal, is_swa = 1
load_tensors: layer 5 assigned to device Metal, is_swa = 0
load_tensors: layer 6 assigned to device Metal, is_swa = 1
load_tensors: layer 7 assigned to device Metal, is_swa = 0
load_tensors: layer 8 assigned to device Metal, is_swa = 1
load_tensors: layer 9 assigned to device Metal, is_swa = 0
load_tensors: layer 10 assigned to device Metal, is_swa = 1
load_tensors: layer 11 assigned to device Metal, is_swa = 0
load_tensors: layer 12 assigned to device Metal, is_swa = 1
load_tensors: layer 13 assigned to device Metal, is_swa = 0
load_tensors: layer 14 assigned to device Metal, is_swa = 1
load_tensors: layer 15 assigned to device Metal, is_swa = 0
load_tensors: layer 16 assigned to device Metal, is_swa = 1
load_tensors: layer 17 assigned to device Metal, is_swa = 0
load_tensors: layer 18 assigned to device Metal, is_swa = 1
load_tensors: layer 19 assigned to device Metal, is_swa = 0
load_tensors: layer 20 assigned to device Metal, is_swa = 1
load_tensors: layer 21 assigned to device Metal, is_swa = 0
load_tensors: layer 22 assigned to device Metal, is_swa = 1
load_tensors: layer 23 assigned to device Metal, is_swa = 0
load_tensors: layer 24 assigned to device Metal, is_swa = 0
create_tensor: loading tensor token_embd.weight
create_tensor: loading tensor output_norm.weight
create_tensor: loading tensor output.weight
create_tensor: loading tensor blk.0.attn_norm.weight
create_tensor: loading tensor blk.0.post_attention_norm.weight
create_tensor: loading tensor blk.0.attn_q.weight
create_tensor: loading tensor blk.0.attn_k.weight
create_tensor: loading tensor blk.0.attn_v.weight
create_tensor: loading tensor blk.0.attn_output.weight
create_tensor: loading tensor blk.0.attn_sinks.weight
create_tensor: loading tensor blk.0.ffn_gate_inp.weight
create_tensor: loading tensor blk.0.ffn_gate_exps.weight
create_tensor: loading tensor blk.0.ffn_down_exps.weight
create_tensor: loading tensor blk.0.ffn_up_exps.weight
create_tensor: loading tensor blk.0.attn_q.bias
create_tensor: loading tensor blk.0.attn_k.bias
create_tensor: loading tensor blk.0.attn_v.bias
create_tensor: loading tensor blk.0.attn_output.bias
create_tensor: loading tensor blk.0.ffn_gate_inp.bias
create_tensor: loading tensor blk.0.ffn_gate_exps.bias
create_tensor: loading tensor blk.0.ffn_down_exps.bias
create_tensor: loading tensor blk.0.ffn_up_exps.bias
create_tensor: loading tensor blk.1.attn_norm.weight
create_tensor: loading tensor blk.1.post_attention_norm.weight
create_tensor: loading tensor blk.1.attn_q.weight
create_tensor: loading tensor blk.1.attn_k.weight
create_tensor: loading tensor blk.1.attn_v.weight
create_tensor: loading tensor blk.1.attn_output.weight
create_tensor: loading tensor blk.1.attn_sinks.weight
create_tensor: loading tensor blk.1.ffn_gate_inp.weight
create_tensor: loading tensor blk.1.ffn_gate_exps.weight
create_tensor: loading tensor blk.1.ffn_down_exps.weight
create_tensor: loading tensor blk.1.ffn_up_exps.weight
create_tensor: loading tensor blk.1.attn_q.bias
create_tensor: loading tensor blk.1.attn_k.bias
create_tensor: loading tensor blk.1.attn_v.bias
create_tensor: loading tensor blk.1.attn_output.bias
create_tensor: loading tensor blk.1.ffn_gate_inp.bias
create_tensor: loading tensor blk.1.ffn_gate_exps.bias
create_tensor: loading tensor blk.1.ffn_down_exps.bias
create_tensor: loading tensor blk.1.ffn_up_exps.bias
create_tensor: loading tensor blk.2.attn_norm.weight
create_tensor: loading tensor blk.2.post_attention_norm.weight
create_tensor: loading tensor blk.2.attn_q.weight
create_tensor: loading tensor blk.2.attn_k.weight
create_tensor: loading tensor blk.2.attn_v.weight
create_tensor: loading tensor blk.2.attn_output.weight
create_tensor: loading tensor blk.2.attn_sinks.weight
create_tensor: loading tensor blk.2.ffn_gate_inp.weight
create_tensor: loading tensor blk.2.ffn_gate_exps.weight
create_tensor: loading tensor blk.2.ffn_down_exps.weight
create_tensor: loading tensor blk.2.ffn_up_exps.weight
create_tensor: loading tensor blk.2.attn_q.bias
create_tensor: loading tensor blk.2.attn_k.bias
create_tensor: loading tensor blk.2.attn_v.bias
create_tensor: loading tensor blk.2.attn_output.bias
create_tensor: loading tensor blk.2.ffn_gate_inp.bias
create_tensor: loading tensor blk.2.ffn_gate_exps.bias
create_tensor: loading tensor blk.2.ffn_down_exps.bias
create_tensor: loading tensor blk.2.ffn_up_exps.bias
create_tensor: loading tensor blk.3.attn_norm.weight
create_tensor: loading tensor blk.3.post_attention_norm.weight
create_tensor: loading tensor blk.3.attn_q.weight
create_tensor: loading tensor blk.3.attn_k.weight
create_tensor: loading tensor blk.3.attn_v.weight
create_tensor: loading tensor blk.3.attn_output.weight
create_tensor: loading tensor blk.3.attn_sinks.weight
create_tensor: loading tensor blk.3.ffn_gate_inp.weight
create_tensor: loading tensor blk.3.ffn_gate_exps.weight
create_tensor: loading tensor blk.3.ffn_down_exps.weight
create_tensor: loading tensor blk.3.ffn_up_exps.weight
create_tensor: loading tensor blk.3.attn_q.bias
create_tensor: loading tensor blk.3.attn_k.bias
create_tensor: loading tensor blk.3.attn_v.bias
create_tensor: loading tensor blk.3.attn_output.bias
create_tensor: loading tensor blk.3.ffn_gate_inp.bias
create_tensor: loading tensor blk.3.ffn_gate_exps.bias
create_tensor: loading tensor blk.3.ffn_down_exps.bias
create_tensor: loading tensor blk.3.ffn_up_exps.bias
create_tensor: loading tensor blk.4.attn_norm.weight
create_tensor: loading tensor blk.4.post_attention_norm.weight
create_tensor: loading tensor blk.4.attn_q.weight
create_tensor: loading tensor blk.4.attn_k.weight
create_tensor: loading tensor blk.4.attn_v.weight
create_tensor: loading tensor blk.4.attn_output.weight
create_tensor: loading tensor blk.4.attn_sinks.weight
create_tensor: loading tensor blk.4.ffn_gate_inp.weight
create_tensor: loading tensor blk.4.ffn_gate_exps.weight
create_tensor: loading tensor blk.4.ffn_down_exps.weight
create_tensor: loading tensor blk.4.ffn_up_exps.weight
create_tensor: loading tensor blk.4.attn_q.bias
create_tensor: loading tensor blk.4.attn_k.bias
create_tensor: loading tensor blk.4.attn_v.bias
create_tensor: loading tensor blk.4.attn_output.bias
create_tensor: loading tensor blk.4.ffn_gate_inp.bias
create_tensor: loading tensor blk.4.ffn_gate_exps.bias
create_tensor: loading tensor blk.4.ffn_down_exps.bias
create_tensor: loading tensor blk.4.ffn_up_exps.bias
create_tensor: loading tensor blk.5.attn_norm.weight
create_tensor: loading tensor blk.5.post_attention_norm.weight
create_tensor: loading tensor blk.5.attn_q.weight
create_tensor: loading tensor blk.5.attn_k.weight
create_tensor: loading tensor blk.5.attn_v.weight
create_tensor: loading tensor blk.5.attn_output.weight
create_tensor: loading tensor blk.5.attn_sinks.weight
create_tensor: loading tensor blk.5.ffn_gate_inp.weight
create_tensor: loading tensor blk.5.ffn_gate_exps.weight
create_tensor: loading tensor blk.5.ffn_down_exps.weight
create_tensor: loading tensor blk.5.ffn_up_exps.weight
create_tensor: loading tensor blk.5.attn_q.bias
create_tensor: loading tensor blk.5.attn_k.bias
create_tensor: loading tensor blk.5.attn_v.bias
create_tensor: loading tensor blk.5.attn_output.bias
create_tensor: loading tensor blk.5.ffn_gate_inp.bias
create_tensor: loading tensor blk.5.ffn_gate_exps.bias
create_tensor: loading tensor blk.5.ffn_down_exps.bias
create_tensor: loading tensor blk.5.ffn_up_exps.bias
create_tensor: loading tensor blk.6.attn_norm.weight
create_tensor: loading tensor blk.6.post_attention_norm.weight
create_tensor: loading tensor blk.6.attn_q.weight
create_tensor: loading tensor blk.6.attn_k.weight
create_tensor: loading tensor blk.6.attn_v.weight
create_tensor: loading tensor blk.6.attn_output.weight
create_tensor: loading tensor blk.6.attn_sinks.weight
create_tensor: loading tensor blk.6.ffn_gate_inp.weight
create_tensor: loading tensor blk.6.ffn_gate_exps.weight
create_tensor: loading tensor blk.6.ffn_down_exps.weight
create_tensor: loading tensor blk.6.ffn_up_exps.weight
create_tensor: loading tensor blk.6.attn_q.bias
create_tensor: loading tensor blk.6.attn_k.bias
create_tensor: loading tensor blk.6.attn_v.bias
create_tensor: loading tensor blk.6.attn_output.bias
create_tensor: loading tensor blk.6.ffn_gate_inp.bias
create_tensor: loading tensor blk.6.ffn_gate_exps.bias
create_tensor: loading tensor blk.6.ffn_down_exps.bias
create_tensor: loading tensor blk.6.ffn_up_exps.bias
create_tensor: loading tensor blk.7.attn_norm.weight
create_tensor: loading tensor blk.7.post_attention_norm.weight
create_tensor: loading tensor blk.7.attn_q.weight
create_tensor: loading tensor blk.7.attn_k.weight
create_tensor: loading tensor blk.7.attn_v.weight
create_tensor: loading tensor blk.7.attn_output.weight
create_tensor: loading tensor blk.7.attn_sinks.weight
create_tensor: loading tensor blk.7.ffn_gate_inp.weight
create_tensor: loading tensor blk.7.ffn_gate_exps.weight
create_tensor: loading tensor blk.7.ffn_down_exps.weight
create_tensor: loading tensor blk.7.ffn_up_exps.weight
create_tensor: loading tensor blk.7.attn_q.bias
create_tensor: loading tensor blk.7.attn_k.bias
create_tensor: loading tensor blk.7.attn_v.bias
create_tensor: loading tensor blk.7.attn_output.bias
create_tensor: loading tensor blk.7.ffn_gate_inp.bias
create_tensor: loading tensor blk.7.ffn_gate_exps.bias
create_tensor: loading tensor blk.7.ffn_down_exps.bias
create_tensor: loading tensor blk.7.ffn_up_exps.bias
create_tensor: loading tensor blk.8.attn_norm.weight
create_tensor: loading tensor blk.8.post_attention_norm.weight
create_tensor: loading tensor blk.8.attn_q.weight
create_tensor: loading tensor blk.8.attn_k.weight
create_tensor: loading tensor blk.8.attn_v.weight
create_tensor: loading tensor blk.8.attn_output.weight
create_tensor: loading tensor blk.8.attn_sinks.weight
create_tensor: loading tensor blk.8.ffn_gate_inp.weight
create_tensor: loading tensor blk.8.ffn_gate_exps.weight
create_tensor: loading tensor blk.8.ffn_down_exps.weight
create_tensor: loading tensor blk.8.ffn_up_exps.weight
create_tensor: loading tensor blk.8.attn_q.bias
create_tensor: loading tensor blk.8.attn_k.bias
create_tensor: loading tensor blk.8.attn_v.bias
create_tensor: loading tensor blk.8.attn_output.bias
create_tensor: loading tensor blk.8.ffn_gate_inp.bias
create_tensor: loading tensor blk.8.ffn_gate_exps.bias
create_tensor: loading tensor blk.8.ffn_down_exps.bias
create_tensor: loading tensor blk.8.ffn_up_exps.bias
create_tensor: loading tensor blk.9.attn_norm.weight
create_tensor: loading tensor blk.9.post_attention_norm.weight
create_tensor: loading tensor blk.9.attn_q.weight
create_tensor: loading tensor blk.9.attn_k.weight
create_tensor: loading tensor blk.9.attn_v.weight
create_tensor: loading tensor blk.9.attn_output.weight
create_tensor: loading tensor blk.9.attn_sinks.weight
create_tensor: loading tensor blk.9.ffn_gate_inp.weight
create_tensor: loading tensor blk.9.ffn_gate_exps.weight
create_tensor: loading tensor blk.9.ffn_down_exps.weight
create_tensor: loading tensor blk.9.ffn_up_exps.weight
create_tensor: loading tensor blk.9.attn_q.bias
create_tensor: loading tensor blk.9.attn_k.bias
create_tensor: loading tensor blk.9.attn_v.bias
create_tensor: loading tensor blk.9.attn_output.bias
create_tensor: loading tensor blk.9.ffn_gate_inp.bias
create_tensor: loading tensor blk.9.ffn_gate_exps.bias
create_tensor: loading tensor blk.9.ffn_down_exps.bias
create_tensor: loading tensor blk.9.ffn_up_exps.bias
create_tensor: loading tensor blk.10.attn_norm.weight
create_tensor: loading tensor blk.10.post_attention_norm.weight
create_tensor: loading tensor blk.10.attn_q.weight
create_tensor: loading tensor blk.10.attn_k.weight
create_tensor: loading tensor blk.10.attn_v.weight
create_tensor: loading tensor blk.10.attn_output.weight
create_tensor: loading tensor blk.10.attn_sinks.weight
create_tensor: loading tensor blk.10.ffn_gate_inp.weight
create_tensor: loading tensor blk.10.ffn_gate_exps.weight
create_tensor: loading tensor blk.10.ffn_down_exps.weight
create_tensor: loading tensor blk.10.ffn_up_exps.weight
create_tensor: loading tensor blk.10.attn_q.bias
create_tensor: loading tensor blk.10.attn_k.bias
create_tensor: loading tensor blk.10.attn_v.bias
create_tensor: loading tensor blk.10.attn_output.bias
create_tensor: loading tensor blk.10.ffn_gate_inp.bias
create_tensor: loading tensor blk.10.ffn_gate_exps.bias
create_tensor: loading tensor blk.10.ffn_down_exps.bias
create_tensor: loading tensor blk.10.ffn_up_exps.bias
create_tensor: loading tensor blk.11.attn_norm.weight
create_tensor: loading tensor blk.11.post_attention_norm.weight
create_tensor: loading tensor blk.11.attn_q.weight
create_tensor: loading tensor blk.11.attn_k.weight
create_tensor: loading tensor blk.11.attn_v.weight
create_tensor: loading tensor blk.11.attn_output.weight
create_tensor: loading tensor blk.11.attn_sinks.weight
create_tensor: loading tensor blk.11.ffn_gate_inp.weight
create_tensor: loading tensor blk.11.ffn_gate_exps.weight
create_tensor: loading tensor blk.11.ffn_down_exps.weight
create_tensor: loading tensor blk.11.ffn_up_exps.weight
create_tensor: loading tensor blk.11.attn_q.bias
create_tensor: loading tensor blk.11.attn_k.bias
create_tensor: loading tensor blk.11.attn_v.bias
create_tensor: loading tensor blk.11.attn_output.bias
create_tensor: loading tensor blk.11.ffn_gate_inp.bias
create_tensor: loading tensor blk.11.ffn_gate_exps.bias
create_tensor: loading tensor blk.11.ffn_down_exps.bias
create_tensor: loading tensor blk.11.ffn_up_exps.bias
create_tensor: loading tensor blk.12.attn_norm.weight
create_tensor: loading tensor blk.12.post_attention_norm.weight
create_tensor: loading tensor blk.12.attn_q.weight
create_tensor: loading tensor blk.12.attn_k.weight
create_tensor: loading tensor blk.12.attn_v.weight
create_tensor: loading tensor blk.12.attn_output.weight
create_tensor: loading tensor blk.12.attn_sinks.weight
create_tensor: loading tensor blk.12.ffn_gate_inp.weight
create_tensor: loading tensor blk.12.ffn_gate_exps.weight
create_tensor: loading tensor blk.12.ffn_down_exps.weight
create_tensor: loading tensor blk.12.ffn_up_exps.weight
create_tensor: loading tensor blk.12.attn_q.bias
create_tensor: loading tensor blk.12.attn_k.bias
create_tensor: loading tensor blk.12.attn_v.bias
create_tensor: loading tensor blk.12.attn_output.bias
create_tensor: loading tensor blk.12.ffn_gate_inp.bias
create_tensor: loading tensor blk.12.ffn_gate_exps.bias
create_tensor: loading tensor blk.12.ffn_down_exps.bias
create_tensor: loading tensor blk.12.ffn_up_exps.bias
create_tensor: loading tensor blk.13.attn_norm.weight
create_tensor: loading tensor blk.13.post_attention_norm.weight
create_tensor: loading tensor blk.13.attn_q.weight
create_tensor: loading tensor blk.13.attn_k.weight
create_tensor: loading tensor blk.13.attn_v.weight
create_tensor: loading tensor blk.13.attn_output.weight
create_tensor: loading tensor blk.13.attn_sinks.weight
create_tensor: loading tensor blk.13.ffn_gate_inp.weight
create_tensor: loading tensor blk.13.ffn_gate_exps.weight
create_tensor: loading tensor blk.13.ffn_down_exps.weight
create_tensor: loading tensor blk.13.ffn_up_exps.weight
create_tensor: loading tensor blk.13.attn_q.bias
create_tensor: loading tensor blk.13.attn_k.bias
create_tensor: loading tensor blk.13.attn_v.bias
create_tensor: loading tensor blk.13.attn_output.bias
create_tensor: loading tensor blk.13.ffn_gate_inp.bias
create_tensor: loading tensor blk.13.ffn_gate_exps.bias
create_tensor: loading tensor blk.13.ffn_down_exps.bias
create_tensor: loading tensor blk.13.ffn_up_exps.bias
create_tensor: loading tensor blk.14.attn_norm.weight
create_tensor: loading tensor blk.14.post_attention_norm.weight
create_tensor: loading tensor blk.14.attn_q.weight
create_tensor: loading tensor blk.14.attn_k.weight
create_tensor: loading tensor blk.14.attn_v.weight
create_tensor: loading tensor blk.14.attn_output.weight
create_tensor: loading tensor blk.14.attn_sinks.weight
create_tensor: loading tensor blk.14.ffn_gate_inp.weight
create_tensor: loading tensor blk.14.ffn_gate_exps.weight
create_tensor: loading tensor blk.14.ffn_down_exps.weight
create_tensor: loading tensor blk.14.ffn_up_exps.weight
create_tensor: loading tensor blk.14.attn_q.bias
create_tensor: loading tensor blk.14.attn_k.bias
create_tensor: loading tensor blk.14.attn_v.bias
create_tensor: loading tensor blk.14.attn_output.bias
create_tensor: loading tensor blk.14.ffn_gate_inp.bias
create_tensor: loading tensor blk.14.ffn_gate_exps.bias
create_tensor: loading tensor blk.14.ffn_down_exps.bias
create_tensor: loading tensor blk.14.ffn_up_exps.bias
create_tensor: loading tensor blk.15.attn_norm.weight
create_tensor: loading tensor blk.15.post_attention_norm.weight
create_tensor: loading tensor blk.15.attn_q.weight
create_tensor: loading tensor blk.15.attn_k.weight
create_tensor: loading tensor blk.15.attn_v.weight
create_tensor: loading tensor blk.15.attn_output.weight
create_tensor: loading tensor blk.15.attn_sinks.weight
create_tensor: loading tensor blk.15.ffn_gate_inp.weight
create_tensor: loading tensor blk.15.ffn_gate_exps.weight
create_tensor: loading tensor blk.15.ffn_down_exps.weight
create_tensor: loading tensor blk.15.ffn_up_exps.weight
create_tensor: loading tensor blk.15.attn_q.bias
create_tensor: loading tensor blk.15.attn_k.bias
create_tensor: loading tensor blk.15.attn_v.bias
create_tensor: loading tensor blk.15.attn_output.bias
create_tensor: loading tensor blk.15.ffn_gate_inp.bias
create_tensor: loading tensor blk.15.ffn_gate_exps.bias
create_tensor: loading tensor blk.15.ffn_down_exps.bias
create_tensor: loading tensor blk.15.ffn_up_exps.bias
create_tensor: loading tensor blk.16.attn_norm.weight
create_tensor: loading tensor blk.16.post_attention_norm.weight
create_tensor: loading tensor blk.16.attn_q.weight
create_tensor: loading tensor blk.16.attn_k.weight
create_tensor: loading tensor blk.16.attn_v.weight
create_tensor: loading tensor blk.16.attn_output.weight
create_tensor: loading tensor blk.16.attn_sinks.weight
create_tensor: loading tensor blk.16.ffn_gate_inp.weight
create_tensor: loading tensor blk.16.ffn_gate_exps.weight
create_tensor: loading tensor blk.16.ffn_down_exps.weight
create_tensor: loading tensor blk.16.ffn_up_exps.weight
create_tensor: loading tensor blk.16.attn_q.bias
create_tensor: loading tensor blk.16.attn_k.bias
create_tensor: loading tensor blk.16.attn_v.bias
create_tensor: loading tensor blk.16.attn_output.bias
create_tensor: loading tensor blk.16.ffn_gate_inp.bias
create_tensor: loading tensor blk.16.ffn_gate_exps.bias
create_tensor: loading tensor blk.16.ffn_down_exps.bias
create_tensor: loading tensor blk.16.ffn_up_exps.bias
create_tensor: loading tensor blk.17.attn_norm.weight
create_tensor: loading tensor blk.17.post_attention_norm.weight
create_tensor: loading tensor blk.17.attn_q.weight
create_tensor: loading tensor blk.17.attn_k.weight
create_tensor: loading tensor blk.17.attn_v.weight
create_tensor: loading tensor blk.17.attn_output.weight
create_tensor: loading tensor blk.17.attn_sinks.weight
create_tensor: loading tensor blk.17.ffn_gate_inp.weight
create_tensor: loading tensor blk.17.ffn_gate_exps.weight
create_tensor: loading tensor blk.17.ffn_down_exps.weight
create_tensor: loading tensor blk.17.ffn_up_exps.weight
create_tensor: loading tensor blk.17.attn_q.bias
create_tensor: loading tensor blk.17.attn_k.bias
create_tensor: loading tensor blk.17.attn_v.bias
create_tensor: loading tensor blk.17.attn_output.bias
create_tensor: loading tensor blk.17.ffn_gate_inp.bias
create_tensor: loading tensor blk.17.ffn_gate_exps.bias
create_tensor: loading tensor blk.17.ffn_down_exps.bias
create_tensor: loading tensor blk.17.ffn_up_exps.bias
create_tensor: loading tensor blk.18.attn_norm.weight
create_tensor: loading tensor blk.18.post_attention_norm.weight
create_tensor: loading tensor blk.18.attn_q.weight
create_tensor: loading tensor blk.18.attn_k.weight
create_tensor: loading tensor blk.18.attn_v.weight
create_tensor: loading tensor blk.18.attn_output.weight
create_tensor: loading tensor blk.18.attn_sinks.weight
create_tensor: loading tensor blk.18.ffn_gate_inp.weight
create_tensor: loading tensor blk.18.ffn_gate_exps.weight
create_tensor: loading tensor blk.18.ffn_down_exps.weight
create_tensor: loading tensor blk.18.ffn_up_exps.weight
create_tensor: loading tensor blk.18.attn_q.bias
create_tensor: loading tensor blk.18.attn_k.bias
create_tensor: loading tensor blk.18.attn_v.bias
create_tensor: loading tensor blk.18.attn_output.bias
create_tensor: loading tensor blk.18.ffn_gate_inp.bias
create_tensor: loading tensor blk.18.ffn_gate_exps.bias
create_tensor: loading tensor blk.18.ffn_down_exps.bias
create_tensor: loading tensor blk.18.ffn_up_exps.bias
create_tensor: loading tensor blk.19.attn_norm.weight
create_tensor: loading tensor blk.19.post_attention_norm.weight
create_tensor: loading tensor blk.19.attn_q.weight
create_tensor: loading tensor blk.19.attn_k.weight
create_tensor: loading tensor blk.19.attn_v.weight
create_tensor: loading tensor blk.19.attn_output.weight
create_tensor: loading tensor blk.19.attn_sinks.weight
create_tensor: loading tensor blk.19.ffn_gate_inp.weight
create_tensor: loading tensor blk.19.ffn_gate_exps.weight
create_tensor: loading tensor blk.19.ffn_down_exps.weight
create_tensor: loading tensor blk.19.ffn_up_exps.weight
create_tensor: loading tensor blk.19.attn_q.bias
create_tensor: loading tensor blk.19.attn_k.bias
create_tensor: loading tensor blk.19.attn_v.bias
create_tensor: loading tensor blk.19.attn_output.bias
create_tensor: loading tensor blk.19.ffn_gate_inp.bias
create_tensor: loading tensor blk.19.ffn_gate_exps.bias
create_tensor: loading tensor blk.19.ffn_down_exps.bias
create_tensor: loading tensor blk.19.ffn_up_exps.bias
create_tensor: loading tensor blk.20.attn_norm.weight
create_tensor: loading tensor blk.20.post_attention_norm.weight
create_tensor: loading tensor blk.20.attn_q.weight
create_tensor: loading tensor blk.20.attn_k.weight
create_tensor: loading tensor blk.20.attn_v.weight
create_tensor: loading tensor blk.20.attn_output.weight
create_tensor: loading tensor blk.20.attn_sinks.weight
create_tensor: loading tensor blk.20.ffn_gate_inp.weight
create_tensor: loading tensor blk.20.ffn_gate_exps.weight
create_tensor: loading tensor blk.20.ffn_down_exps.weight
create_tensor: loading tensor blk.20.ffn_up_exps.weight
create_tensor: loading tensor blk.20.attn_q.bias
create_tensor: loading tensor blk.20.attn_k.bias
create_tensor: loading tensor blk.20.attn_v.bias
create_tensor: loading tensor blk.20.attn_output.bias
create_tensor: loading tensor blk.20.ffn_gate_inp.bias
create_tensor: loading tensor blk.20.ffn_gate_exps.bias
create_tensor: loading tensor blk.20.ffn_down_exps.bias
create_tensor: loading tensor blk.20.ffn_up_exps.bias
create_tensor: loading tensor blk.21.attn_norm.weight
create_tensor: loading tensor blk.21.post_attention_norm.weight
create_tensor: loading tensor blk.21.attn_q.weight
create_tensor: loading tensor blk.21.attn_k.weight
create_tensor: loading tensor blk.21.attn_v.weight
create_tensor: loading tensor blk.21.attn_output.weight
create_tensor: loading tensor blk.21.attn_sinks.weight
create_tensor: loading tensor blk.21.ffn_gate_inp.weight
create_tensor: loading tensor blk.21.ffn_gate_exps.weight
create_tensor: loading tensor blk.21.ffn_down_exps.weight
create_tensor: loading tensor blk.21.ffn_up_exps.weight
create_tensor: loading tensor blk.21.attn_q.bias
create_tensor: loading tensor blk.21.attn_k.bias
create_tensor: loading tensor blk.21.attn_v.bias
create_tensor: loading tensor blk.21.attn_output.bias
create_tensor: loading tensor blk.21.ffn_gate_inp.bias
create_tensor: loading tensor blk.21.ffn_gate_exps.bias
create_tensor: loading tensor blk.21.ffn_down_exps.bias
create_tensor: loading tensor blk.21.ffn_up_exps.bias
create_tensor: loading tensor blk.22.attn_norm.weight
create_tensor: loading tensor blk.22.post_attention_norm.weight
create_tensor: loading tensor blk.22.attn_q.weight
create_tensor: loading tensor blk.22.attn_k.weight
create_tensor: loading tensor blk.22.attn_v.weight
create_tensor: loading tensor blk.22.attn_output.weight
create_tensor: loading tensor blk.22.attn_sinks.weight
create_tensor: loading tensor blk.22.ffn_gate_inp.weight
create_tensor: loading tensor blk.22.ffn_gate_exps.weight
create_tensor: loading tensor blk.22.ffn_down_exps.weight
create_tensor: loading tensor blk.22.ffn_up_exps.weight
create_tensor: loading tensor blk.22.attn_q.bias
create_tensor: loading tensor blk.22.attn_k.bias
create_tensor: loading tensor blk.22.attn_v.bias
create_tensor: loading tensor blk.22.attn_output.bias
create_tensor: loading tensor blk.22.ffn_gate_inp.bias
create_tensor: loading tensor blk.22.ffn_gate_exps.bias
create_tensor: loading tensor blk.22.ffn_down_exps.bias
create_tensor: loading tensor blk.22.ffn_up_exps.bias
create_tensor: loading tensor blk.23.attn_norm.weight
create_tensor: loading tensor blk.23.post_attention_norm.weight
create_tensor: loading tensor blk.23.attn_q.weight
create_tensor: loading tensor blk.23.attn_k.weight
create_tensor: loading tensor blk.23.attn_v.weight
create_tensor: loading tensor blk.23.attn_output.weight
create_tensor: loading tensor blk.23.attn_sinks.weight
create_tensor: loading tensor blk.23.ffn_gate_inp.weight
create_tensor: loading tensor blk.23.ffn_gate_exps.weight
create_tensor: loading tensor blk.23.ffn_down_exps.weight
create_tensor: loading tensor blk.23.ffn_up_exps.weight
create_tensor: loading tensor blk.23.attn_q.bias
create_tensor: loading tensor blk.23.attn_k.bias
create_tensor: loading tensor blk.23.attn_v.bias
create_tensor: loading tensor blk.23.attn_output.bias
create_tensor: loading tensor blk.23.ffn_gate_inp.bias
create_tensor: loading tensor blk.23.ffn_gate_exps.bias
create_tensor: loading tensor blk.23.ffn_down_exps.bias
create_tensor: loading tensor blk.23.ffn_up_exps.bias
load_tensors: tensor 'token_embd.weight' (q8_0) (and 0 others) cannot be used with preferred buffer type CPU_REPACK, using CPU instead
ggml_metal_log_allocated_size: allocated buffer, size = 11536.20 MiB, (11536.66 / 16384.02)
load_tensors: offloading output layer to GPU
load_tensors: offloading 23 repeating layers to GPU
load_tensors: offloaded 25/25 layers to GPU
load_tensors: CPU_Mapped model buffer size = 586.82 MiB
load_tensors: Metal_Mapped model buffer size = 11536.18 MiB
.................................................................................
✔ Model loaded
◷ Creating context
llama_context: constructing llama_context
llama_context: n_seq_max = 1
llama_context: n_ctx = 40192
llama_context: n_ctx_seq = 40192
llama_context: n_batch = 513
llama_context: n_ubatch = 513
llama_context: causal_attn = 1
llama_context: flash_attn = enabled
llama_context: kv_unified = false
llama_context: freq_base = 150000.0
llama_context: freq_scale = 0.03125
llama_context: n_ctx_seq (40192) < n_ctx_train (131072) -- the full capacity of the model will not be utilized
ggml_metal_init: allocating
ggml_metal_init: found device: Apple M4 Pro
ggml_metal_init: picking default device: Apple M4 Pro
ggml_metal_init: use fusion = true
ggml_metal_init: use concurrency = true
ggml_metal_init: use graph optimize = true
set_abort_callback: call
llama_context: CPU output buffer size = 0.77 MiB
llama_kv_cache_iswa: creating non-SWA KV cache, size = 40192 cells
llama_kv_cache: layer 0: filtered
llama_kv_cache: layer 1: dev = Metal
llama_kv_cache: layer 2: filtered
llama_kv_cache: layer 3: dev = Metal
llama_kv_cache: layer 4: filtered
llama_kv_cache: layer 5: dev = Metal
llama_kv_cache: layer 6: filtered
llama_kv_cache: layer 7: dev = Metal
llama_kv_cache: layer 8: filtered
llama_kv_cache: layer 9: dev = Metal
llama_kv_cache: layer 10: filtered
llama_kv_cache: layer 11: dev = Metal
llama_kv_cache: layer 12: filtered
llama_kv_cache: layer 13: dev = Metal
llama_kv_cache: layer 14: filtered
llama_kv_cache: layer 15: dev = Metal
llama_kv_cache: layer 16: filtered
llama_kv_cache: layer 17: dev = Metal
llama_kv_cache: layer 18: filtered
llama_kv_cache: layer 19: dev = Metal
llama_kv_cache: layer 20: filtered
llama_kv_cache: layer 21: dev = Metal
llama_kv_cache: layer 22: filtered
llama_kv_cache: layer 23: dev = Metal
llama_kv_cache: Metal KV buffer size = 942.00 MiB
llama_kv_cache: size = 942.00 MiB ( 40192 cells, 12 layers, 1/1 seqs), K (f16): 471.00 MiB, V (f16): 471.00 MiB
llama_kv_cache_iswa: creating SWA KV cache, size = 768 cells
llama_kv_cache: layer 0: dev = Metal
llama_kv_cache: layer 1: filtered
llama_kv_cache: layer 2: dev = Metal
llama_kv_cache: layer 3: filtered
llama_kv_cache: layer 4: dev = Metal
llama_kv_cache: layer 5: filtered
llama_kv_cache: layer 6: dev = Metal
llama_kv_cache: layer 7: filtered
llama_kv_cache: layer 8: dev = Metal
llama_kv_cache: layer 9: filtered
llama_kv_cache: layer 10: dev = Metal
llama_kv_cache: layer 11: filtered
llama_kv_cache: layer 12: dev = Metal
llama_kv_cache: layer 13: filtered
llama_kv_cache: layer 14: dev = Metal
llama_kv_cache: layer 15: filtered
llama_kv_cache: layer 16: dev = Metal
llama_kv_cache: layer 17: filtered
llama_kv_cache: layer 18: dev = Metal
llama_kv_cache: layer 19: filtered
llama_kv_cache: layer 20: dev = Metal
llama_kv_cache: layer 21: filtered
llama_kv_cache: layer 22: dev = Metal
llama_kv_cache: layer 23: filtered
llama_kv_cache: Metal KV buffer size = 18.00 MiB
llama_kv_cache: size = 18.00 MiB ( 768 cells, 12 layers, 1/1 seqs), K (f16): 9.00 MiB, V (f16): 9.00 MiB
llama_context: enumerating backends
llama_context: backend_ptrs.size() = 3
sched_reserve: reserving ...
sched_reserve: max_nodes = 3672
sched_reserve: reserving full memory module
sched_reserve: worst-case: n_tokens = 513, n_seqs = 1, n_outputs = 1
graph_reserve: reserving a graph for ubatch with n_tokens = 513, n_seqs = 1, n_outputs = 513
graph_reserve: reserving a graph for ubatch with n_tokens = 1, n_seqs = 1, n_outputs = 1
graph_reserve: reserving a graph for ubatch with n_tokens = 513, n_seqs = 1, n_outputs = 513
sched_reserve: Metal compute buffer size = 404.79 MiB
sched_reserve: CPU compute buffer size = 91.45 MiB
sched_reserve: graph nodes = 1352
sched_reserve: graph splits = 2
sched_reserve: reserve took 129.91 ms, sched copies = 1
state_write_data: writing state
state_write_data: - writing model info
state_write_data: - writing output ids
state_write_data: - writing logits
state_write_data: - writing embeddings
state_write_data: - writing memory module
✔ Context created
GPU Type: Metal VRAM: 16GB Name: Apple M4 Pro
Model Type: gpt-oss 20B MXFP4 MoE Size: 11.27GB GPU layers: 25/25 offloaded (100%) mmap: enabled BOS: <|startoftext|> EOS: <|return|> Train context size: 131,072
Context Size: 40,192 Threads: 8 Flash attention: enabled
Chat Wrapper: Harmony Repeat penalty: 1.1 (apply to last 64 tokens)
> Hi there!
AI: ggml_metal_library_compile_pipeline: compiling pipeline: base = 'kernel_rms_norm_mul_f32_4', name = 'kernel_rms_norm_mul_f32_4'
ggml_metal_library_compile_pipeline: loaded kernel_rms_norm_mul_f32_4 0x145ffbf40 | th_max = 1024 | th_width = 32
ggml_metal_library_compile_pipeline: compiling pipeline: base = 'kernel_mul_mm_q8_0_f32', name = 'kernel_mul_mm_q8_0_f32_bci=0_bco=1'
ggml_metal_library_compile_pipeline: loaded kernel_mul_mm_q8_0_f32_bci=0_bco=1 0x147efafa0 | th_max = 1024 | th_width = 32
ggml_metal_library_compile_pipeline: compiling pipeline: base = 'kernel_add_row_c4_fuse_1', name = 'kernel_add_row_c4_fuse_1'
ggml_metal_library_compile_pipeline: loaded kernel_add_row_c4_fuse_1 0x143606660 | th_max = 1024 | th_width = 32
ggml_metal_library_compile_pipeline: compiling pipeline: base = 'kernel_rope_neox_f32', name = 'kernel_rope_neox_f32_imrope=0'
ggml_metal_library_compile_pipeline: loaded kernel_rope_neox_f32_imrope=0 0x11bf04630 | th_max = 1024 | th_width = 32
ggml_metal_library_compile_pipeline: compiling pipeline: base = 'kernel_set_rows_f16_i64', name = 'kernel_set_rows_f16_i64'
ggml_metal_library_compile_pipeline: loaded kernel_set_rows_f16_i64 0x11bf04e00 | th_max = 1024 | th_width = 32
ggml_metal_library_compile_pipeline: compiling pipeline: base = 'kernel_cpy_f32_f16', name = 'kernel_cpy_f32_f16'
ggml_metal_library_compile_pipeline: loaded kernel_cpy_f32_f16 0x132b08f70 | th_max = 1024 | th_width = 32
ggml_metal_library_compile_pipeline: compiling pipeline: base = 'kernel_flash_attn_ext_blk', name = 'kernel_flash_attn_ext_blk_nqptg=8_ncpsg=64'
ggml_metal_library_compile_pipeline: loaded kernel_flash_attn_ext_blk_nqptg=8_ncpsg=64 0x1437772e0 | th_max = 1024 | th_width = 32
ggml_metal_library_compile_pipeline: compiling pipeline: base = 'kernel_flash_attn_ext_f16_dk64_dv64', name = 'kernel_flash_attn_ext_f16_dk64_dv64_mask=1_sinks=1_bias=0_scap=0_kvpad=0_bcm=1_ns10=512_ns20=512_nsg=4'
ggml_metal_library_compile_pipeline: loaded kernel_flash_attn_ext_f16_dk64_dv64_mask=1_sinks=1_bias=0_scap=0_kvpad=0_bcm=1_ns10=512_ns20=512_nsg=4 0x143608a50 | th_max = 1024 | th_width = 32
ggml_metal_library_compile_pipeline: compiling pipeline: base = 'kernel_add_fuse_1', name = 'kernel_add_fuse_1'
ggml_metal_library_compile_pipeline: loaded kernel_add_fuse_1 0x1437760b0 | th_max = 1024 | th_width = 32
ggml_metal_library_compile_pipeline: compiling pipeline: base = 'kernel_mul_mm_f32_f32', name = 'kernel_mul_mm_f32_f32_bci=0_bco=1'
ggml_metal_library_compile_pipeline: loaded kernel_mul_mm_f32_f32_bci=0_bco=1 0x143778bc0 | th_max = 1024 | th_width = 32
ggml_metal_library_compile_pipeline: compiling pipeline: base = 'kernel_argsort_f32_i32_desc', name = 'kernel_argsort_f32_i32_desc'
ggml_metal_library_compile_pipeline: loaded kernel_argsort_f32_i32_desc 0x143777f30 | th_max = 1024 | th_width = 32
ggml_metal_library_compile_pipeline: compiling pipeline: base = 'kernel_argsort_merge_f32_i32_desc', name = 'kernel_argsort_merge_f32_i32_desc'
ggml_metal_library_compile_pipeline: loaded kernel_argsort_merge_f32_i32_desc 0x143778710 | th_max = 1024 | th_width = 32
ggml_metal_library_compile_pipeline: compiling pipeline: base = 'kernel_get_rows_f32', name = 'kernel_get_rows_f32'
ggml_metal_library_compile_pipeline: loaded kernel_get_rows_f32 0x14377a050 | th_max = 1024 | th_width = 32
ggml_metal_library_compile_pipeline: compiling pipeline: base = 'kernel_soft_max_f32_4', name = 'kernel_soft_max_f32_4'
ggml_metal_library_compile_pipeline: loaded kernel_soft_max_f32_4 0x14377a9e0 | th_max = 1024 | th_width = 32
ggml_metal_library_compile_pipeline: compiling pipeline: base = 'kernel_mul_mm_id_map0_ne20_4', name = 'kernel_mul_mm_id_map0_ne20_4_ne02=32'
ggml_metal_library_compile_pipeline: loaded kernel_mul_mm_id_map0_ne20_4_ne02=32 0x14377b700 | th_max = 1024 | th_width = 32
ggml_metal_library_compile_pipeline: compiling pipeline: base = 'kernel_mul_mm_id_mxfp4_f32', name = 'kernel_mul_mm_id_mxfp4_f32_bci=0'
ggml_metal_library_compile_pipeline: loaded kernel_mul_mm_id_mxfp4_f32_bci=0 0x137b331b0 | th_max = 1024 | th_width = 32
ggml_metal_library_compile_pipeline: compiling pipeline: base = 'kernel_add_id', name = 'kernel_add_id'
ggml_metal_library_compile_pipeline: loaded kernel_add_id 0x137b328f0 | th_max = 1024 | th_width = 32
ggml_metal_library_compile_pipeline: compiling pipeline: base = 'kernel_swiglu_oai_f32', name = 'kernel_swiglu_oai_f32'
ggml_metal_library_compile_pipeline: loaded kernel_swiglu_oai_f32 0x137b33960 | th_max = 1024 | th_width = 32
ggml_metal_library_compile_pipeline: compiling pipeline: base = 'kernel_mul_fuse_1', name = 'kernel_mul_fuse_1'
ggml_metal_library_compile_pipeline: loaded kernel_mul_fuse_1 0x137b347a0 | th_max = 1024 | th_width = 32
ggml_metal_library_compile_pipeline: compiling pipeline: base = 'kernel_add_fuse_3', name = 'kernel_add_fuse_3'
ggml_metal_library_compile_pipeline: loaded kernel_add_fuse_3 0x137b34220 | th_max = 1024 | th_width = 32
ggml_metal_library_compile_pipeline: compiling pipeline: base = 'kernel_mul_mv_f32_f32_4', name = 'kernel_mul_mv_f32_f32_4_nsg=4'
ggml_metal_library_compile_pipeline: loaded kernel_mul_mv_f32_f32_4_nsg=4 0x143609210 | th_max = 1024 | th_width = 32
ggml_metal_library_compile_pipeline: compiling pipeline: base = 'kernel_mul_mv_id_mxfp4_f32', name = 'kernel_mul_mv_id_mxfp4_f32_nsg=2'
ggml_metal_library_compile_pipeline: loaded kernel_mul_mv_id_mxfp4_f32_nsg=2 0x166213450 | th_max = 1024 | th_width = 32
ggml_metal_library_compile_pipeline: compiling pipeline: base = 'kernel_add_row_c4_fuse_3', name = 'kernel_add_row_c4_fuse_3'
ggml_metal_library_compile_pipeline: loaded kernel_add_row_c4_fuse_3 0x132b0a220 | th_max = 1024 | th_width = 32
ggml_metal_library_compile_pipeline: compiling pipeline: base = 'kernel_mul_mv_q8_0_f32', name = 'kernel_mul_mv_q8_0_f32_nsg=4'
ggml_metal_library_compile_pipeline: loaded kernel_mul_mv_q8_0_f32_nsg=4 0x166215970 | th_max = 1024 | th_width = 32
ggml_metal_library_compile_pipeline: compiling pipeline: base = 'kernel_flash_attn_ext_vec_f16_dk64_dv64', name = 'kernel_flash_attn_ext_vec_f16_dk64_dv64_mask=1_sink=1_bias=0_scap=0_kvpad=0_ns10=512_ns20=512_nsg=1_nwg=32'
ggml_metal_library_compile_pipeline: loaded kernel_flash_attn_ext_vec_f16_dk64_dv64_mask=1_sink=1_bias=0_scap=0_kvpad=0_ns10=512_ns20=512_nsg=1_nwg=32 0x14360a700 | th_max = 1024 | th_width = 32
ggml_metal_library_compile_pipeline: compiling pipeline: base = 'kernel_flash_attn_ext_vec_reduce', name = 'kernel_flash_attn_ext_vec_reduce_dv=64_nwg=32'
ggml_metal_library_compile_pipeline: loaded kernel_flash_attn_ext_vec_reduce_dv=64_nwg=32 0x14360aec0 | th_max = 1024 | th_width = 32
[segment: thought] User says "Hi there!" It's a greeting. We should respond politely, friendly.ggml_metal_library_compile_pipeline: compiling pipeline: base = 'kernel_mul_mv_ext_q8_0_f32_r1_3', name = 'kernel_mul_mv_ext_q8_0_f32_r1_3_nsg=2_nxpsg=8'
ggml_metal_library_compile_pipeline: loaded kernel_mul_mv_ext_q8_0_f32_r1_3_nsg=2_nxpsg=8 0x147ff6e60 | th_max = 1024 | th_width = 32
ggml_metal_library_compile_pipeline: compiling pipeline: base = 'kernel_mul_mv_ext_q8_0_f32_r1_2', name = 'kernel_mul_mv_ext_q8_0_f32_r1_2_nsg=2_nxpsg=16'
ggml_metal_library_compile_pipeline: loaded kernel_mul_mv_ext_q8_0_f32_r1_2_nsg=2_nxpsg=16 0x147ffa5f0 | th_max = 1024 | th_width = 32
[response] Hello! How can I help you today?
llama_perf_context_print: load time = 4021.25 ms
llama_perf_context_print: prompt eval time = 548.44 ms / 139 tokens ( 3.95 ms per token, 253.45 tokens per second)
llama_perf_context_print: eval time = 464.98 ms / 30 runs ( 15.50 ms per token, 64.52 tokens per second)
llama_perf_context_print: total time = 4622.44 ms / 169 tokens
llama_perf_context_print: graphs reused = 27
@ittaboba I think the issue was indeed that the current estimation didn't take into account the full size of the allocated compute buffers.
Can you please run this script and share its results with me?
It'll help me investigate what would be better values for the default vramPadding option.
import {fork} from "node:child_process";
import {fileURLToPath} from "node:url";
import {getLlama, LlamaChatSession, LlamaLogLevel, resolveModelFile} from "node-llama-cpp";
const __filename = fileURLToPath(import.meta.url);
const modelUri = "hf:giladgd/gpt-oss-20b-GGUF/gpt-oss-20b.MXFP4.gguf";
const modelPath = await resolveModelFile(modelUri);
async function main() {
const safePercentage = 0.5;
const safeMaxReservedGB = 5;
let percentageIterations = 0;
let workingMaxReservedGBIterations = 0;
let workingPercentage: number | null = null;
let workingMaxReservedGB: number | null = null;
for (let percentage = safePercentage; percentage >= 0.01; percentage -= 0.01) {
percentageIterations++;
console.log("Trying percentage:", percentage);
if (await runWorker(percentage, safeMaxReservedGB))
workingPercentage = percentage;
else if (workingPercentage != null)
break;
}
if (workingPercentage == null)
throw new Error("Failed to find a working percentage");
console.log("Working percentage found:", workingPercentage);
for (let maxReservedGB = 0.1; maxReservedGB <= 4; maxReservedGB += 0.01) {
workingMaxReservedGBIterations++;
console.log("Trying maxReservedGB:", maxReservedGB);
if (await runWorker(safePercentage, maxReservedGB)) {
workingMaxReservedGB = maxReservedGB;
break;
}
}
if (workingMaxReservedGB == null)
throw new Error("Failed to find a working maxReservedGB");
console.log();
console.log();
console.log("----------");
console.log();
console.log("Percentage iterations:", percentageIterations);
console.log("MaxReservedGB iterations:", workingMaxReservedGBIterations);
console.log("Working percentage:", workingPercentage);
console.log("Working maxReservedGB:", workingMaxReservedGB);
process.exit(0);
}
async function runWorker(percentage: number, maxReservedGB: number) {
const subProcess = fork(__filename, [], {
detached: false,
silent: true,
stdio: ["pipe", "pipe", "pipe", "ipc"],
env: {
...process.env,
"_TEST_PERCENTAGE": String(percentage),
"_TEST_MAX_RESERVED_GB": String(maxReservedGB)
}
});
if (subProcess.exitCode != null)
return subProcess.exitCode === 0;
subProcess.stdout?.on("data", (data) => process.stdout.write(data));
subProcess.stderr?.on("data", (data) => process.stderr.write(data));
return new Promise((resolve) => {
subProcess.on("exit", (code) => {
resolve(code === 0);
});
});
}
async function worker() {
const percentage = Number(process.env["_TEST_PERCENTAGE"]);
const maxReservedGB = Number(process.env["_TEST_MAX_RESERVED_GB"]);
if (!isFinite(percentage) || percentage < 0 || percentage > 1)
throw new Error("Invalid percentage: " + percentage);
else if (!isFinite(maxReservedGB) || maxReservedGB < 0)
throw new Error("Invalid maxReservedGB: " + maxReservedGB);
await using llama = await getLlama({
logLevel: LlamaLogLevel.error,
vramPadding(totalVram) {
return Math.floor(Math.min(totalVram * percentage, maxReservedGB * Math.pow(1024, 3)));
}
});
const model = await llama.loadModel({
modelPath,
defaultContextFlashAttention: true
});
const context = await model.createContext();
const contextSequence = context.getSequence();
const chat = new LlamaChatSession({contextSequence});
const res = await chat.prompt("Hi there!");
if (res.length === 0)
throw new Error("Empty response");
}
try {
if (process.send != null)
await worker();
else
await main();
process.exit(0);
} catch (err) {
console.error(err);
process.exit(1);
}
Run it with these commands:
mkdir repro && cd repro
npm init --init-type module --yes
npm install node-llama-cpp@latest vite-node@latest
npx --no node-llama-cpp inspect gpu
npx --no vite-node ./repro.ts
npx --no node-llama-cpp source download --release b8095
# if it fails, you might need to run `brew install cmake`, I'll fix it in the next release
npx --no node-llama-cpp inspect gpu
npx --no vite-node ./repro.ts
@giladgd please find attached the logs requested. There are some errors tho, not sure it's the expected behavior or some other problem in my setup. Please let me know node_llama_logs.txt
@ittaboba Thanks for helping me investigate this issue.
It appears I had a bug in the script, I fixed it and updated the script and the commands (note the specific llama.cpp release).
Can you please try running it again with the updates?
@giladgd here it is node_llama_cpp_logs.txt
@ittaboba Are you sure you updated the script with the new version I made? It should have continued trying percentages and not stop after the first failed attempt
@giladgd Yes but I had some issues with vite-node command and I didn't understand the expected behavior so I was not sure about what was going on. This should be what you are looking for: logs.txt Thanks for your help
@ittaboba I see from the logs that I forgot to set defaultContextFlashAttention: true in the script.
I've updated it again, could you please rerun it? Sorry for this, and thank you for helping me investigate this :)
Also, I'd love if you could try running the npx --yes node-llama-cpp@latest chat --debug --fa hf:giladgd/gpt-oss-20b-GGUF/gpt-oss-20b.MXFP4.gguf --prompt 'Hi there' command again and see if it works this time with the latest node-lama-cpp (since I've made some changes since last time that might solve this).
@giladgd here are the new logs logs.txt and I confirm the command works.
About the debug logs you asked me from an M5, I managed to get them from a user, still version 3.14.5, I just added the code to catch the logs, however this time all the models loaded correctly. What do you think happened?
Thanks for investigating this :)
@ittaboba Glad to hear that it works now :) Seems like the adjustments I made in the recent few versions helped with this.
I can't know for sure what was the particular change that solved it from all the changes I recently made, but my guess is that it's #559.
A relatively recent llama.cpp change (that I overlooked) in the Metal backend made it work differently depending on the OS version that it's running under to use new features available in Metal 4.
The issue was that without CMAKE_OSX_DEPLOYMENT_TARGET specifying the minimum target OS to support, for the prebuilt binaries, the build assumed that the target OS is the one installed on the CI (which recently I had to upgrade to macOS 26), and it optimized code paths based on this.
It's possible that the reason the user had this issue go away was because they updated the OS on their machine to a version that includes the new Metal features that llama.cpp uses.
Now the prebuilt binaries are guaranteed to support macOS 14 or later even though they are built on a newer OS in the CI.
Previously I wasn't aware that you had to explicitly specify the target OS build process on macOS since it seemed that standard if (@available(macOS 15.0)) clauses in Objective-C would be enough for the compiler to keep both code paths.
BTW on Linux the story is a bit different, to support older OSs you have to build with an older glibc, so what everyone ends up doing (including node-llama-cpp) is to just build on the oldest officially supported OS (Ubuntu 22.04 in this case, which is the oldest Ubuntu version provided in GitHub Actions ATM).
On Windows, llama.cpp doesn't use any features that require an OS newer than Windows 10 (and I constantly test on a Windows 10 machine as well) so we're covered on that end too.
@giladgd thanks for the explanation. Please note I am referring to a build with still node-llama-cpp v3.14.5 running and that the user always had MacOS 26.3
Please note I am referring to a build with still node-llama-cpp v3.14.5 running and that the user always had MacOS 26.3
@ittaboba Maybe the user was running some other process that was using mlock and thus forcing the actual available memory to be smaller than the reported one (and the OS couldn't offload unused memory to disk because of the mlock), but that's just a speculation since I can't really know without looking at the logs.
Closing for now. If you experience this issue again, feel free to reopen or create a new issue instead.