def benchmark_lreg(ctx, timer): print "#worker:", ctx.num_workers FLAGS.opt_parakeet_gen = 0 N_EXAMPLES = 4000000 * ctx.num_workers #N_EXAMPLES = 5000000 * 64 x = expr.rand(N_EXAMPLES, N_DIM) y = expr.rand(N_EXAMPLES, 1) start = time.time() linear_regression.linear_regression(x, y, ITERATION) total = time.time() - start util.log_warn("time cost : %s s" % (total*1.0/ITERATION,))
def benchmark_lreg(ctx, timer): print "#worker:", ctx.num_workers #N_EXAMPLES = 40000000 * ctx.num_workers N_EXAMPLES = 5000000 * 64 x = expr.eager(expr.rand(N_EXAMPLES, N_DIM, tile_hint=(N_EXAMPLES / ctx.num_workers, N_DIM))) y = expr.eager(expr.rand(N_EXAMPLES, 1, tile_hint=(N_EXAMPLES / ctx.num_workers, 1))) start = time.time() linear_regression.linear_regression(x, y, ITERATION) total = time.time() - start util.log_warn("time cost : %s s" % (total*1.0/ITERATION,))