Skip to content

Commit 159b738

Browse files
author
Hao Ren
committed
update C benchmarks to have initial exact configs
1 parent bfae0b7 commit 159b738

5 files changed

Lines changed: 13 additions & 13 deletions

File tree

runtime/examples/benchmark/src/approx_bm25.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ int compare_tokens(const char *t1, const char *t2) {
5353
// thresholds: [4]
5454
// thresholds_lower: [1]
5555
// thresholds_upper: [1000]
56-
// decisions: [0, 1]
56+
// decisions: [0, 0]
5757
// decision_values: [0, 1]
5858
// }
5959
int count_and_lower_words(char *str, int len, int state) {
@@ -212,7 +212,7 @@ int calculate_df(const char *term, char **corpus, int num_docs) {
212212
// thresholds: [2000]
213213
// thresholds_lower: [1]
214214
// thresholds_upper: [40]
215-
// decisions: [0, 1]
215+
// decisions: [0, 0]
216216
// decision_values: [0, 1, 2]
217217
// }
218218
void score_term_over_docs(
@@ -291,7 +291,7 @@ void approx_score_term_over_docs_2(
291291
// thresholds: [6]
292292
// thresholds_lower: [1]
293293
// thresholds_upper: [5]
294-
// decisions: [0, 1]
294+
// decisions: [0, 0]
295295
// decision_values: [0, 1, 2, 3]
296296
// }
297297
int lowering_corpus(char** corpus, char** lower_corpus, int* _num_docs, double *doc_lengths, DocumentScore *scores, int state) {
@@ -493,7 +493,7 @@ int main(int argc, char **argv)
493493
if (ranked_scores)
494494
{
495495
printf("Ranking results:\n");
496-
for (int i = 0; i < printed_doc; ++i)
496+
for (int i = 0; i < 1000; ++i)
497497
{
498498
int doc_index = ranked_scores[i].doc_index;
499499
printf("Rank %d: Doc %d (Score: %.4f) - \"%s\"\n",

runtime/examples/benchmark/src/approx_kb.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ int approx_state_identity(int state) { return state; }
2929
// thresholds: [1]
3030
// thresholds_lower: [1]
3131
// thresholds_upper: [10]
32-
// decisions: [0, 1]
32+
// decisions: [0, 0]
3333
// decision_values: [0, 1, 2]
3434
// }
3535
int parse_embedding(const char *embedding_str, float *embedding, int state) {
@@ -195,7 +195,7 @@ void approx_compute_similarities_with_state_2(int cos_state) {
195195
// thresholds: [2]
196196
// thresholds_lower: [1]
197197
// thresholds_upper: [5]
198-
// decisions: [0, 1]
198+
// decisions: [0, 0]
199199
// decision_values: [0, 1, 2]
200200
// }
201201
void compute_similarities_with_state(int cos_state) {

runtime/examples/benchmark/src/approx_kmeans.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ double compute_distance_sq(const double *point1, const double *point2, int dim,
4444
// thresholds: [8]
4545
// thresholds_lower: [1]
4646
// thresholds_upper: [20]
47-
// decisions: [1, 2]
47+
// decisions: [0, 0]
4848
// decision_values: [0, 1, 2, 3, 4]
4949
// }
5050
int choose_cluster(const double *point, double **centroids, int k, int dim,
@@ -76,7 +76,7 @@ void reset_accumulators(double **new_centroids, int *cluster_sizes, int k, int d
7676
// thresholds: [10000]
7777
// thresholds_lower: [1]
7878
// thresholds_upper: [20]
79-
// decisions: [1, 2]
79+
// decisions: [0, 0]
8080
// decision_values: [0, 1, 2, 3, 4]
8181
// }
8282
void assign_points_and_accumulate(double **points, double **centroids, int *assignments,
@@ -114,7 +114,7 @@ void recompute_centroids(double **centroids, double **new_centroids,
114114
// thresholds: [10000]
115115
// thresholds_lower: [1]
116116
// thresholds_upper: [1000000]
117-
// decisions: [1, 2]
117+
// decisions: [0, 0]
118118
// decision_values: [0, 1, 2, 3, 4]
119119
// }
120120
void run_kmeans_iterations(int max_iters, int k, int dim, int num_points,

runtime/examples/benchmark/src/approx_lavaMD.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ int pair_interaction(int pi, int pj, fp a2,
121121
// thresholds: [60]
122122
// thresholds_lower: [1]
123123
// thresholds_upper: [100]
124-
// decisions: [1, 2]
124+
// decisions: [0, 0]
125125
// decision_values: [1, 2, 3, 4]
126126
// }
127127
static void self_box_accumulate(int pi_idx, int first_i, fp a2,
@@ -149,7 +149,7 @@ static void self_box_accumulate(int pi_idx, int first_i, fp a2,
149149
// thresholds: [6]
150150
// thresholds_lower: [1]
151151
// thresholds_upper: [10]
152-
// decisions: [1, 2]
152+
// decisions: [0, 0]
153153
// decision_values: [0, 1, 2, 3]
154154
// }
155155
void neighbor_box_accumulate(int pi_idx, int bx, fp a2,

runtime/examples/benchmark/src/approx_pagerank.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ double approx_update_node_rank_2(const GraphCSR *G,
264264
// thresholds: [24]
265265
// thresholds_lower: [1]
266266
// thresholds_upper: [50]
267-
// decisions: [0, 1]
267+
// decisions: [0, 0]
268268
// decision_values: [0, 1, 2]
269269
// }
270270
double update_node_rank(const GraphCSR *G,
@@ -372,7 +372,7 @@ void *approx_pagerank_worker_impl_2(void *argp, int state) {
372372
// thresholds: [3]
373373
// thresholds_lower: [1]
374374
// thresholds_upper: [5]
375-
// decisions: [0, 1]
375+
// decisions: [0, 0]
376376
// decision_values: [0, 1, 2]
377377
// }
378378
void *pagerank_worker_impl(void *argp, int state) {

0 commit comments

Comments
 (0)