From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 102b75,45b50f14dadfce5b X-Google-Attributes: gid102b75,public X-Google-Thread: 110292,45b50f14dadfce5b X-Google-Attributes: gid110292,public X-Google-Thread: 1164f8,45b50f14dadfce5b X-Google-Attributes: gid1164f8,public From: David Chase Subject: Re: Final kick at the "Merced Guessing Game" Date: 1997/10/15 Message-ID: <3444288C.7F4E@world.std.com>#1/1 X-Deja-AN: 280564087 Sender: news@world.std.com (Mr Usenet Himself) References: <61cqkc$9r@news-rocq.inria.fr> <343AC71D.5531EE2D@powertelglobal.com> <343C1030.4A86F6D6@tonys.ecology.umn.edu> <61iuna$3li@deadzone.rsn.hp.com> <61kek8$9lh$1@goanna.cs.rmit.edu.au> Organization: Natural Bridge LLC Reply-To: chase@world.std.com Newsgroups: comp.sys.intel,comp.arch,comp.sys.dec Richard A. O'Keefe wrote: > Given my respect for David Chase, my awareness from the literature that > the kinds of transformations he is talking about _are_ used and _do_ > pay off (indeed, I have a student doing a minor thesis on neural nets > trying to see if he can beat Sun's C compiler -- alas, he was unwilling > to learn Fortran --), and also given my strong liking for functional > programming languages like Haskell and Clean, I'm worried. You've got to be careful here. Blocking seems to be very hard, though I would not be surprised if someone's compiler somewhere did it. There are algorithms that are intrinsically unblockable, so I am told my the true experts in the field. An example of this is QR factorization using Householder transformations -- you have to use Givens rotations instead. No compiler is going to do that for you. The advantage of Fortran here is that by-hand cache blocking is probably sufficient, and the compiler will behave relatively well with that. With C, it is likely that you will need to carry out more extensive by-hand transformations to get the same performance. Also, your gradual student had better watch out for what might euphemistically be termed "targeted optimizations", undiplomatically known as benchmark cheating. Avoid industry-standard benchmarks. > What I'm wondering, and here I go way beyond any expertise I might > possibly claim, is whether (a) there are patterns of memory use in > functional languages that hardware designers might exploit, without > adverse effect on more conventional languages? and (b) whether the > hardware designers see any point in worrying about this? (a) maybe and (b) not much, though I did loan what I considered my interesting GC papers to a hardware designer at one time. I think he was interested in doing no harm, as opposed to actually helping. For the time being, I think it makes sense to concentrate on making functional language implementations resemble Fortran under the hood. For instance, you could write a garbage collector to take advantage of the ability to load-w/o-faulting (load first, ask questions about null pointers later) and also perhaps to prefetch (certainly, in a copying GC, it would make sense to prefetch/zero cache lines that you knew you were about to write). -- David Chase, chase@world.std.com