Skip to content

Commit 704a0a8

Browse files
committed
refactor: rename *_is_hybrid -> *_is_hybrid_recurrent
The implementation of the hybrid cache intentionally does not specify the types of the child caches, so there was a naming mismatch with these predicate functions that used "hybrid" to imply "hybrid recurrent." Branch: HybridCache Signed-off-by: Gabe Goodhart <ghart@us.ibm.com>
1 parent 403ba7a commit 704a0a8

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

include/llama.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,7 @@ extern "C" {
554554
LLAMA_API bool llama_model_is_recurrent(const struct llama_model * model);
555555

556556
// Returns true if the model is hybrid-recurrent (like Jamba, Bamba, etc.)
557-
LLAMA_API bool llama_model_is_hybrid(const struct llama_model * model);
557+
LLAMA_API bool llama_model_is_hybrid_recurrent(const struct llama_model * model);
558558

559559
// Returns 0 on success
560560
LLAMA_API uint32_t llama_model_quantize(

src/llama-arch.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1759,7 +1759,7 @@ bool llm_arch_is_recurrent(const llm_arch & arch) {
17591759
}
17601760
}
17611761

1762-
bool llm_arch_is_hybrid(const llm_arch & arch) {
1762+
bool llm_arch_is_hybrid_recurrent(const llm_arch & arch) {
17631763
// TODO: There are currently no hybrid models! Once there are, this will be
17641764
// the place to identify them
17651765
switch (arch) {

src/llama-arch.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -438,4 +438,4 @@ llm_arch llm_arch_from_string(const std::string & name);
438438
const llm_tensor_info & llm_tensor_info_for(llm_tensor tensor);
439439

440440
bool llm_arch_is_recurrent(const llm_arch& arch);
441-
bool llm_arch_is_hybrid(const llm_arch& arch);
441+
bool llm_arch_is_hybrid_recurrent(const llm_arch& arch);

src/llama-model.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13208,7 +13208,7 @@ llama_memory_i * llama_model::create_memory(const llama_memory_params & params,
1320813208
// checks
1320913209
default:
1321013210
{
13211-
if (llm_arch_is_hybrid(arch)) {
13211+
if (llm_arch_is_hybrid_recurrent(arch)) {
1321213212
// make vectors of recurrent and non-recurrent layer indices
1321313213
std::vector<size_t> recurrent_layers;
1321413214
std::vector<size_t> unified_layers;
@@ -13848,8 +13848,8 @@ bool llama_model_is_recurrent(const llama_model * model) {
1384813848
return llm_arch_is_recurrent(model->arch);
1384913849
}
1385013850

13851-
bool llama_model_is_hybrid(const llama_model * model) {
13852-
return llm_arch_is_hybrid(model->arch);
13851+
bool llama_model_is_hybrid_recurrent(const llama_model * model) {
13852+
return llm_arch_is_hybrid_recurrent(model->arch);
1385313853
}
1385413854

1385513855
const std::vector<std::pair<std::string, ggml_tensor *>> & llama_internal_get_tensor_map(const llama_model * model) {

0 commit comments

Comments
 (0)