mirror of
				https://github.com/ggml-org/llama.cpp.git
				synced 2025-10-29 08:41:22 +00:00 
			
		
		
		
	
							
								
								
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							| @@ -35,6 +35,7 @@ models/* | |||||||
| /benchmark-matmult | /benchmark-matmult | ||||||
| /vdot | /vdot | ||||||
| /Pipfile | /Pipfile | ||||||
|  | /libllama.so | ||||||
|  |  | ||||||
| build-info.h | build-info.h | ||||||
| arm_neon.h | arm_neon.h | ||||||
|   | |||||||
							
								
								
									
										16
									
								
								Makefile
									
									
									
									
									
								
							
							
						
						
									
										16
									
								
								Makefile
									
									
									
									
									
								
							| @@ -243,7 +243,7 @@ llama.o: llama.cpp ggml.h ggml-cuda.h llama.h llama-util.h | |||||||
| common.o: examples/common.cpp examples/common.h | common.o: examples/common.cpp examples/common.h | ||||||
| 	$(CXX) $(CXXFLAGS) -c $< -o $@ | 	$(CXX) $(CXXFLAGS) -c $< -o $@ | ||||||
|  |  | ||||||
| libllama.so: llama.o ggml.o $(OBJS) | libllama.so: llama.o ggml.o ggml-quants-k.o $(OBJS) | ||||||
| 	$(CXX) $(CXXFLAGS) -shared -fPIC -o $@ $^ $(LDFLAGS) | 	$(CXX) $(CXXFLAGS) -shared -fPIC -o $@ $^ $(LDFLAGS) | ||||||
|  |  | ||||||
| clean: | clean: | ||||||
| @@ -259,22 +259,22 @@ main: examples/main/main.cpp build-info.h ggml.o ggml-quants-k.o llama.o common. | |||||||
| 	@echo '====  Run ./main -h for help.  ====' | 	@echo '====  Run ./main -h for help.  ====' | ||||||
| 	@echo | 	@echo | ||||||
|  |  | ||||||
| quantize: examples/quantize/quantize.cpp build-info.h ggml.o llama.o ggml-quants-k.o $(OBJS) | quantize: examples/quantize/quantize.cpp                      build-info.h ggml.o ggml-quants-k.o llama.o $(OBJS) | ||||||
| 	$(CXX) $(CXXFLAGS) $(filter-out %.h,$^) -o $@ $(LDFLAGS) | 	$(CXX) $(CXXFLAGS) $(filter-out %.h,$^) -o $@ $(LDFLAGS) | ||||||
|  |  | ||||||
| quantize-stats: examples/quantize-stats/quantize-stats.cpp build-info.h ggml.o llama.o ggml-quants-k.o $(OBJS) | quantize-stats: examples/quantize-stats/quantize-stats.cpp    build-info.h ggml.o ggml-quants-k.o llama.o $(OBJS) | ||||||
| 	$(CXX) $(CXXFLAGS) $(filter-out %.h,$^) -o $@ $(LDFLAGS) | 	$(CXX) $(CXXFLAGS) $(filter-out %.h,$^) -o $@ $(LDFLAGS) | ||||||
|  |  | ||||||
| perplexity: examples/perplexity/perplexity.cpp build-info.h ggml.o llama.o common.o ggml-quants-k.o $(OBJS) | perplexity: examples/perplexity/perplexity.cpp                build-info.h ggml.o ggml-quants-k.o llama.o common.o $(OBJS) | ||||||
| 	$(CXX) $(CXXFLAGS) $(filter-out %.h,$^) -o $@ $(LDFLAGS) | 	$(CXX) $(CXXFLAGS) $(filter-out %.h,$^) -o $@ $(LDFLAGS) | ||||||
|  |  | ||||||
| embedding: examples/embedding/embedding.cpp build-info.h ggml.o llama.o common.o ggml-quants-k.o $(OBJS) | embedding: examples/embedding/embedding.cpp                   build-info.h ggml.o ggml-quants-k.o llama.o common.o $(OBJS) | ||||||
| 	$(CXX) $(CXXFLAGS) $(filter-out %.h,$^) -o $@ $(LDFLAGS) | 	$(CXX) $(CXXFLAGS) $(filter-out %.h,$^) -o $@ $(LDFLAGS) | ||||||
|  |  | ||||||
| save-load-state: examples/save-load-state/save-load-state.cpp build-info.h ggml.o llama.o common.o ggml-quants-k.o $(OBJS) | save-load-state: examples/save-load-state/save-load-state.cpp build-info.h ggml.o ggml-quants-k.o llama.o common.o $(OBJS) | ||||||
| 	$(CXX) $(CXXFLAGS) $(filter-out %.h,$^) -o $@ $(LDFLAGS) | 	$(CXX) $(CXXFLAGS) $(filter-out %.h,$^) -o $@ $(LDFLAGS) | ||||||
|  |  | ||||||
| server: examples/server/server.cpp examples/server/httplib.h examples/server/json.hpp build-info.h ggml.o llama.o common.o $(OBJS) | server: examples/server/server.cpp examples/server/httplib.h examples/server/json.hpp build-info.h ggml.o ggml-quants-k.o llama.o common.o $(OBJS) | ||||||
| 	$(CXX) $(CXXFLAGS) -Iexamples/server $(filter-out %.h,$(filter-out %.hpp,$^)) -o $@ $(LDFLAGS) | 	$(CXX) $(CXXFLAGS) -Iexamples/server $(filter-out %.h,$(filter-out %.hpp,$^)) -o $@ $(LDFLAGS) | ||||||
|  |  | ||||||
| build-info.h: $(wildcard .git/index) scripts/build-info.sh | build-info.h: $(wildcard .git/index) scripts/build-info.sh | ||||||
| @@ -289,7 +289,7 @@ build-info.h: $(wildcard .git/index) scripts/build-info.sh | |||||||
| # Tests | # Tests | ||||||
| # | # | ||||||
|  |  | ||||||
| benchmark-matmult: examples/benchmark/benchmark-matmult.cpp build-info.h ggml.o $(OBJS) | benchmark-matmult: examples/benchmark/benchmark-matmult.cpp build-info.h ggml.o ggml-quants-k.o $(OBJS) | ||||||
| 	$(CXX) $(CXXFLAGS) $(filter-out %.h,$^) -o $@ $(LDFLAGS) | 	$(CXX) $(CXXFLAGS) $(filter-out %.h,$^) -o $@ $(LDFLAGS) | ||||||
| 	./$@ | 	./$@ | ||||||
|  |  | ||||||
|   | |||||||
							
								
								
									
										12
									
								
								ggml.c
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								ggml.c
									
									
									
									
									
								
							| @@ -14753,7 +14753,7 @@ static void ggml_graph_export_leaf(const struct ggml_tensor * tensor, FILE * fou | |||||||
|     const int64_t * ne = tensor->ne; |     const int64_t * ne = tensor->ne; | ||||||
|     const size_t  * nb = tensor->nb; |     const size_t  * nb = tensor->nb; | ||||||
|  |  | ||||||
|     fprintf(fout, "%-6s %-12s %8d %8lld %8lld %8lld %8lld %16zu %16zu %16zu %16zu %16p %32s\n", |     fprintf(fout, "%-6s %-12s %8d %8jd %jd %jd %jd %16zu %16zu %16zu %16zu %16p %32s\n", | ||||||
|             ggml_type_name(tensor->type), |             ggml_type_name(tensor->type), | ||||||
|             ggml_op_name  (tensor->op), |             ggml_op_name  (tensor->op), | ||||||
|             tensor->n_dims, |             tensor->n_dims, | ||||||
| @@ -14767,7 +14767,7 @@ static void ggml_graph_export_node(const struct ggml_tensor * tensor, const char | |||||||
|     const int64_t * ne = tensor->ne; |     const int64_t * ne = tensor->ne; | ||||||
|     const size_t  * nb = tensor->nb; |     const size_t  * nb = tensor->nb; | ||||||
|  |  | ||||||
|     fprintf(fout, "%-6s %-6s %-12s %8d %8lld %8lld %8lld %8lld %16zu %16zu %16zu %16zu %8d %16p %32s\n", |     fprintf(fout, "%-6s %-6s %-12s %8d %jd %jd %jd %jd %16zu %16zu %16zu %16zu %8d %16p %32s\n", | ||||||
|             arg, |             arg, | ||||||
|             ggml_type_name(tensor->type), |             ggml_type_name(tensor->type), | ||||||
|             ggml_op_name  (tensor->op), |             ggml_op_name  (tensor->op), | ||||||
| @@ -14800,7 +14800,7 @@ void ggml_graph_export(const struct ggml_cgraph * cgraph, const char * fname) { | |||||||
|         fprintf(fout, "%-16s %8d\n",  "version", GGML_FILE_VERSION); |         fprintf(fout, "%-16s %8d\n",  "version", GGML_FILE_VERSION); | ||||||
|         fprintf(fout, "%-16s %8d\n",  "leafs",   cgraph->n_leafs); |         fprintf(fout, "%-16s %8d\n",  "leafs",   cgraph->n_leafs); | ||||||
|         fprintf(fout, "%-16s %8d\n",  "nodes",   cgraph->n_nodes); |         fprintf(fout, "%-16s %8d\n",  "nodes",   cgraph->n_nodes); | ||||||
|         fprintf(fout, "%-16s %8llu\n", "eval",    size_eval); |         fprintf(fout, "%-16s %8ju\n", "eval",    size_eval); | ||||||
|  |  | ||||||
|         // header |         // header | ||||||
|         fprintf(fout, "\n"); |         fprintf(fout, "\n"); | ||||||
| @@ -15033,7 +15033,11 @@ struct ggml_cgraph ggml_graph_import(const char * fname, struct ggml_context ** | |||||||
|  |  | ||||||
|         data = ggml_new_tensor_1d(*ctx_data, GGML_TYPE_I8, fsize); |         data = ggml_new_tensor_1d(*ctx_data, GGML_TYPE_I8, fsize); | ||||||
|  |  | ||||||
|         fread(data->data, sizeof(char), fsize, fin); |         const size_t ret = fread(data->data, sizeof(char), fsize, fin); | ||||||
|  |         if (ret != fsize) { | ||||||
|  |             fprintf(stderr, "%s: failed to read %s\n", __func__, fname); | ||||||
|  |             return result; | ||||||
|  |         } | ||||||
|  |  | ||||||
|         fclose(fin); |         fclose(fin); | ||||||
|     } |     } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Georgi Gerganov
					Georgi Gerganov