Basis Lab

From a Matrix Multiply to a Forward Pass

A Device Reported as Fully Busy May Be Using One Hundredth of Its Arithmetic

Last timeFilling the Device

Utilisation is the share of time some function was executing, not the share of the device in use. Two passes at 100 per cent can differ a hundred times in output.

Everybody reads one figure first. It is on every dashboard, it is a percentage, and it is called utilisation. After seven lessons on where the time of a pass goes, this one asks what that figure can and cannot say about it.

What it is a percentage of

The vendor's monitoring tool defines the figure in one sentence: the per cent of time over the past sample period during which one or more kernels was executing on the device. A kernel is the vendor's word for a function started on the device. The sample period is between a sixth of a second and a second, depending on the product.

FIG 1The reported utilisation
the figure on the dashboard, shown as a percentage
between a sixth of a second and one second, which is thousands of operations of a pass
It is a share of time. Nothing in it counts workers, sets of units, operations or bytes. The same tool reports a memory figure defined the same way: the share of time during which device memory was being read or written.

A sixth of a second is 7,865 runs of the single-row layer of the last lesson, so the figure is always an average over a great many operations.

The lesson stops here

6 more paragraphs to go

You have read the opening. The rest of the argument, the problems that check whether it landed, and the lines worth keeping at the end all come with a plan.

The first lesson of every course in the library reads the whole way through, free, so you can see exactly what the rest of them are.

See the planThe contents

This is the reading half

Starting the course gives you your own copy of it. Every idea on every page has problems standing under it, marked with a reason rather than a tick, and any sentence you do not believe can be opened and argued with. None of that can happen on a page nobody owns.

The contents

The rest of this course

  1. 01A Forward Pass Is a List of Matrix Multiplies, and You Can Count Each One
  2. 02A Multiply Is Cut Into Tiles So That Each Block of Workers Reuses What It Fetchedopening only
  3. 03A Unit That Only Multiplies Small Matrices Is Worth Eight Times, on the Multiplies That Can Feed Itopening only
  4. 04Halving the Size of a Number Is Worth Exactly Two to Memory and Whatever the Units Say to Arithmeticopening only
  5. 05Every Operation Has a Fixed Cost to Start, and the Small Ones Are Nearly All Startopening only
  6. 06A Run of Small Operations Joined Into One Pass Pays for One Start and One Trip Through Memoryopening only
  7. 07A Multiply Fills the Device Only Above a Certain Batch, and the Batch Can Be Computedopening only
  8. 08A Device Reported as Fully Busy May Be Using One Hundredth of Its Arithmeticyou are here

Read alongside