Stockfish_savehash performance in a corr tourn game

Discussion of anything and everything relating to chess playing software and machines.

Moderators: bob, hgm, Harvey Williamson

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
Rodolfo Leoni
Posts: 544
Joined: Tue Jun 06, 2017 2:49 pm
Location: Italy

Re: Stockfish_savehash performance in a corr tourn game

Post by Rodolfo Leoni » Wed Aug 23, 2017 7:18 pm

giovanni wrote:
Thanks for the update, Rodolfo. I would be greatly itnterested in knowing about your project. Keep up the good work!
:wink:
retep1 wrote: Such a GUI would be a great step towards a better analysis of positions in a chess game - much success in developing this non-private GUI and, of course, I have a great interest in this GUI

:D
Thanks. I don't know when it'll be completed, tough. :)
F.S.I. Chess Teacher

duncan
Posts: 10202
Joined: Mon Jul 07, 2008 8:50 pm

Re: Stockfish_savehash performance in a corr tourn game

Post by duncan » Thu Aug 24, 2017 1:27 pm

retep1 wrote: But still a remark to the benefit. If the loading of 2 GB hash takes about 5 to10 minutes,
do you have usb 3 ?

https://www.everythingusb.com/speed.html

retep1
Posts: 42
Joined: Sun Aug 07, 2016 3:24 pm

Re: Stockfish_savehash performance in a corr tourn game

Post by retep1 » Thu Aug 24, 2017 1:46 pm

duncan wrote:
retep1 wrote: But still a remark to the benefit. If the loading of 2 GB hash takes about 5 to10 minutes,
do you have usb 3 ?
I save on SSD SAMSUNG MZHPV256HDGL-00000

duncan
Posts: 10202
Joined: Mon Jul 07, 2008 8:50 pm

Re: Stockfish_savehash performance in a corr tourn game

Post by duncan » Thu Aug 24, 2017 2:30 pm

retep1 wrote:
duncan wrote:
retep1 wrote: But still a remark to the benefit. If the loading of 2 GB hash takes about 5 to10 minutes,
do you have usb 3 ?
I save on SSD SAMSUNG MZHPV256HDGL-00000
I do not know much about computers . it says here that it can read 2150MB/s, so why should it take 5-10 minutes to load 2 gb hash ?

https://www.scan.co.uk/products/256gb-s ... -90k-70k-i

Read 2150MB/s, Write 1200MB/s, 90k/70k IOPS

retep1
Posts: 42
Joined: Sun Aug 07, 2016 3:24 pm

Re: Stockfish_savehash performance in a corr tourn game

Post by retep1 » Thu Aug 24, 2017 2:46 pm

duncan wrote:
retep1 wrote:
duncan wrote:
retep1 wrote: But still a remark to the benefit. If the loading of 2 GB hash takes about 5 to10 minutes,
do you have usb 3 ?
I save on SSD SAMSUNG MZHPV256HDGL-00000
I do not know much about computers . it says here that it can read 2150MB/s, so why should it take 5-10 minutes to load 2 gb hash ?

https://www.scan.co.uk/products/256gb-s ... -90k-70k-i

Read 2150MB/s, Write 1200MB/s, 90k/70k IOPS
My problem is, I can not perform with any of the savings-engines loadHashFromFile. Save, but do not load. I have no hard disk accesses, which I would have to see in the resource monitor of Windows 10.
When saving, I can see the hard disk accesses in the resource monitor.

User avatar
Leto
Posts: 2028
Joined: Thu May 04, 2006 1:40 am
Location: Dune

Re: Stockfish_savehash performance in a corr tourn game

Post by Leto » Sat Aug 26, 2017 3:16 pm

Rodolfo Leoni wrote:I just received a PM about a difficulty to load the hash data previously saved. I think it's good to post about how I load a saved file, so others can check if it works.

First, I use Arena. I guess there's no difference with other GUIs, tough.

After setting the hash size the same as saved file, and before trying to load them, I let the engine start an infinite analysis on a position, just few seconds, to let the hash reach the right size. Then, I stop analysis and I load the hash file. In my PC to load a 2 GBs hash file takes 5-10 minutes. It depends if other processes are running, IMO.

You can be sure hashes are really loading because you see an intense disk access. You must do nothing untill disk access stops. Then, hashes have been loaded.

I hope this helps. :)
I'm confused. Let's say I load the engine up for the first time and I want to analyse the position in the first post of this thread. Do I have to save a hash file first before I do any analysis? Or do I analyse everything and then save a hash file, and then go back to initial position and load the hash file?

giovanni
Posts: 120
Joined: Wed Jul 08, 2015 10:30 am

Re: Stockfish_savehash performance in a corr tourn game

Post by giovanni » Sat Aug 26, 2017 3:34 pm

Leto wrote:
Rodolfo Leoni wrote:I just received a PM about a difficulty to load the hash data previously saved. I think it's good to post about how I load a saved file, so others can check if it works.

First, I use Arena. I guess there's no difference with other GUIs, tough.

After setting the hash size the same as saved file, and before trying to load them, I let the engine start an infinite analysis on a position, just few seconds, to let the hash reach the right size. Then, I stop analysis and I load the hash file. In my PC to load a 2 GBs hash file takes 5-10 minutes. It depends if other processes are running, IMO.

You can be sure hashes are really loading because you see an intense disk access. You must do nothing untill disk access stops. Then, hashes have been loaded.

I hope this helps. :)
I'm confused. Let's say I load the engine up for the first time and I want to analyse the position in the first post of this thread. Do I have to save a hash file first before I do any analysis? Or do I analyse everything and then save a hash file, and then go back to initial position and load the hash file?
The latter one. You must first induce some learning of the tt by going back and forth along the pvs, then you save it. Rodolfo explained it very well. Try first if you can reprodexu what he did.

User avatar
Leto
Posts: 2028
Joined: Thu May 04, 2006 1:40 am
Location: Dune

Re: Stockfish_savehash performance in a corr tourn game

Post by Leto » Sat Aug 26, 2017 4:51 pm

giovanni wrote:
Leto wrote:
Rodolfo Leoni wrote:I just received a PM about a difficulty to load the hash data previously saved. I think it's good to post about how I load a saved file, so others can check if it works.

First, I use Arena. I guess there's no difference with other GUIs, tough.

After setting the hash size the same as saved file, and before trying to load them, I let the engine start an infinite analysis on a position, just few seconds, to let the hash reach the right size. Then, I stop analysis and I load the hash file. In my PC to load a 2 GBs hash file takes 5-10 minutes. It depends if other processes are running, IMO.

You can be sure hashes are really loading because you see an intense disk access. You must do nothing untill disk access stops. Then, hashes have been loaded.

I hope this helps. :)
I'm confused. Let's say I load the engine up for the first time and I want to analyse the position in the first post of this thread. Do I have to save a hash file first before I do any analysis? Or do I analyse everything and then save a hash file, and then go back to initial position and load the hash file?
The latter one. You must first induce some learning of the tt by going back and forth along the pvs, then you save it. Rodolfo explained it very well. Try first if you can reprodexu what he did.
Thank you it is working for me. This seems very useful for correspondence chess!

Rodolfo Leoni
Posts: 544
Joined: Tue Jun 06, 2017 2:49 pm
Location: Italy

Re: Stockfish_savehash performance in a corr tourn game

Post by Rodolfo Leoni » Sat Aug 26, 2017 5:40 pm

Leto wrote: Thank you it is working for me. This seems very useful for correspondence chess!
Indeed! :)
It's the old fashion way to make an OTB analysis. It works great, even if it sometimes happens I'm too tired to run it and I close everything. But I prefer this way to proceed rather than letting the engine thinking alone.
F.S.I. Chess Teacher

User avatar
Leto
Posts: 2028
Joined: Thu May 04, 2006 1:40 am
Location: Dune

Re: Stockfish_savehash performance in a corr tourn game

Post by Leto » Sun Aug 27, 2017 1:33 pm

And just to make things clearer, here's how I get it to work on Fritz 15 GUI:

1. Set hashtable size to 2048.

2. Copy paste the Rodolfo game from the start of this thread into your Fritz 15 GUI.

3. After white's move 41.Rd7 start your infinite analysis, go forward one move at a time spending a few seconds on each move until you get to move 56.b6. Now go backwards one move at a time spending a few seconds on each move until you get to move 44.Rxd4. You will notice the engine is now suggesting 44...Rxh3. So play 44....Rxh3 as an alternative line, then 45.b4 g5 46.b5 and now your engine sees this is winning for white.

Analyse backwards to 44.Rxd4 and continue analysing backwards one move at a time a few seconds per move until you reach 43.a3. Now the engine is suggesting 43...Kf8 so play that as an alternative line. While on infinite analysis play the following 44.b4 Ke8 45.Qxe5+ Rxe5 46.Rd3 Re7 47.c4 f5 48.c5 Rc7 49.Rf3 Kd7 50.Kc3 Rc6 51.Kd4 and your engine should now see that white is winning.

So analyse backwards and when you get to 44.b4 the engine might suggest 44...Qxd4+ so play that as an alternative and then play 45.Rxd4 Ke7 46.c4 Rxh3 and now the engine should see black is losing. So analyse backwards to 43.a3 and continue analysing backwards one move at a time a few seconds per move until you get back to 41.Rd7, your engine should no longer be suggesting 41...Qe8 and will probably suggest either 41...Rc5 or 41...h6. If you play 41...Qe8 it should immediately show that black is down a few pawns.

Now hit Change Main Engine, Advanced, Engine Parameters, and on the field marked HashFile name it rodolfo.hsh and then hit the SaveHashToFile. After a while you should see rodolfo.hsh in the folder you placed the engine in. Now whenever you come back to this 41.Rd7 position all you have to do is hit Change Main Engine, Advanced, Engine Parameters, and type in rodolfo.hsh on the HashFile field and then hit the LoadHashFromFile button, after a while when it finishes loading the engine will know that 41...Ke8 is bad and you'll know that the hash learning is working properly.

If you were to try doing this with a regular Stockfish you would lose all that analysis when you close the engine. Now that you know how to set this special Stockfish version up properly you can save hashfiles for any analysis that you do in the future.

Post Reply