| 108 | } |
| 109 | |
| 110 | static void usage(char * argv[]) { |
| 111 | printf("Benchmark quantization specific functions on synthetic data\n"); |
| 112 | printf("\n"); |
| 113 | printf("usage: %s [options]\n", argv[0]); |
| 114 | printf("\n"); |
| 115 | printf("options: (default)\n"); |
| 116 | printf(" -h, --help show this help message and exit\n"); |
| 117 | printf(" --size SIZE set test size, divisible by 32 (L1_SIZE:%d)\n", L1_SIZE); |
| 118 | printf(" -3 use size as L1, L2, L3 sizes (L1:%d L2:%d L3:%d)\n", L1_SIZE, L2_SIZE, L3_SIZE); |
| 119 | printf(" -4 use size as L1, L2, L3, MEM sizes (L1:%d L2:%d L3:%d MEM:%d)\n", L1_SIZE, L2_SIZE, L3_SIZE, MEM_SIZE); |
| 120 | printf(" --op OP set test operation as quantize_row_q_reference, quantize_row_q, dequantize_row_q,\n"); |
| 121 | printf(" quantize_row_q_dot, vec_dot_q (all)\n"); |
| 122 | printf(" --type TYPE set test type as"); |
| 123 | for (int i = 0; i < GGML_TYPE_COUNT; i++) { |
| 124 | ggml_type type = (ggml_type) i; |
| 125 | const auto * qfns = ggml_get_type_traits(type); |
| 126 | const auto * qfns_cpu = ggml_get_type_traits_cpu(type); |
| 127 | if (ggml_type_name(type) != NULL) { |
| 128 | if (qfns_cpu->from_float && qfns->to_float) { |
| 129 | printf(" %s", ggml_type_name(type)); |
| 130 | } |
| 131 | } |
| 132 | } |
| 133 | printf(" (all)\n"); |
| 134 | printf(" --alignment-offset OFFSET\n"); |
| 135 | printf(" set alignment offset as OFFSET (0)\n"); |
| 136 | printf(" -i NUM, --iterations NUM\n"); |
| 137 | printf(" set test iteration number (%d)\n", ITERATIONS); |
| 138 | } |
| 139 | |
| 140 | int main(int argc, char * argv[]) { |
| 141 | quantize_perf_params params {}; |
no test coverage detected