-
Notifications
You must be signed in to change notification settings - Fork 130
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
NNUE integration work. #732
Comments
One item that came to my mind, while we could compile for x86-64-avx2 on machines that support it, for regression tests vs. SF11 we would need to compile that branch still with x86-64-modern, as it is the only thing it supports. This transition needs some solution. |
I have several concerns. AVX2 on some AMD CPUs BMI2 on AMD CPUs Three-way struggle These may be not critical problems. It may be better to postpone struggling against these problems after the first stage of the integration is done. |
BMI2 on AMD: already now, the user can specify an arch file with custom_make.txt which allows for overriding the default and selecting the best architecture, some users specify bmi2 if it is beneficial. Initially that could be the best way forward. Nevertheless, we will indeed need to implement better processor selection within fishtest, probably best done automatically. Maybe we need to revisit the Makefile to have a 'native' target that just does the right thing setting the flags? The comparison classical vs NNUE will be dominated by the noob workers which will have avx2 or bmi2. The Three-way struggle is indeed something that can happen with the handcrafted evaluation as well. So far, this has not been a critical issue. That might be different with the trained nets. Initially I would ignore this until the problem arises. |
It would be beneficial to include processor information(or at least the capabilities of bmi2, avx2, etc plus vendor) as a part of fishtest machine registration. Then the server can selectively assign tests to workers that qualify certain criteria if necessary. |
Is it an option to include a python package in the worker? Something like: |
Fishtest already already includes the requests library as a subfolder in the worker directory. I can't see anyone objecting to adding one more. |
Regarding @nodchip comment's above about Zen architecture, for classical vs. nnue comparisons, why not run two benches, one with classical and one with nnue, and allot corresponding time controls according to the relative speeds? (Also, on my Ryzen, nnue avx2 is bout 20% faster than nnue modern (but also about 12 degrees C hotter). Using avx2 for classical SF on fishtest could increase fishtest speed for workers like mine.) |
@noobpwnftw I was wondering how you use I think we should get rid of of the This might be one of the next things I'll look into, but would need some advice from @ppigazzini or @tomtor, how do you feel about including py-cpuinfo like we do the requests package? It is python only, and if I'm right would be just one file. However, I'm not sure how to properly 'integrate' a package in the python world, if not just copying a file. If I know how to integrate the package, I can give a try at writing the code that does the compilation step. |
I am not to happy about the requests python package being a static part of the fishtest tree, but until we replace that with eg a @vondele For pure python libraries (like py-cpuinfo) you can just add the files to the repo. No magic required. |
@tomtor @vondele I like more a virtual env in the worker folder to avoid packages conflict, As plan B we could run arch_cpu=x86-64
if [ "$(g++ -Q -march=native --help=target | grep mbmi2 | grep enabled)" ] ; then
if [ "$(g++ -Q -march=native --help=target | grep march | grep 'znver[12]')" ] ; then
arch_cpu=x86-64-modern
else
arch_cpu=x86-64-bmi2
fi
elif [ "$(g++ -Q -march=native --help=target | grep mpopcnt | grep enabled)" ] ; then
arch_cpu=x86-64-modern
fi |
Would it be possible to distinguish somehow (for example with colour) the default net on the NNUE stats page? It can be found perhaps the same way as in Makefile, i.e. by grep'ing ucioption.cpp. |
@dorzechowski the server doesn't really have the sources around, so it would require some additional code to do so. |
I have been thinking that the NN page perhaps should include some metadata for the NNs... Like a comment field, a URL, a full author name, etc.... Also perhaps a user should be able to delete their own NNs (just in the html page, the actual api link would continue to exist). |
More metadata is possibly somewhat problematic, i.e. need to sanitize/police comment fields on a public upload site, or not everybody wants his full name on github. Approvers can see the fishtest registration (i.e. email) of the author, so there is a little more than what is displayed. Right now, it really is a database for storing the nets, and the page reflects database content. I also would like things to be persistent, i.e. once added never removed (and always visible). However, in principle, for each net in the database, we would hope/expect that the author performs a corresponding test on fishtest. The commit message that corresponds to that test can contain any info that the author wants to show. If the test is successful some of this info will be part of the merge commit into official-stockfish. So any net that has the 'default net' status (at any point in the git history), can have quite some (sanitized) metadata associated. I would be in favour of having some input on the generation of the nets for example in such a commit message. As an additional idea, the network data file itself could have metadata fields .... in that way the information is much more closely attached to the net. That's maybe something for @nodchip to consider. |
Technically, we can add a comment to a net file, and add a new command to edit a net file comment to the software. @vdbergh Could you please create an issue on my repository? I will take a look at it. |
comment, and/or things like author name, creation date, ... |
On the upload page it might be a good idea to make it more explicit that the (original) author should upload the net. |
See #744 |
I'll close this issue now, as most of the work has been done. Refinements will follow of course. |
some work will be needed to allow for NNUE testing, as mentioned official-stockfish/Stockfish#2823
I'm of course open to suggestions and welcome all help here.
Enabling or disabling NNUE can be done with a 'Use NNUE' option. If this is true we must download (either from the official-stockfish/networks or from the testing branch if this doesn't exist) the net and pass this with a cutechess option.
There are broadly three tasks I see right now.
Contempt=24
inUse NNUE=true
forTest options
(to be done after merge of NNUE in master)The text was updated successfully, but these errors were encountered: