TCE-OpMin
Jholewinski (Talk | contribs) (→Source Code) |
(→Contact Info) |
||
Line 75: | Line 75: | ||
=== Contact Info === | === Contact Info === | ||
− | Please contact Albert Hartono ( | + | Please contact Albert Hartono (albert.hartono@gmail.com) for questions. |
=== References === | === References === | ||
<references/> | <references/> |
Revision as of 17:08, 26 March 2014
Contents |
Introduction
The first step in the TCE’s code synthesis process is the transformation of input equations into an equivalent form with minimal operation count. Equations typically range from around ten to over a hundred terms, each involving the contraction of two or more tensors, and most quantum chemical methods involve two or more coupled equations of this type. One of our operation minimization algorithms focuses on the use of single-term optimization (strength reduction or parenthesization), which decomposes multi-tensor contraction operations into a sequence of binary contractions, coupled with a global search of the composite single-term solution space for factorization opportunities. Exhaustive search (for small cases) and a number of heuristics were shown to be effective in minimizing the operation count.
Common subexpression elimination (CSE) is a classical optimization technique used in traditional optimizing compilers to reduce the number of operations, where intermediates are identified that can be computed once and stored for use multiple times later. CSE is routinely used in the manual formulation of quantum chemical methods, but because of the complexity of the equations, it is extremely difficult to explore all possible formulations manually. CSE is a powerful technique that allows the exploration of the much larger algorithmic space than our previous approaches to operation minimization. However, the cost of the search itself grows explosively. We have developed an approach to CSE identification in the context of operation minimization for tensor contraction expressions. The developed approach is shown to be very effective, in that it automatically finds efficient computational forms for challenging tensor equations.
Quantum chemists have proposed domain-specific heuristics for strength reduction and factorization for specific forms of tensor contraction expressions. However, their work does not consider the general form of arbitrary tensor contraction expressions. Approaches to single-term optimizations and factorization of tensor contraction expressions were presented in [1]. Common subexpression identification to enhance single-term optimization is discussed in [2].
Source Code
http://www.cse.ohio-state.edu/~laip/opmin.zip
Requirement
Python version 2.3.4 or higher.
Installation
1. % gunzip opmin.tar.gz
2. % tar –xvf opmin.tar
3. Change the first line in file opmin/bin/opmin to your correct python-shell path. e.g. #! /usr/contrib/bin/python is changed to #! /usr/bin/python
4. Set OPMIN_DIR environment variable to the correct top-level opmin directory. e.g. In TCSH, add the following line in .cshrc file.
setenv OPMIN_DIR /home/myusername/opmin
5. Done! You can start using OpMin now.
Command Line Arguments
% ./bin/opmin -h usage: opmin [options] INFILE... description: Compile shell for operation minimization options: -h, --help show this help message and exit -c, --commonsubexp turn on common subexpression elimination -f, --factorize turn on factorization
Note that you must use –c and –f if you want to use common subexpression and factorization algorithm.
Input Files
Some input equations are available at opmin/example directory.
Output Files
After an input file has been run on OpMin, its output will be generated and written in a file of which name starts with underscore (‘_’).
Example
After running the following command (from opmin directory). % ./bin/opmin –c example/myinput.eq The corresponding output can be found in file example/_myinput.eq.
Contact Info
Please contact Albert Hartono (albert.hartono@gmail.com) for questions.
References
- ↑ Automated Operation Minimization of Tensor Contraction Expressions in Electronic Structure Calculations. Albert Hartono, Alexander Sibiryakov, Marcel Nooijen, Gerald Baumgartner, David E. Bernholdt, So Hirata, Chi-Chung Lam, Russell M. Pitzer, J. Ramanujam, and P. Sadayappan. International Conference on Computational Science (ICCS'05) pages 155-164, May 2005
- ↑ Identifying Cost-Effective Common Subexpressions to Reduce Operation Count in Tensor Contraction Evaluations. Albert Hartono, Qingda Lu, Xiaoyang Gao, Sriram Krishnamoorthy, Marcel Nooijen, Gerald Baumgartner, Venkatesh Choppella, David Bernholdt, Russell Pitzer, J. Ramanujam, Atanas Rountev, and P. Sadayappan. International Conference on Computational Science (ICCS'06) LNCS 3991, pages 267-275, May 2006