TU Darmstadt / ULB / TUbiblio

The impact of dynamic data reshaping on adjoint code generation for weakly-typed languages such as Matlab

Willkomm, J. and Bischof, C. H. and Bücker, H. M.
Forth, Shaun and Hovland, Paul D. and Phipps, Eric and Utke, Jean and Walther, Andrea (eds.) (2012):
The impact of dynamic data reshaping on adjoint code generation for weakly-typed languages such as Matlab.
In: Recent Advances in Automatic Differentiation, Berlin, Springer, pp. 127-138, [Book Section]

Abstract

Productivity-oriented programming languages typically emphasize convenience over syntactic rigor. A well-known example is Matlab, which employs a weak type system to allow the user to assign arbitrary types and shapes to a variable, and it provides various shortcuts in programming that result in implicit data reshapings. Examples are scalar expansion, where a scalar is implicitly expanded to a matrix of the appropriate size filled with copies of the scalar value, the use of row vectors in place of column vectors and vice versa, and the automatic expansion of arrays when indices outside of the previously allocated range are referenced. These features need to be addressed at runtime when generating adjoint code, as Matlab does not provide required information about types, shapes and conversions at compile time. This fact, and the greater scope of reshaping possible, is a main distinguishing feature of Matlab compared to traditional programming languages, some of which, e.g. Fortran 90, also support vector expressions. In this paper, in the context of the AdiMAT source transformation tool for Matlab, we develop techniques generally applicable for adjoint code generation in the face of dynamic data reshapings occurring both on the left- and right-hand side of assignments. Experiments show that in this fashion correct adjoint code can be generated also for very dynamic language scenarios at moderate additional cost.

Item Type: Book Section
Erschienen: 2012
Editors: Forth, Shaun and Hovland, Paul D. and Phipps, Eric and Utke, Jean and Walther, Andrea
Creators: Willkomm, J. and Bischof, C. H. and Bücker, H. M.
Title: The impact of dynamic data reshaping on adjoint code generation for weakly-typed languages such as Matlab
Language: English
Abstract:

Productivity-oriented programming languages typically emphasize convenience over syntactic rigor. A well-known example is Matlab, which employs a weak type system to allow the user to assign arbitrary types and shapes to a variable, and it provides various shortcuts in programming that result in implicit data reshapings. Examples are scalar expansion, where a scalar is implicitly expanded to a matrix of the appropriate size filled with copies of the scalar value, the use of row vectors in place of column vectors and vice versa, and the automatic expansion of arrays when indices outside of the previously allocated range are referenced. These features need to be addressed at runtime when generating adjoint code, as Matlab does not provide required information about types, shapes and conversions at compile time. This fact, and the greater scope of reshaping possible, is a main distinguishing feature of Matlab compared to traditional programming languages, some of which, e.g. Fortran 90, also support vector expressions. In this paper, in the context of the AdiMAT source transformation tool for Matlab, we develop techniques generally applicable for adjoint code generation in the face of dynamic data reshapings occurring both on the left- and right-hand side of assignments. Experiments show that in this fashion correct adjoint code can be generated also for very dynamic language scenarios at moderate additional cost.

Title of Book: Recent Advances in Automatic Differentiation
Series Name: Lecture Notes in Computational Science and Engineering
Volume: 87
Place of Publication: Berlin
Publisher: Springer
ISBN: 978-3-642-30022-6
Uncontrolled Keywords: Reverse mode, adjoint code, dynamic data reshaping, scalar expansion, weakly-typed languages, Matlab, ADiMat, source transformation
Divisions: 20 Department of Computer Science > Scientific Computing
20 Department of Computer Science
Date Deposited: 16 May 2013 11:27
Export:
Suche nach Titel in: TUfind oder in Google

Optionen (nur für Redakteure)

View Item View Item