Dr. Michael Lehn

Akademischer Oberrat, Institute of Numerical Mathematics, Ulm University

I am a software engineer and mathematician (Ph.D.) with a background in numerical mathematics, scientific computing, high-performance computing, compiler construction, and low-level systems programming.

Much of my work focuses on understanding and building computational systems across abstraction layers — from numerical algorithms and high-performance implementations to programming languages, compilers, instruction sets, and processor architectures.

Over the years, this has led to several software and teaching projects, including high-performance BLAS implementations, an LLVM-based systems language, a self-hosting compiler, and custom RISC architectures implemented in software and on FPGAs.
 

Selected Software Projects
 

ABC and not-abc

ABC (A Better C) is a small systems programming language and LLVM-based compiler that I developed for teaching programming languages, compilers, memory models, and computer architecture.

The compiler generates LLVM IR and supports native C interoperability using the x86-64 System V ABI. The language is intentionally small enough that students can understand the complete path from source code through compiler-generated code to the underlying machine.

not-abc takes this idea further: it is a self-hosting compiler written in the language itself. The project demonstrates how a complete compiler — including lexical analysis, parsing, symbol tables, code generation, function calls, stack frames, pointers, and dynamic memory management — can be built from surprisingly little machinery.

GEMM: From Pure C to SSE Optimized Micro Kernels

GEMM: From Pure C to SSE Optimized Micro Kernels is a step-by-step tutorial on implementing high-performance matrix multiplication, originally developed as part of my course on scientific and high-performance computing.

Starting with a straightforward implementation in C, it gradually introduces blocking, packing, register-level kernels, and SIMD instructions, showing how an implementation evolves from a direct translation of the mathematical algorithm into a high-performance GEMM.

The main goal is not merely to obtain a fast implementation, but to understand why these transformations are necessary and how they relate to the processor architecture and memory hierarchy.

ulmBLAS

ulmBLAS is listed in Meta Quest's official third-party software notices.

The project is a BLAS implementation developed to explore — and teach — how high-performance numerical linear algebra is implemented on modern processors. Starting from the mathematical formulation of operations such as matrix multiplication, it develops the techniques required for high performance, including cache-aware blocking, packing, SIMD vectorization, and architecture-specific micro-kernels.

On the hardware used for the published benchmarks, its GEMM implementation reaches approximately 97% of Intel MKL's performance, while deliberately keeping the individual optimization steps accessible and understandable.

FLENS

FLENS is a C++ library for numerical linear algebra that I originally developed as part of my doctoral work.

It provides a high-level C++ interface for dense and sparse linear algebra while retaining access to established BLAS and LAPACK functionality. Over time, FLENS also became a platform for experimenting with numerical algorithms, alternative arithmetic types, and implementations of LAPACK routines.

The project reflects a recurring theme in my work: connecting high-level mathematical abstractions with their efficient implementation in C++.

 

ULM Generator

The ULM Generator generates a virtual RISC architecture, assembler, debugger, and documentation from a description of an instruction set architecture.

It is used for experimenting with computer architectures and for teaching how instructions, registers, memory, assembly languages, and compilers fit together.

ULM on ICE

ULM on ICE takes the next step from simulation to actual hardware.

Starting from basic digital logic, a small RISC processor is constructed and implemented on an iCE40 FPGA. Students can therefore follow the path from logic gates to a processor executing programs they compiled themselves.

 

 

Teaching

My teaching spans both undergraduate and graduate courses, from foundational mathematics and numerical analysis to numerical optimization, scientific computing, and high-performance computing.

In particular, I am interested in teaching programming and computer architecture to mathematics students without treating the computer as a black box. Students should not only learn how to use numerical software, but also understand how such software is implemented and why modern hardware influences the design of numerical algorithms.

Some of my teaching projects therefore deliberately cross the usual boundaries between numerical mathematics, programming languages, compilers, and computer architecture.

Selected courses

  • Introduction to High Performance Computing
  • High Performance Computing
  • Numerical Linear Algebra
  • Numerical Analysis
  • Numerical Optimization
  • Numerical Methods for Ordinary Differential Equations
  • Higher Mathematics for Physics and Engineering

 

Background

I received a Master of Science in Applied Mathematics from the University of Southern California (USC) in Los Angeles and a Master of Science (Diplom) in Mathematics with a minor in Business and Economics (Wirtschaftsmathematik) from Ulm University.

I received my Ph.D. in Mathematics (Dr. rer. nat.) from Ulm University in 2008.

Since 2008, I have been with the Institute of Numerical Mathematics at Ulm University, where I currently hold the position of Akademischer Oberrat (Scientific Software Engineer / Senior Lecturer). My official responsibilities explicitly include the development of scientific software, as well as teaching and supervising student projects and theses.

In 2014, I received the Teaching Award of Ulm University for my work on teaching scientific and high-performance computing. In 2026, I received the Lehrbonus of Ulm University.

Contact

Institute of Numerical Mathematics
Ulm University
Helmholtzstraße 20
89081 Ulm, Germany

Room 1.09
Phone: +49 731 50-23534
E-mail: michael.lehn(at)uni-ulm.de

GitHub: michael-lehn