Skip to content

Conversation

@ngxson
Copy link
Collaborator

@ngxson ngxson commented Dec 16, 2025

Supersede #17694

  • Rebased to latest master
  • Removed some redundant ggml_cont

@ngxson
Copy link
Collaborator Author

ngxson commented Dec 16, 2025

@tdakhran would appreciate if you can do a test on your side! On my side, I confirm that removing some ggml_cont doesn't have negative effects on Metal + CPU

@tdakhran
Copy link
Contributor

@tdakhran would appreciate if you can do a test on your side! On my side, I confirm that removing some ggml_cont doesn't have negative effects on Metal + CPU

@ngxson tested with linux x64 CPU and CUDA, both work 🎉 !

Copy link
Contributor

@tdakhran tdakhran left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looked into it one more time, only few nitpicks.
@ngxson fyi I'm not sure this conformer matches upstream conformer, it could be modified.

params.hop_length = hparams.audio_hop_len;
params.sample_rate = hparams.audio_sample_rate;
params.center_padding = true;
params.preemph = 0.97f; // disabled
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
params.preemph = 0.97f; // disabled
params.preemph = 0.97f;

LOG_WRN("WARN: This is an experimental CLI for testing multimodal capability.\n");
LOG_WRN(" For normal use cases, please use the standard llama-cli\n");

eval_system_prompt_if_present();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
eval_system_prompt_if_present();
if (int res = eval_system_prompt_if_present(); res) {
return res;
}

ctx.chat_history.clear();
llama_memory_clear(llama_get_memory(ctx.lctx), true);
LOG("Chat history cleared\n\n");
eval_system_prompt_if_present();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
eval_system_prompt_if_present();
if (int res = eval_system_prompt_if_present(); res) {
return res;
}

params.prompt = mtmd_default_marker() + params.prompt;
}
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

Comment on lines +1663 to +1670
layer.conv_norm_w = get_tensor(string_format("convnext.%d.norm.%s", il, "weight"));
layer.conv_norm_b = get_tensor(string_format("convnext.%d.norm.%s", il, "bias"));
layer.conv_dw_w = get_tensor(string_format("convnext.%d.dw.%s", il, "weight"));
layer.conv_dw_b = get_tensor(string_format("convnext.%d.dw.%s", il, "bias"));
layer.conv_pw1_w = get_tensor(string_format("convnext.%d.pw1.%s", il, "weight"));
layer.conv_pw1_b = get_tensor(string_format("convnext.%d.pw1.%s", il, "bias"));
layer.conv_pw2_w = get_tensor(string_format("convnext.%d.pw2.%s", il, "weight"));
layer.conv_pw2_b = get_tensor(string_format("convnext.%d.pw2.%s", il, "bias"));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if these strings require their own defines.

Comment on lines +315 to +318
std::array<ggml_tensor *, 7> pre_encode_conv_X_w = {nullptr};
std::array<ggml_tensor *, 7> pre_encode_conv_X_b = {nullptr};
ggml_tensor * pre_encode_out_w = nullptr;
ggml_tensor * pre_encode_out_b = nullptr;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
std::array<ggml_tensor *, 7> pre_encode_conv_X_w = {nullptr};
std::array<ggml_tensor *, 7> pre_encode_conv_X_b = {nullptr};
ggml_tensor * pre_encode_out_w = nullptr;
ggml_tensor * pre_encode_out_b = nullptr;
std::array<ggml_tensor *, 7> pre_encode_conv_X_w = {nullptr};
std::array<ggml_tensor *, 7> pre_encode_conv_X_b = {nullptr};
ggml_tensor * pre_encode_out_w = nullptr;
ggml_tensor * pre_encode_out_b = nullptr;

@github-actions github-actions bot added testing Everything test related Nvidia GPU Issues specific to Nvidia GPUs examples python python script changes ggml changes relating to the ggml tensor library for machine learning labels Dec 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

examples ggml changes relating to the ggml tensor library for machine learning Nvidia GPU Issues specific to Nvidia GPUs python python script changes testing Everything test related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants