Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ggml
Submodule ggml updated from 21d3a3 to 75c806
25 changes: 13 additions & 12 deletions ggml_extend.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,20 +100,21 @@ __STATIC_INLINE__ ggml_fp16_t ggml_tensor_get_f16(const ggml_tensor* tensor, int

static struct ggml_tensor* get_tensor_from_graph(struct ggml_cgraph* gf, const char* name) {
struct ggml_tensor* res = NULL;
for (int i = 0; i < gf->n_nodes; i++) {
// printf("%d, %s \n", i, gf->nodes[i]->name);
if (strcmp(ggml_get_name(gf->nodes[i]), name) == 0) {
res = gf->nodes[i];
break;
}
}
for (int i = 0; i < gf->n_leafs; i++) {
// printf("%d, %s \n", i, gf->leafs[i]->name);
if (strcmp(ggml_get_name(gf->leafs[i]), name) == 0) {
res = gf->leafs[i];
for (int i = 0; i < ggml_graph_n_nodes(gf); i++) {
struct ggml_tensor* node = ggml_graph_node(gf, i);
// printf("%d, %s \n", i, ggml_get_name(node));
if (strcmp(ggml_get_name(node), name) == 0) {
res = node;
break;
}
}
//for (int i = 0; i < gf->n_leafs; i++) {
// // printf("%d, %s \n", i, gf->leafs[i]->name);
// if (strcmp(ggml_get_name(gf->leafs[i]), name) == 0) {
// res = gf->leafs[i];
// break;
// }
//}
return res;
}

Expand Down Expand Up @@ -1118,7 +1119,7 @@ struct GGMLRunner {
ggml_graph_print(gf);
#endif
if (output != NULL) {
auto result = gf->nodes[gf->n_nodes - 1];
auto result = ggml_graph_node(gf, -1);
if (*output == NULL && output_ctx != NULL) {
*output = ggml_dup_tensor(output_ctx, result);
}
Expand Down
2 changes: 2 additions & 0 deletions stable-diffusion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ const char* sampling_methods_str[] = {
"LCM",
};

//static_assert((int)SD_TYPE_COUNT == (int)GGML_TYPE_COUNT);

/*================================================== Helper Functions ================================================*/

void calculate_alphas_cumprod(float* alphas_cumprod,
Expand Down
2 changes: 2 additions & 0 deletions stable-diffusion.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ enum sd_type_t {
SD_TYPE_Q4_0_4_4 = 31,
SD_TYPE_Q4_0_4_8 = 32,
SD_TYPE_Q4_0_8_8 = 33,
SD_TYPE_TQ1_0 = 34,
SD_TYPE_TQ2_0 = 35,
SD_TYPE_COUNT,
};

Expand Down
Loading