ChessUSA.com TalkChess.com
Hosted by Your Move Chess & Games
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

cache alignment of tt
Post new topic    TalkChess.com Forum Index -> Computer Chess Club: Programming and Technical Discussions Flat
View previous topic :: View next topic  
Author Message
Robert Hyatt



Joined: 27 Feb 2006
Posts: 15816
Location: Birmingham, AL

PostPost subject: Re: cache alignment of tt    Posted: Mon Mar 12, 2012 5:21 am Reply to topic Reply with quote

Daniel Shawul wrote:
Do you use aligned malloc for your hash tables (main,pawn and eval) to put the starting address at 64 byte boundaries. Even though I had a bucket with 4 slots each 16 byte in size, I forgot to actually do _aligned_malloc() !? weird. But after I make the change it actually got slower nps wise on windows. On linux systems profiling shows there is some gain for the main tt but not for the eval cache (16 bytes entries). I don't use buckets for the eval cache so I guess there is not much to gain from there...
Also does pre-fetching gain anything or is it another optimization myths ?
Why I am asking this is these things are crucial for gpu computation even though I never bothered to implement them for scorpio.


I've always done it, but I did not use aligned_malloc() since it is not portable. I did my own. The gain is a very small one. And the gain comes in two ways.

(1) a single entry won't split two cache lines, which would not be very efficient.

(2) Assuming you use buckets, the first entry in the bucket has latency, but the other three (assuming 4 TT entries per bucket/cache-line) will be free.

Pre-fetching is an unclear issue. If you use the prefetch opcode to load a hash bucket prior to it being used, you hide part of the fetch latency. But usually a very small part because you don't know where the entry is until just before you need it. And the down-side is that when you bring something in, you have to kick something out. Perhaps right before you use it...
Back to top
View user's profile Send private message
Display posts from previous:   
Subject Author Date/Time
cache alignment of tt Daniel Shawul Sun Mar 11, 2012 10:22 pm
      Re: cache alignment of tt H.G.Muller Sun Mar 11, 2012 10:39 pm
            Re: cache alignment of tt Daniel Shawul Sun Mar 11, 2012 11:06 pm
      Re: cache alignment of tt Jon Dart Mon Mar 12, 2012 12:43 am
            Re: cache alignment of tt Daniel Shawul Mon Mar 12, 2012 2:53 am
            Re: cache alignment of tt Vincent Diepeveen Thu Mar 15, 2012 8:12 pm
      Re: cache alignment of tt Robert Purves Mon Mar 12, 2012 4:10 am
            Re: cache alignment of tt Daniel Shawul Mon Mar 12, 2012 4:49 am
      Re: cache alignment of tt Robert Hyatt Mon Mar 12, 2012 5:21 am
            Re: cache alignment of tt Ricardo Barreira Mon Mar 12, 2012 8:25 am
                  Re: cache alignment of tt Robert Hyatt Mon Mar 12, 2012 3:54 pm
                        Re: cache alignment of tt Alvaro Cardoso Tue Mar 13, 2012 12:33 am
                              Re: cache alignment of tt Robert Hyatt Thu Mar 15, 2012 2:15 pm
                                    Re: cache alignment of tt Rémi Coulom Thu Mar 15, 2012 4:42 pm
                                          Re: cache alignment of tt Robert Hyatt Thu Mar 15, 2012 5:03 pm
                                                Re: cache alignment of tt Daniel Shawul Thu Mar 15, 2012 5:08 pm
            Re: cache alignment of tt Daniel Shawul Mon Mar 12, 2012 12:49 pm
Post new topic    TalkChess.com Forum Index -> Computer Chess Club: Programming and Technical Discussions

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




Powered by phpBB © 2001, 2005 phpBB Group
Enhanced with Moby Threads