Designing an analysis friendly Stockfish?

Code, algorithms, languages, construction...
gaard
Posts: 127
Joined: Thu Jun 10, 2010 1:39 am
Real Name: Martin Wyngaarden
Location: Holland, Michigan

Re: Designing an analysis friendly Stockfish?

Post by gaard » Thu Feb 10, 2011 12:17 pm

Jeremy Bernstein wrote:
gaard wrote:
Jeremy Bernstein wrote:
ivanhoe wrote:How about getting rid of EGTB support to see it goes any better or faster?
EGTB will only effect performance when there are fewer than 6 pieces on the board. Otherwise, it's ignored.

However, dealing with performance is my next planned activity. My compiles are markedly slower than gaard's. I presume that you're using MingW, gaard, or are you running a different setup? I need to take a day to play with different compiler settings and/or change to a different compiler, since we're compiling more or less the same code.

Jeremy
Intel's compiler (11.1) which generally outperforms MS' 2010 by 3-5%. I haven't use MinGW in a long time. IIRC, MS' optimizing compiler, free with Visual Studio Express, is a little faster.
Thanks, strange. I wonder why your compiles are so much faster. Turning off most of the optimizations for the Intel compiler, I seem to have found something slightly faster than what I was doing before, but I'm still doing comparisons, and I need to see if PGO makes a difference (it didn't with my previous settings). In any case, any speed hits are definitely not the result of the GTBs -- #ifdefing that code out doesn't have any effect on overall speed, AFAICT. Anyhow, Maybe I'll come up with a winner before the end of the day. :)
Aside from profiling, I get good results with these switches:

/Qansi-alias /Qinline-min-size- /Qinline-max-per-compile- /GA /Qcomplex-limited-range /O3 /Qprec-div- /Qipo

Prima
Posts: 328
Joined: Tue Dec 14, 2010 6:12 am

Re: Designing an analysis friendly Stockfish?

Post by Prima » Thu Feb 10, 2011 5:26 pm

gaard wrote:
Jeremy Bernstein wrote:
gaard wrote:
Jeremy Bernstein wrote:
ivanhoe wrote:How about getting rid of EGTB support to see it goes any better or faster?
EGTB will only effect performance when there are fewer than 6 pieces on the board. Otherwise, it's ignored.

However, dealing with performance is my next planned activity. My compiles are markedly slower than gaard's. I presume that you're using MingW, gaard, or are you running a different setup? I need to take a day to play with different compiler settings and/or change to a different compiler, since we're compiling more or less the same code.

Jeremy
Intel's compiler (11.1) which generally outperforms MS' 2010 by 3-5%. I haven't use MinGW in a long time. IIRC, MS' optimizing compiler, free with Visual Studio Express, is a little faster.
Thanks, strange. I wonder why your compiles are so much faster. Turning off most of the optimizations for the Intel compiler, I seem to have found something slightly faster than what I was doing before, but I'm still doing comparisons, and I need to see if PGO makes a difference (it didn't with my previous settings). In any case, any speed hits are definitely not the result of the GTBs -- #ifdefing that code out doesn't have any effect on overall speed, AFAICT. Anyhow, Maybe I'll come up with a winner before the end of the day. :)
Aside from profiling, I get good results with these switches:

/Qansi-alias /Qinline-min-size- /Qinline-max-per-compile- /GA /Qcomplex-limited-range /O3 /Qprec-div- /Qipo
Did you use these switches in an Intel Command Prompt? If so, how did you use these switches in the Intel Command Prompt?
Remember the command you told me earlier for using in MsVS 2010 Command Prompt:
1) vcvarsall amd64 (for 64-bits) OR vcvarsall x86 (for 32-bits)
2) cl /W0 /EHsc /MT *.cpp /link /NODEFAULTLIB:msvcrt.lib

How do I use Intel switch in step2?

Also, I tried adding the Intel 64 Visual Studio mode Command Prompt to the PATH in my computer (like I did for the MSVS 2010 command prompt) but kept getting "Access denied" message, every time I try to use the Intel 64 Visual Studio command prompt for compiles.

If you are using the Intel Compiler GUI, is it possible to post steps here how you use these switches? Thanks

gaard
Posts: 127
Joined: Thu Jun 10, 2010 1:39 am
Real Name: Martin Wyngaarden
Location: Holland, Michigan

Re: Designing an analysis friendly Stockfish?

Post by gaard » Thu Feb 10, 2011 8:26 pm

Prima wrote:
gaard wrote:
Jeremy Bernstein wrote:
gaard wrote:
Jeremy Bernstein wrote:
ivanhoe wrote:How about getting rid of EGTB support to see it goes any better or faster?
EGTB will only effect performance when there are fewer than 6 pieces on the board. Otherwise, it's ignored.

However, dealing with performance is my next planned activity. My compiles are markedly slower than gaard's. I presume that you're using MingW, gaard, or are you running a different setup? I need to take a day to play with different compiler settings and/or change to a different compiler, since we're compiling more or less the same code.

Jeremy
Intel's compiler (11.1) which generally outperforms MS' 2010 by 3-5%. I haven't use MinGW in a long time. IIRC, MS' optimizing compiler, free with Visual Studio Express, is a little faster.
Thanks, strange. I wonder why your compiles are so much faster. Turning off most of the optimizations for the Intel compiler, I seem to have found something slightly faster than what I was doing before, but I'm still doing comparisons, and I need to see if PGO makes a difference (it didn't with my previous settings). In any case, any speed hits are definitely not the result of the GTBs -- #ifdefing that code out doesn't have any effect on overall speed, AFAICT. Anyhow, Maybe I'll come up with a winner before the end of the day. :)
Aside from profiling, I get good results with these switches:

/Qansi-alias /Qinline-min-size- /Qinline-max-per-compile- /GA /Qcomplex-limited-range /O3 /Qprec-div- /Qipo
Did you use these switches in an Intel Command Prompt? If so, how did you use these switches in the Intel Command Prompt?
Remember the command you told me earlier for using in MsVS 2010 Command Prompt:
1) vcvarsall amd64 (for 64-bits) OR vcvarsall x86 (for 32-bits)
2) cl /W0 /EHsc /MT *.cpp /link /NODEFAULTLIB:msvcrt.lib

How do I use Intel switch in step2?

Also, I tried adding the Intel 64 Visual Studio mode Command Prompt to the PATH in my computer (like I did for the MSVS 2010 command prompt) but kept getting "Access denied" message, every time I try to use the Intel 64 Visual Studio command prompt for compiles.

If you are using the Intel Compiler GUI, is it possible to post steps here how you use these switches? Thanks
Assuming you have the Intel compiler installed and "C:\Program Files (x86)\Intel\Compiler\...\bin" is in your path:
iclvars intel64, or ia32
icl /W0 /EHsc ... *.cpp

Can't explain the "Access denied" message. Are logged in as Admin?

fruity
Posts: 29
Joined: Wed Feb 02, 2011 12:52 am

Re: Designing an analysis friendly Stockfish?

Post by fruity » Thu Feb 10, 2011 10:03 pm

fruity wrote:
mcostalba wrote:Sorry for posting only now, but I have limited net access these days.

Thanks for sharing your results. The most interesting thing is that 2 secs of TC seem to hold and give a realistic result. I would have tested 10K at 10 secs, but more for my prejudicies than for a real reason.

Your patch should be almost the same of what I posted because the impact in qsearch should be minimal, even lower then considering mate scores :-)
If somewhere, it would make a difference in qsearch() because node count is heavily dominated by leaf nodes.
I'm running another 60,000 games match for direct comparison between your code and mine.
Results later in the evening.
+16507 -15637 =27856 (+5 Elo) in favor of my proposal.

Prima
Posts: 328
Joined: Tue Dec 14, 2010 6:12 am

Re: Designing an analysis friendly Stockfish?

Post by Prima » Thu Feb 10, 2011 10:07 pm

gaard wrote:Assuming you have the Intel compiler installed and "C:\Program Files (x86)\Intel\Compiler\...\bin" is in your path:
iclvars intel64, or ia32
icl /W0 /EHsc ... *.cpp

Can't explain the "Access denied" message. Are logged in as Admin?
1. Yes, my Intel Visual Studio 2010 mode compiler is installed in: C:\Program Files (x86)\Intel\ComposerXE-2011\bin
2. There are 2 folders within the bin folder: ia32 and intel64
3. Also within the aforementioned path for the Intel compiler, there are 4.bat files: compilervars.bat, compilervars_arch.bat, iclvars.bat, and ipsxe-comp-vars.bat
4. I then placed the source files in the presence of these .bat file and run the Intel 64 Command Prompt as Administrator, I get the command line error message: Filee not found: ' *.cpp'
4b. I also then placed the source files I wanted to compile in the Intel64 folder but I still get the same error message (the same error message as in #4).
5. This is the PATH ( Variables & Values )of my Intel 64 Visual Studio 2010 mode command prompt: ;C:\Program Files (x86)\Intel\ComposerXE-2011\bin

Any ideas why Intel keeps giving error message that it can't find the *.cpp files?
Attachments
Intel-CommandPrompt-ErrorMessage.PNG
Intel 64 Visual Studio command prompt can't find *.cpp files
Intel-CommandPrompt-Path.PNG
My Intel compiler Path, along with its sub folders and components

fruity
Posts: 29
Joined: Wed Feb 02, 2011 12:52 am

Re: Designing an analysis friendly Stockfish?

Post by fruity » Fri Feb 11, 2011 1:19 am

fruity wrote:
fruity wrote:
mcostalba wrote:Sorry for posting only now, but I have limited net access these days.

Thanks for sharing your results. The most interesting thing is that 2 secs of TC seem to hold and give a realistic result. I would have tested 10K at 10 secs, but more for my prejudicies than for a real reason.

Your patch should be almost the same of what I posted because the impact in qsearch should be minimal, even lower then considering mate scores :-)
If somewhere, it would make a difference in qsearch() because node count is heavily dominated by leaf nodes.
I'm running another 60,000 games match for direct comparison between your code and mine.
Results later in the evening.
+16507 -15637 =27856 (+5 Elo) in favor of my proposal.
I try to confirm the result with 60000 10'' games now.
:idea: My electricity provider will be glad :idea:

gaard
Posts: 127
Joined: Thu Jun 10, 2010 1:39 am
Real Name: Martin Wyngaarden
Location: Holland, Michigan

Re: Designing an analysis friendly Stockfish?

Post by gaard » Fri Feb 11, 2011 1:58 am

Prima wrote:
gaard wrote:Assuming you have the Intel compiler installed and "C:\Program Files (x86)\Intel\Compiler\...\bin" is in your path:
iclvars intel64, or ia32
icl /W0 /EHsc ... *.cpp

Can't explain the "Access denied" message. Are logged in as Admin?
1. Yes, my Intel Visual Studio 2010 mode compiler is installed in: C:\Program Files (x86)\Intel\ComposerXE-2011\bin
2. There are 2 folders within the bin folder: ia32 and intel64
3. Also within the aforementioned path for the Intel compiler, there are 4.bat files: compilervars.bat, compilervars_arch.bat, iclvars.bat, and ipsxe-comp-vars.bat
4. I then placed the source files in the presence of these .bat file and run the Intel 64 Command Prompt as Administrator, I get the command line error message: Filee not found: ' *.cpp'
4b. I also then placed the source files I wanted to compile in the Intel64 folder but I still get the same error message (the same error message as in #4).
5. This is the PATH ( Variables & Values )of my Intel 64 Visual Studio 2010 mode command prompt: ;C:\Program Files (x86)\Intel\ComposerXE-2011\bin

Any ideas why Intel keeps giving error message that it can't find the *.cpp files?
If iclvars.bat is in your path, just open a command window with the current directory being the one with the source files you want to compile. Then type "iclvars intel64", "icl /O3 ... *.cpp", etc.

Append this to PATH in environment variables:
;C:\Program Files (x86)\Intel\ComposerXE-2011\bin

You can verify what your PATH is by typing this at the command line "echo %PATH%"

Or do this. Open a command window with the current directory of the source file you want to compile. Then type
call "C:\Program Files (x86)\Intel\ComposerXE-2011\bit\iclvars.bat" intel64

gaard
Posts: 127
Joined: Thu Jun 10, 2010 1:39 am
Real Name: Martin Wyngaarden
Location: Holland, Michigan

Re: Designing an analysis friendly Stockfish?

Post by gaard » Fri Feb 11, 2011 2:12 am

gaard wrote:call "C:\Program Files (x86)\Intel\ComposerXE-2011\bit\iclvars.bat" intel64
Should be:

call "C:\Program Files (x86)\Intel\ComposerXE-2011\bin\iclvars.bat" intel64

Prima
Posts: 328
Joined: Tue Dec 14, 2010 6:12 am

Re: Designing an analysis friendly Stockfish?

Post by Prima » Fri Feb 11, 2011 5:06 am

gaard wrote:
gaard wrote:call "C:\Program Files (x86)\Intel\ComposerXE-2011\bit\iclvars.bat" intel64
Should be:

call "C:\Program Files (x86)\Intel\ComposerXE-2011\bin\iclvars.bat" intel64
Yes it is. As a matter of fact, I tried both PATH schemes:

Code: Select all

Option 1: PATH: ;C:\Program Files (x86)\Intel\ComposerXE-2011\bin\iclvars.bat" intel64 

Option 2: PATH: ;C:\Program Files (x86)\Intel\ComposerXE-2011\bin intel64
But I still got the "Access denied" message when ever I attempt to make compiles with Intel 64 command prompt. I run it also as Administrator but instead, it won't locate the *.cpp source files, even when placed along with the .bat files in the ComposerXE-2011 bin folder.

Google search don't help much either. Puzzling.

gaard
Posts: 127
Joined: Thu Jun 10, 2010 1:39 am
Real Name: Martin Wyngaarden
Location: Holland, Michigan

Re: Designing an analysis friendly Stockfish?

Post by gaard » Fri Feb 11, 2011 6:43 am

Prima wrote:
gaard wrote:
gaard wrote:call "C:\Program Files (x86)\Intel\ComposerXE-2011\bit\iclvars.bat" intel64
Should be:

call "C:\Program Files (x86)\Intel\ComposerXE-2011\bin\iclvars.bat" intel64
Yes it is. As a matter of fact, I tried both PATH schemes:

Code: Select all

Option 1: PATH: ;C:\Program Files (x86)\Intel\ComposerXE-2011\bin\iclvars.bat" intel64 

Option 2: PATH: ;C:\Program Files (x86)\Intel\ComposerXE-2011\bin intel64
But I still got the "Access denied" message when ever I attempt to make compiles with Intel 64 command prompt. I run it also as Administrator but instead, it won't locate the *.cpp source files, even when placed along with the .bat files in the ComposerXE-2011 bin folder.

Google search don't help much either. Puzzling.
Remember to use the Shift-Right click to open a command window with the directory containing the cpp files? THEN:
call "C:\Program Filess (x86)\...\bin\iclvars.bat" intel64

If that still does not work and you get another Access Denied error even logged in as Admin, it could be some kind of restriction with your trial version of Intel's compiler.

Maybe something is being lost in translation here. You would NOT append those lines to PATH in environment variables. You would append this:

;C:\Program Files (x86)\Intel\ComposerXE-2011\bin

Then Shift-Right click the directory with your sources,
Then iclvars intel64 at the command prompt
Then icl /EHsc /O3 ... *.cpp
etc.

Post Reply