Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(worker): bench setting the hash #2265

Merged
merged 1 commit into from
Mar 9, 2025

Conversation

ppigazzini
Copy link
Collaborator

Raise worker version to 268 (also server side)

@ppigazzini ppigazzini added enhancement worker update code changes requiring a worker update labels Mar 9, 2025
@ppigazzini
Copy link
Collaborator Author

ppigazzini commented Mar 9, 2025

The PR:

  • benches for signature with only one process, using 1/5 of the previous time for a worker with 48 threads
  • warmup the worker benching at depth 10
  • benches using also the hash set in the test
  • prints statistics only for the bench for nps
  • prints the time used for the signature and the warmup

The nps bench for new_engine could be dropped to speedup further the process.

Note: alternate attempts to get a bench with lower Stdev (%), running consecutive benches to warmup and/or cooldown directly in run_parallel_benches, have failed with concurrency 48 at 1 thread. The CPU load was always at 100% as expected, courtesy of the warmup/cooldown benches. But max_nps / min_nps ~ 2, with 2x Stdev (%). Same result using only a cooldown bench, in order to have the to be benched processes starting at the same time.

def run_parallel_benches(engine, concurrency, threads, hash_size, depth):
    engine_list = [engine] * concurrency *3
    hash_list =[hash_size] * concurrency * 3
    threads_list = [threads] * concurrency * 3
    depth_list = [depth - 3] * concurrency + [depth] * concurrency + [depth - 3] * concurrency
    try:
        with ProcessPoolExecutor(max_workers=concurrency) as executor:
            results = list(
                executor.map(
                    run_single_bench,
                    engine_list,
                    hash_list,
                    threads_list,
                    depth_list,
                )
            )
    except Exception as e:
        message = f"Failed to run engine bench: {str(e)}"
        raise WorkerException(message, e=e)

    for result in results:
        print(result)

    return results[concurrency: -concurrency]

@ppigazzini ppigazzini force-pushed the bench_hash branch 4 times, most recently from 8f0d4aa to 7820910 Compare March 9, 2025 20:51
Raise worker version to 268 (also server side)
@ppigazzini ppigazzini merged commit 11be666 into official-stockfish:master Mar 9, 2025
21 checks passed
@ppigazzini ppigazzini deleted the bench_hash branch March 9, 2025 21:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement worker update code changes requiring a worker update
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant