avg_speed = []
for var in var_lst:
args = {k: v for k, v in common.items()}
args[var_name] = var
args_cmd = ["-%s=%s" % (k, v) for k, v in args.items()]
// override exp args
server = BertServer(arg_p.parse_args(args_cmd))
server.start()
After Change
"max_batch_size": 256,
"num_client": 1,
"pooling_strategy": PoolingStrategy.REDUCE_MEAN,
"pooling_layer": [-2],
"gpu_memory_fraction": 0.5,
"xla": False,
}
experiments = {
"client_batch_size": [1, 4, 8, 16, 64, 256, 512, 1024, 2048, 4096],
"max_batch_size": [32, 64, 128, 256, 512],
"max_seq_len": [20, 40, 80, 160, 320],
"num_client": [2, 4, 8, 16, 32],
"pooling_layer": [[-j] for j in range(1, 13)]
}
fp = open("benchmark-%d.result" % common["num_worker"], "w")
for var_name, var_lst in experiments.items():
// set common args
args = namedtuple("args_namedtuple", ",".join(common.keys()))
for k, v in common.items():
setattr(args, k, v)
avg_speed = []