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

[RFC] Optimize SF parameters for matecheck performance. #121

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

vondele
Copy link
Owner

@vondele vondele commented Aug 2, 2024

An additional python script to optimize tunable parameters in SF for matetrack performance.

One example:

matetrack at 1M nodes:
Total FENs:    6554

branch:
Found mates:   4275
Best mates:    3308

master:
Found mates:   3271
Best mates:    2345

For a branch based on XInTheDark/Stockfish@d83d6a4

Using a budget of 4000 evaluations, invoked as:

mpirun -np N python3 -u -m mpi4py.futures  ng4mt.py --ngBudget 4000 --engine $dir/stockfish --epdFile $dir/matetrack.epd  --nodes 1000000 --concurrency $concurrency

Not sure this script belongs in the matetrack repo, the nevergrad and mpi4py dependencies are a bit heavy.

An additional python script to optimize tunable parameters in SF for matetrack performance.

One example:

    matetrack at 1M nodes:
    Total FENs:    6554

    branch:
    Found mates:   4275
    Best mates:    3308

    master:
    Found mates:   3271
    Best mates:    2345

For a branch based on XInTheDark/Stockfish@d83d6a4

Using a budget of 4000 evaluations, invoked as:

```
mpirun -np N python3 -u -m mpi4py.futures  ng4mt.py --ngBudget 4000 --engine $dir/stockfish --epdFile $dir/matetrack.epd  --nodes 1000000 --concurrency $concurrency
```

Not sure this script belongs in the matetrack repo, the nevergrad and mpi4py dependencies are a bit heavy.
@vondele vondele marked this pull request as draft August 2, 2024 09:25
@robertnurnberg
Copy link
Contributor

Impressive performance. What we should be careful about is to not train in the same set we test, to avoid overfitting to the test set.

So we may need a (much?) larger set of positions from which to choose the training set(s). These new positions could maybe be obtained by looking at the first mate announcement per game in pgns from fishtest? Then update the bm for those if and when we find shorter ones?

I'd be happy to keep these new scripts in the repo.

for line in output.stdout.split("\n"):
# we minimize, so return minus the number of best mates
if "Best mates: " in line:
return -int(line.split()[2])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could also subtract a small multiple of mates found?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In any case I would also add "Better mates:", in case the bm value from the epd file is not (yet) optimal. In that case could also log some message with relevant FEN.

@vondele
Copy link
Owner Author

vondele commented Aug 2, 2024

Just adding this here as a reference as well
image

@vondele
Copy link
Owner Author

vondele commented Aug 2, 2024

Note that such an optimization reduces Elo by roughly 50 points:
https://tests.stockfishchess.org/tests/view/66ac9e074ff211be9d4ed87c

@robertnurnberg
Copy link
Contributor

Yeah, to be expected. But it offers some nice possibilities for the future.

@robertnurnberg
Copy link
Contributor

A set with 1M mates has been added here: robertnurnberg/matetools#83

Could be used to have seperate training and testing data in future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants