* Optimized BLAS (No. 2) @ 1998-11-06 5:00 C.Simmendinger 1998-11-12 5:00 ` Adam C. Powell, IV 0 siblings, 1 reply; 11+ messages in thread From: C.Simmendinger @ 1998-11-06 5:00 UTC (permalink / raw) Hi there ;-) Time for an update. I added a few optimized routines to the alpha-blas, (complex ones) bugfixed a few others and made sure LAPACK runs atop of it. On large matrices egcs/BLAS now beats DEC's f90/DXML. The whole thing is based on the gemm_based blas from netlib, Goto's gemm and a couple of routines from Dayde. The BLAS is available under http://129.69.45.26/~chrisi/blastree.tar.gz Just unpack, use the makelib shellscript and pray ;-) Uhm, if g77 doesn't happen to be at /usr/local/bin/g77 you'll need to set a link. Christian ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Optimized BLAS (No. 2) 1998-11-06 5:00 Optimized BLAS (No. 2) C.Simmendinger @ 1998-11-12 5:00 ` Adam C. Powell, IV 1998-11-12 5:00 ` Murx 1998-11-12 5:00 ` Optimized BLAS (No. 2) Murx 0 siblings, 2 replies; 11+ messages in thread From: Adam C. Powell, IV @ 1998-11-12 5:00 UTC (permalink / raw) To: chrisi [-- Attachment #1: Type: text/plain, Size: 3610 bytes --] "C.Simmendinger" wrote: > Hi there ;-) > > Time for an update. > > I added a few optimized routines to the alpha-blas, > (complex ones) bugfixed a few others and > made sure LAPACK runs atop of it. > > On large matrices egcs/BLAS now beats DEC's f90/DXML. AWESOME! Thank you vey much for putting these together in a single place. The BLAS I had were old, and not written to use gemm (or gemv), so this is a HUGE help! > The whole thing is based on the gemm_based blas from > netlib, Goto's gemm and a couple of routines > from Dayde. > The BLAS is available under > http://129.69.45.26/~chrisi/blastree.tar.gz > Just unpack, use the makelib shellscript and pray ;-) > > Uhm, if g77 doesn't happen to be at /usr/local/bin/g77 > you'll need to set a link. A couple of questions: 1. Why the separate dcmplx directories? To test the effect of -fno-emulate-complex on non-complex sources, I tried compiling dtrmm.f with and without it, and diff showed the objects were identical. (Or does this slow down the single-precision complex routines?) 2. Why not use a makefile (instead of makelib script)? Advantages: no need to specify where g77 is; it dies if a file fails to compile, whereas the makelib script keeps going and gives an incomplete library; if you change one file you don't end up re-compiling everything; you get to watch it compile each file and feel like it's doing something. :-) I've attached a makefile for the main directory that seems to work. Small and simple. 3. How about generating a shared library? The attached makefile does this. It doesn't seem to save a whole lot of space in progarm binaries, but when a new BLAS library is available, you don't have to re-compile other programs that depend on it. 4. Generating this shared library turned up a problem in the source code (for some reason, g77 -shared is stricter than ar). csgpm, dsgpm, ssgpm and zsgpm all start with PROGRAM, not SUBROUTINE, and all have in their file the LOGICAL FUNCTION LNCMP- all identical. Changing the first line in each and removing all LNCMPs but the one in csgpm.f solved this problem. 5. Could we get an additional speed increase by replacing dgemv with a call to Goto's gemm with n=1? (Also ldb=incx, ldc=incy.) This could be done just by writing a "gemv.c" in the dgemm directory (which should probably be called "gemm" since it has both dgemm and sgemm) similar to "gemm.c", which calls gemm_nn or gemm_tn depending on TRANS. It is sort of an abstraction violation, as level 3 BLAS are supposed to depend on level 2 and not vice versa, but I don't think this is a real problem- as long as it works and goes fast. 6. Have you played with the block size settings? I got a 10% speed increase in LAPACK dgetrf (LU decomposition) by editing ilaenv.f to change the block size from 64 to 32. Possible reasons: Goto's gemm loads something like 122x32 and 122x122 blocks of the matrices into L2 cache, changing these both to 64x64 might help a tiny bit; but more likely it's because dgetf2 (unblocked, no gemm) is called with larger submatrices... It's all so complicated. :-) Just wondering if you've tried. Okay, so I've done everything except gemv.c. I'll work on this later. Thank you again! -Adam `Cold Fusion' Powell, IV http://www.ctcms.nist.gov/~powell/ ____ USDoC, National Institute of Standards & Technology (NIST) |\ ||< | Center for Theoretical and Computational Materials Science | \||_> | [-- Attachment #2: Makefile --] [-- Type: text/plain, Size: 611 bytes --] # Adam Powell's makefile for Christian Simmendinger's Alpha 21164A BLAS package # including Kazushige Goto's amazing dgemm routine FFLAGS = -O3 -fomit-frame-pointer -funroll-loops -fno-schedule-insns \ -fschedule-insns2 -fno-emulate-complex SRCS := $(wildcard *.f) OBJS = $(SRCS:.f=.o) all: $(OBJS) make -C BLAS_RISC lib && make -C dgemm || exit ln -sf BLAS_RISC/*.o dgemm/*.o . rm -f libblas.a ar qv libblas.a *.o rm -f libblas.so g77 -shared -Wl,-soname -Wl,libblas.so -o libblas.so *.o chmod +x libblas.so clean: make -C BLAS_RISC clean && make -C dgemm clean || exit rm -f *.a *.so *.o *~ core ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Optimized BLAS (No. 2) 1998-11-12 5:00 ` Adam C. Powell, IV @ 1998-11-12 5:00 ` Murx 1998-11-12 5:00 ` Adam C. Powell, IV 1998-11-12 5:00 ` Optimized BLAS (No. 2) Murx 1 sibling, 1 reply; 11+ messages in thread From: Murx @ 1998-11-12 5:00 UTC (permalink / raw) Adam C. Powell, IV wrote: > "[snipsnipsnip] Please for updates check ftp.neuro.uni-oldenburg.de/pub/alpha Cheers Christian ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Optimized BLAS (No. 2) 1998-11-12 5:00 ` Murx @ 1998-11-12 5:00 ` Adam C. Powell, IV 1998-11-12 5:00 ` Murx 0 siblings, 1 reply; 11+ messages in thread From: Adam C. Powell, IV @ 1998-11-12 5:00 UTC (permalink / raw) To: chrisi Murx wrote: > Adam C. Powell, IV wrote: > > > "[snipsnipsnip] > > Please for updates check > > ftp.neuro.uni-oldenburg.de/pub/alpha > > Cheers Christian Thank you for the link. You have done a lot of work in less than a week! And many of my questions are answered well here (e.g. I was unaware of Kazushige Goto's libgemv, libdot, libaxpy; and of the czgemv contained here). A couple of points: * Strictly speaking, the BLAS and LAPACK libraries don't link to the libffm/libfm math libraries, they are independent; though both of course are helpful for many codes. * Most people like to download either sources or SRPMs or RPMs, rarely any combination. The SRPM and RPM directories are empty here, but in the future when they are filled, don't you think they should be distributed separately? By the way, is there a mailing list for high floating-point performance on Linux-Alpha? I would be glad to participate in this development effort. Thank you again, -Adam `Cold Fusion' Powell, IV http://www.ctcms.nist.gov/~powell/ ____ USDoC, National Institute of Standards & Technology (NIST) |\ ||< | Center for Theoretical and Computational Materials Science | \||_> | ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Optimized BLAS (No. 2) 1998-11-12 5:00 ` Adam C. Powell, IV @ 1998-11-12 5:00 ` Murx 1998-11-12 5:00 ` Adam C. Powell, IV 0 siblings, 1 reply; 11+ messages in thread From: Murx @ 1998-11-12 5:00 UTC (permalink / raw) Adam C. Powell, IV wrote: > Murx wrote: > > Thank you for the link. You have done a lot of work in less than a > week! And many of my questions are answered well here (e.g. I was > unaware of Kazushige Goto's libgemv, libdot, libaxpy; and of the czgemv > contained here). > > A couple of points: > > * Strictly speaking, the BLAS and LAPACK libraries don't link to the > libffm/libfm math libraries, they are independent; though both of > course are helpful for many codes. Well strictly speaking not .... The resulting code *should* link against them though ;-) > * Most people like to download either sources or SRPMs or RPMs, > rarely any combination. The SRPM and RPM directories are empty > here, but in the future when they are filled, don't you think they > should be distributed separately? Probably not, since LAPACK makes heavy use of the math lib and relies on this being fast. (a handcoded assembler gemm and a slow math lib don't mix imho) Ask Johannes ( joe@neuro.uni-oldenburg.de ) ! He did all the work you mentioned anyway ;-) ! Cheers ! Christian ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Optimized BLAS (No. 2) 1998-11-12 5:00 ` Murx @ 1998-11-12 5:00 ` Adam C. Powell, IV 1998-11-13 5:00 ` Johannes G.D. Hausmann 1998-11-13 5:00 ` Other things Murx 0 siblings, 2 replies; 11+ messages in thread From: Adam C. Powell, IV @ 1998-11-12 5:00 UTC (permalink / raw) Hello again, Thank you for answering my questions, including the somewhat ignorant one about the function of the SRPMS and RPMS directories. :-) I too was getting compiler errors on the single-precision complex subroutines, but thought it was because I am using egcs-1.0.3a. (Kind of old, but it compiles some things -O2 which egcs-1.1b won't do, so it is more useful for compiling a lot of packages out-of-the-box.) Okay, I downloaded the tar file, and started unpacking, and have a couple more questions: * RPMs usually unload into /usr/lib and /usr/bin rather than /usr/local/lib and /usr/local/bin, partly (I think) because linking to /usr/lib doesn't require LD_LIBRARY_PATH to be set, whereas linking to /usr/local/lib does. Likewise for /usr/doc. Any reason for the deprature from the convention? (Or do non-RedHat distributions unpack into /usr/local?) * Would it make some sense to to remove one BLAS directory level and just have SOURCES/BLAS/SRC, SOURCES/BLAS/INSTALL, and SOURCES/BLAS/man (as you have in the LAPACK directory)? * Is there any reason blas_risc_v1.tar.Z is missing from the distribution? It gives me a "Bad source" error. (Of course, I was able to ftp it from the address listed, just wondered why it wasn't there.) I guess this newsgroup will have to serve as our "mailing list" for now. :-) Thank you again! -Adam `Cold Fusion' Powell, IV http://www.ctcms.nist.gov/~powell/ ____ USDoC, National Institute of Standards & Technology (NIST) |\ ||< | Center for Theoretical and Computational Materials Science | \||_> | ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Optimized BLAS (No. 2) 1998-11-12 5:00 ` Adam C. Powell, IV @ 1998-11-13 5:00 ` Johannes G.D. Hausmann 1998-11-14 5:00 ` Toon Moene 1998-11-13 5:00 ` Other things Murx 1 sibling, 1 reply; 11+ messages in thread From: Johannes G.D. Hausmann @ 1998-11-13 5:00 UTC (permalink / raw) Hi there! Hmm, in the meantime I put up the next update...Better yet! Uses the fine new libaxpy-981112 by K.G.-sama, and most of the dot-981030. The html-thing is also a little better now. > * RPMs usually unload into /usr/lib and /usr/bin rather than > /usr/local/lib and /usr/local/bin, partly (I think) because linking > to /usr/lib doesn't require LD_LIBRARY_PATH to be set, whereas > linking to /usr/local/lib does. Likewise for /usr/doc. Any reason > for the deprature from the convention? (Or do non-RedHat > distributions unpack into /usr/local?) Christian already answered this - but if you insist on /usr as base, you could try to replace all occurences of /usr/local in the spec files with /usr. Concerning the docs, there's a line defaultdocdir:... in the lapack.rpmrc which you can change to /usr/doc. I think those were the only places I put it in... OTOH, seems much easier to put /usr/local/lib in your /etc/ld.so.conf? > * Would it make some sense to to remove one BLAS directory level and > just have SOURCES/BLAS/SRC, SOURCES/BLAS/INSTALL, and > SOURCES/BLAS/man (as you have in the LAPACK directory)? When (if???) Kazushige Goto slows down a little, when (if???) I finish my Ph.D., and under several other highly unlikely circumstances, I'll try to clean things up :-) > * Is there any reason blas_risc_v1.tar.Z is missing from the > distribution? It gives me a "Bad source" error. (Of course, I was > able to ftp it from the address listed, just wondered why it wasn't > there.) > License issues...most of this stuff isn't (L)GPL. Actually I just contacted the LAPACK people to find out if we're (especially me, really) already in jail... > -Adam `Cold Fusion' Powell, IV http://www.ctcms.nist.gov/~powell/ ____ ^^^^^^^^^^^ This what you're working at? ;-) Jo -- ----------------------------------------- Johannes Hausmann Carl von Ossietzky Universitaet Oldenburg FB Physik -- AG Komplexe Systeme EMail : joe@neuro.uni-oldenburg.de ----------------------------------------- ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Optimized BLAS (No. 2) 1998-11-13 5:00 ` Johannes G.D. Hausmann @ 1998-11-14 5:00 ` Toon Moene 1998-11-16 5:00 ` Adam C. Powell, IV 0 siblings, 1 reply; 11+ messages in thread From: Toon Moene @ 1998-11-14 5:00 UTC (permalink / raw) "Johannes G.D. Hausmann" <joe@neuro.uni-oldenburg.de> wrote: > > -Adam `Cold Fusion' Powell, IV http://www.ctcms.nist.gov/~powell/ ____ > ^^^^^^^^^^^ > This what you're working at? ;-) Note: Cold Fusion is only discussed in sci.physics (non-moderated). Watch out for Ludwig Plutonium. You do *not* need BLAS (accelerated or not) to compute anything in Cold Fusion Research, basically because it's phenomenological science, not based on any computable (i.e. predictable) events. Now don't get me started on Cold Fusion, UFO's and Aliens as a part of *experimental* science. :-) -- Toon Moene (mailto:toon@moene.indiv.nluug.nl) Saturnushof 14, 3738 XG Maartensdijk, The Netherlands Phone: +31 346 214290; Fax: +31 346 214286 g77 Support: mailto:fortran@gnu.org; egcs: mailto:egcs-bugs@cygnus.com ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Optimized BLAS (No. 2) 1998-11-14 5:00 ` Toon Moene @ 1998-11-16 5:00 ` Adam C. Powell, IV 0 siblings, 0 replies; 11+ messages in thread From: Adam C. Powell, IV @ 1998-11-16 5:00 UTC (permalink / raw) "Cold Fusion" was just a nickname I got in school for wearing shorts and a T-shirt (and gloves- hands got cold) outside every day through nine Boston winters. Freaked people out by making snow angels and such. Went to Iceland with the school concert band in late January, wearing a tux for the concerts, shorts and T-shirt the rest of the time. Mild insanity. Not my research topic. Sorry for the cold fusion con-fusion. :-) Zeen, -Adam `Cold Fusion' Powell, IV http://www.ctcms.nist.gov/~powell/ ____ USDoC, National Institute of Standards & Technology (NIST) |\ ||< | Center for Theoretical and Computational Materials Science | \||_> | ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Other things. 1998-11-12 5:00 ` Adam C. Powell, IV 1998-11-13 5:00 ` Johannes G.D. Hausmann @ 1998-11-13 5:00 ` Murx 1 sibling, 0 replies; 11+ messages in thread From: Murx @ 1998-11-13 5:00 UTC (permalink / raw) Adam C. Powell, IV wrote: > Hello again, > [snipsnip] - This is sort of under constant development, so usr/local seems appropriate ? - Neither LAPACK, nor BLAS are actually GPL. They are 'public domain' whatever that means. Same goes for the routines of Dayde. It's sort of a legal issue. > I guess this newsgroup will have to serve as our "mailing list" for now. > :-) > Okay i'm promoting another link and i'm having a few questions too: We started running an alpha beowulf. (real tiny , just testing right now). In the long run we hope to be able to do without cray/nec and the likes. A very neat general MPI algorithm can be found under http://www.cerca.umontreal.ca/~malevsky/MSG/MSG.html It does asynchronous reads/ writes in a pretty clever way, and thus kicks out the cluster-related latency. Btw: It would be very handy if someone would collect all those links and put it on some web page ? Now a question: Right now i'm doing cache-blocking, loop-unrolling by hand. (yuck) Turns out that this is real work ..... I alway keep thinking this might be done by some clever perl script or whatever ? Would act as some sort of preprocessing before handing over the code to egcs ? Things like this ought to be floating around somewhere ? Cheers Christian ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Optimized BLAS (No. 2) 1998-11-12 5:00 ` Adam C. Powell, IV 1998-11-12 5:00 ` Murx @ 1998-11-12 5:00 ` Murx 1 sibling, 0 replies; 11+ messages in thread From: Murx @ 1998-11-12 5:00 UTC (permalink / raw) Adam C. Powell, IV wrote: > A couple of questions: > > 1. Why the separate dcmplx directories? To test the effect of > -fno-emulate-complex on non-complex sources, I tried compiling > dtrmm.f with and without it, and diff showed the objects were > identical. (Or does this slow down the single-precision complex > routines?) Err, no rather g77/egcs crashes on -fno-emulate-complex single-precision (no prob for me, since i use double throughout anyway ;-) It does however yield such an amazing speedup that you are well-advised to use this switch. Did quite a few runs with this. Although info says it might produce incorrect results i haven't found a bug yet. Stopped crosschecking now. > 5. Could we get an additional speed increase by replacing dgemv with a > call to Goto's gemm with n=1? (Also ldb=incx, ldc=incy.) This > could be done just by writing a "gemv.c" in the dgemm directory > (which should probably be called "gemm" since it has both dgemm and > sgemm) similar to "gemm.c", which calls gemm_nn or gemm_tn > depending on TRANS. It is sort of an abstraction violation, as > level 3 BLAS are supposed to depend on level 2 and not vice versa, > but I don't think this is a real problem- as long as it works and > goes fast. Goto has an assembler sgemv/dgemv. There is also a ugly version of cgemv/zgemv which isn't as good but not way behind. > 6. Have you played with the block size settings? I got a 10% speed > increase in LAPACK dgetrf (LU decomposition) by editing ilaenv.f to > change the block size from 64 to 32. Possible reasons: Goto's gemm > loads something like 122x32 and 122x122 blocks of the matrices into > L2 cache, changing these both to 64x64 might help a tiny bit; but > more likely it's because dgetf2 (unblocked, no gemm) is called with > larger submatrices... It's all so complicated. :-) Just wondering > if you've tried. Only in the BLAS. I ended up using 12x8 i think. woops... > Okay, so I've done everything except gemv.c. I'll work on this later. No need to ;-) As for the mailing-list: I'd join too ! Christian ^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~1998-11-16 5:00 UTC | newest] Thread overview: 11+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 1998-11-06 5:00 Optimized BLAS (No. 2) C.Simmendinger 1998-11-12 5:00 ` Adam C. Powell, IV 1998-11-12 5:00 ` Murx 1998-11-12 5:00 ` Adam C. Powell, IV 1998-11-12 5:00 ` Murx 1998-11-12 5:00 ` Adam C. Powell, IV 1998-11-13 5:00 ` Johannes G.D. Hausmann 1998-11-14 5:00 ` Toon Moene 1998-11-16 5:00 ` Adam C. Powell, IV 1998-11-13 5:00 ` Other things Murx 1998-11-12 5:00 ` Optimized BLAS (No. 2) Murx
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox