MCPcopy Create free account
hub / github.com/appdevforall/CodeOnTheGo / main

Function main

subprojects/llama.cpp/tests/test-quantize-stats.cpp:225–424  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

223}
224
225int main(int argc, char ** argv) {
226 ggml_time_init();
227
228 quantize_stats_params params;
229
230 // read command line
231
232 int max_thread = 0;
233 bool invalid_param = false;
234 std::string arg;
235 for (int i = 1; i < argc; i++) {
236 arg = argv[i];
237
238 if (arg == "-h" || arg == "--help") {
239 quantize_stats_print_usage(argc, argv);
240 exit(0);
241 } else if (arg == "-r" || arg == "--reference") {
242 params.reference = true;
243 } else if (arg == "-v") {
244 params.verbose = true;
245 } else if (arg == "-p" || arg == "--per-layer-stats") {
246 params.per_layer_stats = true;
247 } else if (arg == "--histogram") {
248 params.print_histogram = true;
249 } else if (arg == "-m" || arg == "--model") {
250 if (++i >= argc) {
251 invalid_param = true;
252 break;
253 }
254 params.model = argv[i];
255 } else if (arg == "-l" || arg == "--include-layer") {
256 if (++i >= argc) {
257 invalid_param = true;
258 break;
259 }
260 params.include_layers.emplace_back(argv[i]);
261 } else if (arg == "-L" || arg == "--exclude-layer") {
262 if (++i >= argc) {
263 invalid_param = true;
264 break;
265 }
266 params.exclude_layers.emplace_back(argv[i]);
267 } else if (arg == "-t" || arg == "--type") {
268 if (++i >= argc) {
269 invalid_param = true;
270 break;
271 }
272 int j;
273 for (j = 0; j < GGML_TYPE_COUNT; ++j) {
274 const auto * name = ggml_type_name((ggml_type) j);
275 if (name && strcmp(argv[i], name) == 0) break;
276 }
277 if (j < GGML_TYPE_COUNT) {
278 params.include_types.push_back((ggml_type) j);
279 } else {
280 fprintf(stderr, "error: %s not in list of types\n", argv[i]);
281 invalid_param = true;
282 }

Callers

nothing calls this directly

Calls 15

ggml_time_initFunction · 0.85
ggml_type_nameFunction · 0.85
ggml_time_usFunction · 0.85
llama_init_from_modelFunction · 0.85
llama_model_freeFunction · 0.85
layer_includedFunction · 0.85
ggml_nelementsFunction · 0.85
llama_freeFunction · 0.85

Tested by

no test coverage detected