iTranslated by AI

The content below is an AI-generated translation. This is an experimental feature, and may contain errors. View original article
🔢

Understanding HPL: A Mathematical Perspective

に公開
2026/03/09

In this article, I would like to explain the calculations performed during the HPL test, which is commonly used as a benchmark for computers.

Understanding what kind of calculations are performed during the test will help in considering the roles of important HPL parameters such as NB, P-values, and Q-values.

While there are many mathematical formulas, I intend to explain them in an easy-to-understand manner.

What is HPL? Massive Simultaneous Equations and Matrices

HPL is a type of benchmark test used as a performance indicator for many supercomputers. It measures calculation speed by solving massive systems of simultaneous equations.

Massive Simultaneous Equations

If we only describe HPL as "solving massive simultaneous equations," it sounds like a simple test.

Simultaneous equations are a collection of equations with common unknowns, like the ones you learned in junior high school:

\begin{cases} &2x+4y-2z &= &2 \\ &4x+9y-3z &= &8 \\ &-2x-3y+7z &= &10 \end{cases}

HPL solves a super-massive version of this.
For massive cases, there aren't enough letters in the alphabet, so subscripts are used like x_1, x_2, x_3...x_n.

\begin{cases} &2x_1+4x_2-2x_3 &= &2 \\ &4x_1+9x_2-3x_3 &= &8 \\ &-2x_1-3x_2+7x_3 &= &10 \\ &&\vdots \end{cases}

We solve for all x in these massive simultaneous equations.

The Score is the Speed of Calculation Counts

GFLOPS is used for the HPL score. This is an abbreviation for:

  • G (Giga): 1 billion (10^9)
  • FL (Floating-point): Numbers like 1.234 \times 10^5
  • OPS (Operations Per Second): Number of calculations per second

Simply put, it means "how many floating-point calculations could be done per second."

The reason for calculating with floating-point numbers is that almost all scientific and technical calculations (weather forecasting, drug development, physics simulations, etc.) require a massive amount of these calculations.

Anyway, the larger the value, the more amazing, faster, and cooler it is. (That escalated quickly)

Why Represent Them with Matrices?

HPL is about solving simultaneous equations, but the reality is matrix calculation.
Simultaneous equations can be represented by matrices.

\begin{cases} &2x_1+4x_2-2x_3 &= &2 \\ &4x_1+9x_2-3x_3 &= &8 \\ &-2x_1-3x_2+7x_3 &= &10 \end{cases}

If we turn these simultaneous equations into a matrix:

\begin{pmatrix} 2 & 4 & -2 \\ 4 & 9 & -3 \\ -2 & -3 & 7 \end{pmatrix}\begin{pmatrix} x_1 \\ x_2 \\ x_3 \end{pmatrix}= \begin{pmatrix} 2 \\ 8 \\ 10 \end{pmatrix}

This is what it looks like.

The notation is different, but the meaning is exactly the same.
However, representing it as a matrix has the advantage of allowing for ingenuity in calculation.

Furthermore, if we represent the matrix on the left as A, the unknowns as \bold{x}, and the known constants on the right as \bold{b}, it is expressed by the following equation[1].

A\bold{x} = \bold{b}

If A is a small matrix like 3x3, you can solve for x without any tricks. However, when this becomes a massive matrix, it becomes too much brute force without ingenuity.

The strategy is to use the properties of matrices to make them easier to solve before seeking the target x.

Ingenuity Unique to Matrices

This ingenuity requires knowledge of matrices. Specifically, "elementary row operations," "matrix multiplication," and "LU decomposition" are necessary.

If you already know about "elementary row operations" and "matrix multiplication," feel free to skip to LU decomposition.

Elementary Row Operations

In simultaneous equations, you can perform subtraction or addition between rows of equations. Exactly the same thing can be done with matrices.

\begin{cases} &2x_1+4x_2-2x_3 &= &2 &\dotsm &①\\ &4x_1+9x_2-3x_3 &= &8 &\dotsm &②\\ &-2x_1-3x_2+7x_3 &= &10 &\dotsm &③ \end{cases}

For example, subtracting twice the equation ① from ②, or adding ① to ③, makes the equations simpler.

\begin{cases} &2x_1&+4x_2&-2x_3 &= &2 &\dotsm &①\\ &&x_2&+x_3 &= &4 &\dotsm &②'\\ &&x_2&+5x_3 &= &12 &\dotsm &③' \end{cases}

Matrices can also undergo operations like subtracting twice the first row from the second row (r_2-2r_1).

\begin{pmatrix} 2 & 4 & -2 \\ 4 & 9 & -3 \\ -2 & -3 & 7 \end{pmatrix}\xrightarrow{r_2-2r_1, r_3+r_1}\begin{pmatrix} 2 & 4 & -2 \\ 0 & 1 & 1 \\ 0 & 1 & 5 \end{pmatrix}

This is a common occurrence in matrices: when elements become mostly zeros or ones, subsequent calculations (like multiplication mentioned later) become easier.

HPL also frequently uses these transformations when finding \bold{x}.

Matrix Multiplication

Matrix multiplication is the "sum of products of rows and columns." It's easier to understand by looking at it.

As shown below, matrix multiplication is an operation where you take the sum of the products of the rows (horizontal) of the left matrix and the columns (vertical) of the right matrix[2][3].

(3) is easy to understand. The elements of the row of the left matrix and the column of the right are multiplied in order and then added.


From page 11 of "Introduction to Matrices" by the Ministry of Education, Culture, Sports, Science and Technology (MEXT)

Matrix multiplication is arduous to compute. However, if you have used elementary row operations in advance to ensure there are many zeros and ones, you can make the calculations slightly easier.

What is LU Decomposition?

The trick called LU decomposition makes solving for \bold{x} in the following equation simple:

A\bold{x} = \bold{b}

Lower (Lower Triangular Matrix) and Upper (Upper Triangular Matrix)

LU decomposition is the task of splitting a matrix into a lower triangular matrix and an upper triangular matrix.

It is better to look at what lower and upper triangular matrices are. You will likely understand their origins.

\begin{pmatrix} 1 & 0 & 0 & 0\\ a & 1 & 0 & 0\\ b & c & 1 & 0\\ d & e & f & 1 \end{pmatrix}\begin{pmatrix} a & b & c & d\\ 0 & e & f & g\\ 0 & 0 & h & i\\ 0 & 0 & 0 & j \end{pmatrix}

These are matrices where the upper-right or lower-left halves are composed of zeros.

To reiterate, when there are many zeros and ones in a matrix, it becomes easier to calculate. By decomposing it this way, even for a massive matrix, you can simplify the calculation somewhat.

How to Perform LU Decomposition

I would like to illustrate how to perform LU decomposition using a 3x3 matrix.

A = \begin{pmatrix} 2 & 4 & -2 \\ 4 & 9 & -3 \\ -2 & -3 & 7 \end{pmatrix} = LU = \begin{pmatrix} 1 & 0 & 0 \\ 2 & 1 & 0 \\ -1 & 1 & 1 \end{pmatrix}\begin{pmatrix} 2 & 4 & -2 \\ 0 & 1 & 1 \\ 0 & 0 & 4 \end{pmatrix}

Ultimately, a transformation like the one in the equation above is performed.

Actually, once you find either L or U, the other is automatically found, so it is not that difficult.

First, transform A so it becomes U. Make the first column of the second and third rows zero. In this case, subtract twice the first row from the second, and -1 times the first row from the third.

A = \begin{pmatrix} 2 & 4 & -2 \\ 4 & 9 & -3 \\ -2 & -3 & 7 \end{pmatrix} \xrightarrow{r_2-2r_1, r_3-(-r_1)} \begin{pmatrix} 2 & 4 & -2 \\ 0 & 1 & 1 \\ 0 & 1 & 5 \end{pmatrix}

Record the factors used (e.g., "what multiplier was subtracted"). Where do you record them? As elements of the L matrix.
Since we subtracted twice the second row and -1 times the third row, L_{21}=2 and L_{31}=-1.

L = \begin{pmatrix} 1 & 0 & 0 \\ L_{21} & 1 & 0 \\ L_{31} & L_{32} & 1 \end{pmatrix} = \begin{pmatrix} 1 & 0 & 0 \\ 2 & 1 & 0 \\ -1 & L_{32} & 1 \end{pmatrix}

The only thing left is L_{32}, which can be found with r_3-r_2. This becomes the U matrix.

\begin{pmatrix} 2 & 4 & -2 \\ 0 & 1 & 1 \\ 0 & 1 & 5 \end{pmatrix} \xrightarrow{r_3-r_2} \begin{pmatrix} 2 & 4 & -2 \\ 0 & 1 & 1 \\ 0 & 0 & 4 \end{pmatrix}

Furthermore, we see that L_{32}=1, and L is found[4].

L =\begin{pmatrix} 1 & 0 & 0 \\ 2 & 1 & 0 \\ -1 & 1 & 1 \end{pmatrix}

LU decomposition is now complete. You can see that multiplying the matrices actually returns the original matrix.

LU = \begin{pmatrix} 1 & 0 & 0 \\ 2 & 1 & 0 \\ -1 & 1 & 1 \end{pmatrix}\begin{pmatrix} 2 & 4 & -2 \\ 0 & 1 & 1 \\ 0 & 0 & 4 \end{pmatrix} = \begin{pmatrix} 2 & 4 & -2 \\ 4 & 9 & -3 \\ -2 & -3 & 7 \end{pmatrix} = A

Actual Solution Method

I will explain the calculations actually performed in HPL.

A\bold{x} = \bold{b}

We solve this for \bold{x}. I will use a 3x3 matrix for illustration.

\begin{pmatrix} 2 & 4 & -2 \\ 4 & 9 & -3 \\ -2 & -3 & 7 \end{pmatrix}\begin{pmatrix} x_1 \\ x_2 \\ x_3 \end{pmatrix}= \begin{pmatrix} 2 \\ 8 \\ 10 \end{pmatrix}

LU Decomposition

First, perform LU decomposition on A.

A = \begin{pmatrix} 2 & 4 & -2 \\ 4 & 9 & -3 \\ -2 & -3 & 7 \end{pmatrix} = \begin{pmatrix} 1 & 0 & 0 \\ 2 & 1 & 0 \\ -1 & 1 & 1 \end{pmatrix}\begin{pmatrix} 2 & 4 & -2 \\ 0 & 1 & 1 \\ 0 & 0 & 4 \end{pmatrix}

Please compute this carefully.

Intermediate Vector \bold{y}

It cannot be solved as is, so we introduce another twist.

Set U\bold{x} = \bold{y}. Then:

LU\bold{x} = \bold{b} \\ L\bold{y} = \bold{b}

\bold{y} has appeared suddenly, but since L is a lower triangular matrix, \bold{y} can be found immediately. Looking at the actual elements, it is clear that y_1 is 2.

\begin{pmatrix} 1 & 0 & 0 \\ 2 & 1 & 0 \\ -1 & 1 & 1 \end{pmatrix}\begin{pmatrix} y_1 \\ y_2 \\ y_3 \end{pmatrix} = \begin{pmatrix} 2 \\ 8 \\ 10 \end{pmatrix}

Once x_1 is known, we can find x_2=4 from the second row. Furthermore, once x_1 and x_2 are known, x_3 can also be found.

This example only goes up to three rows, but this method can be used to solve much larger matrices.

\bold{y} = \begin{pmatrix} 2 \\ 4 \\ 8 \end{pmatrix}

Finding \bold{x}

Thanks to the lower triangular matrix, \bold{y} was easily obtained.

Originally, \bold{y} was defined by U\bold{x} = \bold{y}. With \bold{y} found, we can now find \bold{x}.

\begin{pmatrix} 2 & 4 & -2 \\ 0 & 1 & 1 \\ 0 & 0 & 4 \end{pmatrix}\begin{pmatrix} x_1 \\ x_2 \\ x_3 \end{pmatrix}= \begin{pmatrix} 2 \\ 4 \\ 8 \end{pmatrix}

Now, we can find x_n by moving from the bottom row up to the top row.

x = \begin{pmatrix} -1 \\ 2 \\ 2 \end{pmatrix}

By using the matrix-specific trick of LU decomposition, we were able to find \bold{x}.

Verify Accuracy Before Generating Score

In the example above, we calculated using integers, but actual HPL uses floating-point numbers. Because of computer number systems, calculations with floating-point numbers can lead to errors.

Therefore, we verify if the obtained \bold{x} is correct before outputting the score.

Determining accuracy is simple: we solve the following equation:

A\bold{x} - \bold{b} \thickapprox 0

Continued

This article introduced the mathematical concepts and techniques used in HPL calculations. There are still other calculations performed during HPL, but this covers the mathematical logic.

脚注
  1. \bold{x} and \bold{b} are both vector quantities. You don't need to worry about this for now, but whether they are vectors is an important concept. Vectors are denoted using bold text like \bold{x} or using arrows like \overrightarrow{x}. In this article, I use bold text, which is less distracting, to make it easier for people who are not used to scalar or vector quantities. ↩︎

  2. In normal multiplication, a×b and b×a yield the same result, but for matrices, the order of multiplication changes the result. A multiplication like A·B is called "multiplying B by A from the left." ↩︎

  3. There are two types of multiplication: the one denoted by "·" is the dot product, and the one denoted by "×" is the cross product. Each yields different meanings and values. Generally, AB refers to A·B (dot product). ↩︎

  4. L can be considered as the record of obtaining U from A. Therefore, you have already found L just by doing this. ↩︎

Discussion