Three-dimensional topology optimization solves linear systems with millions of unknowns at every design iteration. Consumer graphics cards run far faster in single than in double precision, and open codes for them mostly address minimum compliance. This educational article presents TOF3D, an open source Python code for density-based topology optimization in single precision on one consumer GPU. It solves four classes of problems: stress constrained minimum compliance, robust minimum compliance against manufacturing errors, compliant mechanisms and bone-like porous infill. The stiffness operator is applied without assembly, and the conjugate gradient method is preconditioned by geometric multigrid. Rounding the element matrix to single precision gave rigid body motions a spurious energy and changed compliances by up to 5.4%. Forming the element products from differences of nodal…
Halving the floating-point precision of an ocean model can make it substantially faster, but whether the rounding errors stay negligible over climate time scales has rarely been tested. We implement single precision in the global ocean-sea-ice model FESOM2 and compare 60-year hindcasts with double-precision controls. A first implementation lost salt steadily, accumulated a heat-content deficit of 129 ZJ, and shifted major ocean fronts. Controlled experiments trace the drift to the tracer update: small increments added to a large salinity value are rounded away, and the increments themselves are biased. Accumulating tracer tendencies and layer thicknesses in 64 bits, and carrying the rounding error of each tracer update into the next, removes the drift for at most 8% additional runtime. Single- and double-precision simulations then differ in heat content and mean state about as much as…
In High-performance Computing the holy grail has been to translate numerical algorithms expressed in mathematical notation into code that performs well across a range of platforms. A variety of portability frameworks have abstracted data layout, parallelization and orchestration from application's view, however, the resulting format is still code that conforms to the idioms of the framework. Additionally, substantial refactoring is typically needed to achieve performance goals. Increasing sophistication of Large Language Models (LLMs) naturally raises the question whether they can be used to make application codes and/or solvers both portable and performant. The obstacle is the lack of correctness guarantee in LLM produced code. In this paper we pose the question differently -- can we start with expressing numerical intent of the code into an immutable core arithmetic component isolated…
We present a software implementation (as a Python package) of approximation schemes for verifying frequency inequalities arising from the quadratic Bendixson criterion for systems of delay equations (with a single delay in the linear part). In applications to dissipative nonlinear autonomous systems, such inequalities ensure global stability. The theoretical foundations of this approach were developed in our related work. In particular, it was shown that the transfer operators involved into the frequency inequalities can be represented as integral operators with bounded kernels of the Hardy--Volterra type. Here, we use this representation to construct approximation schemes based on finite-dimensional truncations of the transfer operators. Examples of using the package are provided.
We propose a new mathematical formalism in which all kinds of tensors and of operations on those tensors are represented as simple function compositions. Tensors are functions from indices to values. An element-wise operation (e.g. an activation function) is a composition with a function applied to values; re-indexing (e.g. reshape, transposition) is a composition with a function applied to indices; and a reduction is a composition with both an index function, mapping each index to several indices, and a reduction operation (e.g. product, sum, max). Combined with tensor stacking, these compositions can represent most interesting kinds of tensors (e.g. dense, jagged, all kinds of sparsity patterns, matrix factorizations), as well as lazy versions of almost every operation available in modern tensor computation frameworks, including einsums between tensors of any kind. Identities between…
We present a novel GPU-accelerated global solver for constrained nonlinear programming (NLP) inspired by the efficient linear bound propagation framework in neural network (NN) verification. Existing work on NN verification, a problem that can be cast as feasibility detection for a nonlinear objective, demonstrated orders-of-magnitude speedups with the linear bound propagation-based framework when compared to traditional solvers. Extending this paradigm to global nonlinear programming requires addressing many challenges: a global constrained NLP solver must effectively exploit all, possibly unstructured, nonlinear constraints to improve the objective, whereas NN verification typically handles simple input box constraints over a well-structured NN and does not directly optimize an objective function. We address these challenges by fully exploiting the linear bounds produced by bound…