Skip to content

Commit c5e0de5

Browse files
committed
Set the reference Nps using Stockfish 11 as base
Fishtest with Stockfish 11 had 1.6MNps as reference Nps and 0.7MNps as threshold for the slow worker. Set the new reference Nps according to the average 20% slowdown. Set the new threshold for slow worker according to the 27% slowdown. - arch=bmi2 (Dual Xeon workstation) ``` base = 1729936 +/- 9448 test = 1381212 +/- 8223 diff = -348723 +/- 6159 speedup = -0.201582 ``` - arch=bmi2 (Xeon server) ``` base = 1377734 +/- 14202 test = 1151238 +/- 9600 diff = -226496 +/- 20606 speedup = -0.164398 ``` - arch=modern (core i7 3770k) ``` base = 1967470 +/- 12952 test = 1435152 +/- 5597 diff = -532318 +/- 8311 speedup = -0.270560 ``` Other fixes Load the CPU before bench (fix an 8% Nps overestimation with high concurrency). Account the slowdown due to the concurrency to set the slow worker threashold. Drop unused function parameter.
1 parent 92a4b63 commit c5e0de5

File tree

3 files changed

+13
-14
lines changed

3 files changed

+13
-14
lines changed

server/fishtest/views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1212,7 +1212,7 @@ def homepage_results(request):
12121212
machine["last_updated"] = delta_date(diff)
12131213
if machine["nps"] != 0:
12141214
games_per_minute += (
1215-
(machine["nps"] / 1080000.0)
1215+
(machine["nps"] / 1280000.0)
12161216
* (60.0 / estimate_game_duration(machine["run"]["args"]["tc"]))
12171217
* (
12181218
int(machine["concurrency"])

server/utils/delta_update_users.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def process_run(run, info, deltas=None):
6969
def build_users(machines, info):
7070
for machine in machines:
7171
games_per_hour = (
72-
(machine["nps"] / 1080000.0)
72+
(machine["nps"] / 1280000.0)
7373
* (3600.0 / estimate_game_duration(machine["run"]["args"]["tc"]))
7474
* (int(machine["concurrency"]) // machine["run"]["args"].get("threads", 1))
7575
)

worker/games.py

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import glob
44
import hashlib
55
import json
6+
import math
67
import os
78
import platform
89
import re
@@ -244,6 +245,7 @@ def verify_signature(engine, signature, remote, payload, concurrency, worker_inf
244245
)
245246
busy_process.stdin.write("go infinite\n")
246247
busy_process.stdin.flush()
248+
time.sleep(1) # wait CPU loading
247249

248250
bench_sig = ""
249251
print("Verifying signature of {} ...".format(os.path.basename(engine)))
@@ -500,7 +502,7 @@ def setup_engine(
500502

501503
def kill_process(p):
502504
p_name = os.path.basename(p.args[0])
503-
print("\Killing {} with pid {} ... ".format(p_name, p.pid), end="", flush=True)
505+
print("Killing {} with pid {} ... ".format(p_name, p.pid), end="", flush=True)
504506
try:
505507
if IS_WINDOWS:
506508
# p.kill() doesn't kill subprocesses on Windows.
@@ -524,7 +526,7 @@ def kill_process(p):
524526
print("killed", flush=True)
525527

526528

527-
def adjust_tc(tc, factor, concurrency):
529+
def adjust_tc(tc, factor):
528530
# Parse the time control in cutechess format.
529531
chunks = tc.split("+")
530532
increment = 0.0
@@ -915,7 +917,8 @@ def run_games(worker_info, password, remote, run, task_id, pgn_file):
915917
threads = int(run["args"]["threads"])
916918
spsa_tuning = "spsa" in run["args"]
917919
repo_url = run["args"].get("tests_repo", REPO_URL)
918-
games_concurrency = int(worker_info["concurrency"]) // threads
920+
worker_concurrency = int(worker_info["concurrency"])
921+
games_concurrency = worker_concurrency // threads
919922

920923
opening_offset = task.get("start", task_id * task["num_games"])
921924
if "start" in task:
@@ -1087,24 +1090,20 @@ def parse_options(s):
10871090
worker_info,
10881091
)
10891092

1090-
if base_nps < 350000: # lowered from 450000 - dirty fix for some slow workers
1093+
if base_nps < 500000 / (1 + math.tanh((worker_concurrency - 1) / 8)):
10911094
raise FatalException(
10921095
"This machine is too slow to run fishtest effectively - sorry!"
10931096
)
10941097

10951098
factor = (
1096-
1080000 / base_nps
1097-
) # 1080000 nps is the reference core, also used in fishtest views.
1099+
1280000 / base_nps
1100+
) # 1280000 nps is the reference core, also used in fishtest views.
10981101

10991102
# Adjust CPU scaling.
1100-
scaled_tc, tc_limit = adjust_tc(
1101-
run["args"]["tc"], factor, int(worker_info["concurrency"])
1102-
)
1103+
scaled_tc, tc_limit = adjust_tc(run["args"]["tc"], factor)
11031104
scaled_new_tc = scaled_tc
11041105
if "new_tc" in run["args"]:
1105-
scaled_new_tc, new_tc_limit = adjust_tc(
1106-
run["args"]["new_tc"], factor, int(worker_info["concurrency"])
1107-
)
1106+
scaled_new_tc, new_tc_limit = adjust_tc(run["args"]["new_tc"], factor)
11081107
tc_limit = (tc_limit + new_tc_limit) / 2
11091108

11101109
result["nps"] = base_nps

0 commit comments

Comments
 (0)