Hi all!
I've modified the Stockfish Makefile such that it's now possible to build PGO builds with GCC. You may download my modified Makefile here:
http://www.gnubg.org/media/Makefile-stockfish
I've made these changes for Windows systems with mingw gcc. To make an executable you need mingw gcc and make. It's probably easy to make similar changes for doing the same ting on Linux systems. I have made the changes with out USE_POPCNT, but adding it should also be simple.
Results (form my machine):
Straight for the box compile:
stockfish.exe bench 32 1 10 default depth
Bench position: 16/16
===============================
Total time (ms) : 3625
Nodes searched : 2530382
Nodes/second : 698036
Profile optimize guided build:
stockfish-pgo.exe bench 32 1 10 default depth
Bench position: 16/16
===============================
Total time (ms) : 3437
Nodes searched : 2530382
Nodes/second : 736218
(Not a really impressive improvement, but at least it's something)
-Øystein
GCC PGO builds of Stockfish 1.7.1
Moderators: hgm, Rebel, chrisw
-
- Posts: 2684
- Joined: Sat Jun 14, 2008 9:17 pm
Re: GCC PGO builds of Stockfish 1.7.1
Thanks !oysteijo wrote:Hi all!
I've modified the Stockfish Makefile such that it's now possible to build PGO builds with GCC. You may download my modified Makefile here:
I will merge in the current development version.
Why you have used:
Code: Select all
@$(PGOBENCH) > $(TMPOUTPUT)
instead of
@$(PGOBENCH) > /dev/null
Re: GCC PGO builds of Stockfish 1.7.1
WARNING: Please test it a bit first, I've only used it on a Windows system, and it might not work on Linux. Notice for instance that I've removed the ./ in PGOBENCH, which will make trouble i for Linux builders.I will merge in the current development version.
My build system does not have a /dev/null (windows). I could maybe have generated some kind of /dev/null, but to me it the above was the most pragmatic.Why you have used:
Code:
@$(PGOBENCH) > $(TMPOUTPUT)
However, my experience so far is that compile options like -mtune and -msseX are those who gains the most when compiling with GCC. I will try some more and see what I can come up with.
Could it be smart to check (automatic) which SSE-level the computer supports and then add the right -msse flag?
-Øystein
-
- Posts: 2684
- Joined: Sat Jun 14, 2008 9:17 pm
Re: GCC PGO builds of Stockfish 1.7.1
yes, I needed to readd ./ in PGOBENCH and then it worked on Linux without problems.oysteijo wrote:WARNING: Please test it a bit first, I've only used it on a Windows system, and it might not work on Linux. Notice for instance that I've removed the ./ in PGOBENCH, which will make trouble i for Linux builders.I will merge in the current development version.
My build system does not have a /dev/null (windows). I could maybe have generated some kind of /dev/null, but to me it the above was the most pragmatic.Why you have used:
Code:
@$(PGOBENCH) > $(TMPOUTPUT)
However, my experience so far is that compile options like -mtune and -msseX are those who gains the most when compiling with GCC. I will try some more and see what I can come up with.
Could it be smart to check (automatic) which SSE-level the computer supports and then add the right -msse flag?
-Øystein
Regarding to be smart I would avoid it: to be smart doesn't work well with software development . Just adding -msse should be enough because is supported by almost all the CPU. And also I am not sure that with these flags speed will change, but admittely I have not tested myself.
Thanks a lot for the patch !
-
- Posts: 1384
- Joined: Fri Jul 14, 2006 7:56 am
- Location: London, England
- Full name: Jim Ablett
Re: GCC PGO builds of Stockfish 1.7.1
I usually get a speedup with these for GCC > (-ftree-vectorize is GCC 4 & above)
Jim.
Code: Select all
-funroll-all-loops -ftree-vectorize -funsafe-math-optimizations -mfpmath=387
-
- Posts: 34
- Joined: Mon Nov 17, 2008 6:58 am
Re: GCC PGO builds of Stockfish 1.7.1
Hi Jim and other experts,
How do you do GPO? By running gaunlet tests or positions/suite? How many and what sort of positons are appropriate?
thx!
How do you do GPO? By running gaunlet tests or positions/suite? How many and what sort of positons are appropriate?
thx!
-
- Posts: 1384
- Joined: Fri Jul 14, 2006 7:56 am
- Location: London, England
- Full name: Jim Ablett
Re: GCC PGO builds of Stockfish 1.7.1
Hi Edward,edwardyu wrote:Hi Jim and other experts,
How do you do GPO? By running gaunlet tests or positions/suite? How many and what sort of positons are appropriate?
thx!
Run a few games and some test positions to gather the profile data.
Actually most of the areas critical to the speed of the engine are profiled in the first few seconds of running a game with it.
I think doing a profiling run for more than about ten minutes is overkill.
Jim.