[go: up one dir, main page]
More Web Proxy on the site http://driver.im/ skip to main content
article
Free access

The automatic generation of sparse primitives

Published: 01 June 1998 Publication History

Abstract

Primitives in mathematical software are usually written and optimized by hand. With the implementation of a “sparse compiler” that is capable of automatically converting a dense program into sparse code, however, a completely different approach to the generation of sparse primitives can be taken. A dense implementation of a particular primitive is supplied to the sparse compiler, after which it can be converted into many different sparse versions of this primitive. Each version is specifically tailored to a class of sparse matrices having a specific nonzero structure. In this article, we discuss some of our experiences with this new approach.

References

[1]
AHO, A. V., SETHI, R., AND ULLMAN, J. D. 1986. Compilers: Principles, Techniques, and Tools. Addison-Wesley Longman Publ. Co., Inc., Reading, MA.
[2]
BANERJEE, U. 1990. Unimodular transformations of double loops. In Proceedings of the 3rd Workshop on Languages and Compilers for Parallel Computing (Urbana, IL, Aug. 1-3, 1989), D. Gelernter, A. Nicolau, and D. Padua, Eds. Pitman Publishing, London, UK.
[3]
BANERJEE, U. 1993. Loop Transformations for Restructuring Compilers: The Foundations. Kluwer Academic Publishers, Hingham, MA.
[4]
BIK, A. J. C. 1996. Compiler support for sparse matrix computations. Ph.D. Dissertation. Department of Computer Science, Leiden University.
[5]
BIK, A. J. C. AND WIJSHOFF, H. A. G. 1994. On automatic data structure selection and code generation for sparse computations. In Languages and Compilers for Parallel Computing, Banerjee, U., Gelernter, D., Nicolau, A., and Padua, D., Eds. Springer Lecture Notes in Computer Science, vol. 768. Springer-Verlag, Berlin, Germany, 57-75.
[6]
BIK, A. J. C. AND WIJSHOFF, H. A. G. 1995. Advanced compiler optimizations for sparse computations. J. Parallel Distrib. Comput. 31, 1 (Nov.), 14-24.
[7]
BIK, A. J. C. AND WIJSHOFF, H. A. G. 1996a. Automatic data structure selection and transformation for sparse matrix computations. IEEE Trans. Parallel Distrib. Syst. 7, 2, 109-126.
[8]
BIK, A. J. C. AND WIJSHOFF, H. A. G. 1996b. The use of iteration space partitioning to construct representative simple sections. J. Parallel Distrib. Comput. 34, 95-110.
[9]
BOYLE, J. M., CLINT, M., FITZPATRICK, S., AND HARMER, T. J. 1992. The construction of numerical mathematical software for the AMT DAP by program transformation. In Parallel Processing: COVAPPV, L. Bouge, M. Cosnard, Y. Robert, and D. Trystram, Eds. Lecture Notes in Computer Science, vol. 634. Springer-Verlag, Berlin, Germany, 761-767.
[10]
COOPER, K. D., HALL, M. W., AND KENNEDY, K. 1992. Procedure cloning. In Proceedings of the IEEE International Conference on Computer Languages. IEEE Press, Piscataway, NJ, 96-105.
[11]
COOPER, K. D., KENNEDY, K., AND TORCZON, L. 1986. The impact of interprocedural analysis and optimization in the Rn programming environment. ACM Trans. Program. Lang. Syst. 8, 4 (Oct.), 491-523.
[12]
DODSON, D. S., GRIMES, R. G., AND LEWIS, J. G. 1991a. Algorithm 692: Model implementation and test package for the Sparse Basic Linear Algebra Subprograms. ACM Trans. Math. Softw. 17, 2 (June), 264-272.
[13]
DODSON, D. S., GRIMES, R. G., AND LEWIS, J. G. 1991b. Sparse extensions to the FORTRAN Basic Linear Algebra Subprograms. ACM Trans. Math. Softw. 17, 2 (June), 253-263.
[14]
DONGARRA, J. J., Du CROZ, J., HAMMARLING, S., AND DUFF, I. 1990a. A set of level 3 Basic Linear Algebra Subprograms. ACM Trans. Math. Softw. 16, 1 (Mar.), 1-17.
[15]
DONGARRA, J. J., Du CROZ, J., HAMMARLING, S., AND DUFF, I. 1990b. A set of level 3 basic linear algebra subprograms: Model implementation and test programs. ACM Trans. Math. Softw. 16, 1 (Mar.), 18-28.
[16]
DONGARRA, J. J., Du CROZ, J., HAMMARLING, S., AND HANSON, R. J. 1988a. An extended set of FORTRAN Basic Linear Algebra Subprograms. ACM Trans. Math. Softw. 14, 1 (Mar.), 1-17.
[17]
DONGARRA, J. J., Du CROZ, J., HAMMARLING, S., AND HANSON, R. J. 1988b. An extended set of FORTRAN basic linear algebra subprograms: Model implementation and test programs. ACM Trans. Math. Softw. 14, 1 (Mar.), 18-32.
[18]
DONGARRA, J. J., DUFF, I. S., SORENSEN, D. C., AND VAN DER VORST, H.A. 1991. Solving Linear Systems on Vector and Shared Memory Computers. SIAM, Philadelphia, PA.
[19]
DUFF, I. S., ERISMAN, A. M., AND REID, J. K. 1990. Direct Method for Sparse Matrices. Oxford Science Publications, Kingston, Ontario, Canada.
[20]
DUFF, I. S., GRIMES, R. G., AND LEWIS, J. G. 1989. Sparse matrix test problems. ACM Trans. Math. Softw. 15, 1 (Mar.), 1-14.
[21]
DUFF, I. S., MARRONE, M., RADICATI, G., AND VITTOLI, C. 1997. Level 3 basic linear algebra subprograms for sparse matrices: A user level interface. ACM Trans. Math. Softw. 23, 3 (Sept.).
[22]
FITZPATRICK, S., CLINT, M., AND KILPATRICK, P. 1995. The automated derivation of sparse implementations of numerical algorithms through program transformation. Tech. Rep. Apr-SF.MC.PLK. Deparment of Computer Science, The Queen's University of Belfast, Belfast, Ireland, UK.
[23]
FITZPATRICK, S., HARMER, W. J., AND BOYLE, J.M. 1994. Deriving efficient parallel implementations of algorithms operating on general sparse matrices using automatic program transformation. In Parallel Processing: ConPar 94--VAPP VI, B. Buchberger and J. Volkert, Eds. Lecture Notes in Computer Science, vol. 854. Springer-Verlag, Berlin, Germany, 148-159.
[24]
GEORGE, A. AND LIU, J. W. H. 1981. Computer Solution of Large Sparse Positive Definite Systems. Prentice Hall Press, Upper Saddle River, NJ.
[25]
KUMAR, V., GRAMA, A., GUPTA, A., AND KARYPIS, G. 1994. Introduction to Parallel Programming. Benjamin-Cummings Publ. Co., Inc., Redwood City, CA.
[26]
LAWSON, C. L., HANSON, R. J., KINCAID, D. R., AND KROGH, F. T. 1979a. Algorithm 539: Basic linear algebra subprograms for FORTRAN usage. ACM Trans. Math. Softw. 5, 3, 324-325.
[27]
LAWSON, C. L., HANSON, R. J., KINCAID, D. R., AND KROGH, F. T. 1979b. Basic linear algebra subprograms for Fortran usage. ACM Trans. Math. Softw. 5, 3, 308-323.
[28]
~STERBY, O. AND ZLATEV, Z. 1983. Direct Methods for Sparse Matrices. Springer Lecture Notes in Computer Science, vol. 157. Springer-Verlag, Berlin, Germany.
[29]
PISSANETSKY, S. 1984. Sparse Matrix Technology. Academic Press Ltd., London, UK.
[30]
SAAD, Y. 1990. SPARSKIT: A basic tool for sparse matrix computations. Tech. Rep. 90-20. RIACS, NASA Ames Research Center, Moffett Field, CA.
[31]
SAAD, Y. AND WIJSHOFF, g. A. a. 1990. Spark: A benchmark package for sparse computations. In Proceedings of the 1990 International Conference on Supercomputing (ICS '90, Amsterdam, The Netherlands, June 11-15). ACM Press, New York, NY, 239-253.
[32]
WIJSHOFF, g. A. a. 1993. Implementing sparse BLAS primitives on concurrent/vector processors: A case study. In Lectures on Parallel Computation, Gibbons, A. and Spirakis, P., Eds. Cambridge International Series on Parallel Computation. Cambridge University Press, New York, NY, 405-437.
[33]
ZIMA, g. AND CHAPMAN, B. 1991. Supercompilers for Parallel and Vector Computers. ACM Press Frontier Series. ACM Press, New York, NY.
[34]
ZLATEV, Z. 1991. Computational Methods for General Sparse Matrices. Kluwer B.V., Deventer, The Netherlands.

Cited By

View all
  • (2024)Compiler Support for Sparse Tensor ConvolutionsProceedings of the ACM on Programming Languages10.1145/36897218:OOPSLA2(275-303)Online publication date: 8-Oct-2024
  • (2022)Compiler Support for Sparse Tensor Computations in MLIRACM Transactions on Architecture and Code Optimization10.1145/354455919:4(1-25)Online publication date: 16-Sep-2022
  • (2010)Specifying and verifying sparse matrix codesACM SIGPLAN Notices10.1145/1932681.186358145:9(249-260)Online publication date: 27-Sep-2010
  • Show More Cited By

Recommendations

Reviews

Jesse Louis Barlow

There is nothing simple about sparse matrix programming. Efficient direct factorization schemes require elimination trees and sophisticated indexing structures, and there are a variety of storage structures. Worse, they are often implemented in Fortran 77, meaning that everything is done with arrays. That makes it quite difficult to do it yourself. The sparse compiler proposed in this paper could be quite a step forward. The user writes a dense matrix code and the compiler makes it into a sparse matrix code in the user's favorite sparse matrix format. Straightforward Fortran declaration structures are used to set up the arrays. The computational results given here are impressive. First, the compiler does a nice job of translating the BLAS routine SGEMV (dense matrix-vector multiply) into a ma t rix-vector multiply routine for band matrices that performs about as well as the band BLAS routine SGBMV. A general sparse matrix-vector routine performs better than the corresponding SPARSEKIT routine AMUX. Similar results are shown for transforming some other matrix operations. The operation that the authors had the most problem with is multiplying the transpose of two matrices. Considerable clever programming was necessary to make this operation efficient. As the authors note, sparse matrix multiplication is to be avoided, but nonetheless this shows that there is more to do in writing sparse compilers. The authors propose two solutions to cases where significant modifications to a dense code are necessary for the compiler to produce efficient sparse code. First, the restructuring capabilities of the compiler should be improved. Second, programmers should adhere to rules about how to structure the program. This second solution means that there will always be something for us to teach people about sparse programming. The first is a more useful solution, which I hope will lead to further results on this subject. This paper holds out promise for those who like developing sophisticated sparse matrix programs, but do not want to be sophisticated sparse matrix programmers. It is quite readable and has a good bibliography.

Access critical reviews of Computing literature here

Become a reviewer for Computing Reviews.

Comments

Please enable JavaScript to view thecomments powered by Disqus.

Information & Contributors

Information

Published In

cover image ACM Transactions on Mathematical Software
ACM Transactions on Mathematical Software  Volume 24, Issue 2
June 1998
99 pages
ISSN:0098-3500
EISSN:1557-7295
DOI:10.1145/290200
Issue’s Table of Contents

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 01 June 1998
Published in TOMS Volume 24, Issue 2

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. compilers
  2. data structure transformations
  3. restructuring compilers
  4. sparse BLAS
  5. sparse matrix computations

Qualifiers

  • Article

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)70
  • Downloads (Last 6 weeks)8
Reflects downloads up to 12 Dec 2024

Other Metrics

Citations

Cited By

View all
  • (2024)Compiler Support for Sparse Tensor ConvolutionsProceedings of the ACM on Programming Languages10.1145/36897218:OOPSLA2(275-303)Online publication date: 8-Oct-2024
  • (2022)Compiler Support for Sparse Tensor Computations in MLIRACM Transactions on Architecture and Code Optimization10.1145/354455919:4(1-25)Online publication date: 16-Sep-2022
  • (2010)Specifying and verifying sparse matrix codesACM SIGPLAN Notices10.1145/1932681.186358145:9(249-260)Online publication date: 27-Sep-2010
  • (2010)Specifying and verifying sparse matrix codesProceedings of the 15th ACM SIGPLAN international conference on Functional programming10.1145/1863543.1863581(249-260)Online publication date: 27-Sep-2010
  • (2009)Automating the generation of composed linear algebra kernelsProceedings of the Conference on High Performance Computing Networking, Storage and Analysis10.1145/1654059.1654119(1-12)Online publication date: 14-Nov-2009
  • (2008)Build to order linear algebra kernels2008 IEEE International Symposium on Parallel and Distributed Processing10.1109/IPDPS.2008.4536183(1-8)Online publication date: Apr-2008
  • (2005)OSKI: A library of automatically tuned sparse matrix kernelsJournal of Physics: Conference Series10.1088/1742-6596/16/1/07116(521-530)Online publication date: 31-Aug-2005
  • (2005) On the conditions necessary for removing abstraction penalties in O O L A L A Concurrency and Computation: Practice and Experience10.1002/cpe.85717:7-8(839-866)Online publication date: 23-Feb-2005
  • (2004)Using AspectJ to separate concerns in parallel scientific Java codeProceedings of the 3rd international conference on Aspect-oriented software development10.1145/976270.976286(122-131)Online publication date: 22-Mar-2004
  • (2004)A MATLAB-Based Code Generator for Sparse Matrix ComputationsProgramming Languages and Systems10.1007/978-3-540-30477-7_19(280-295)Online publication date: 2004

View Options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Login options

Full Access

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media