Model the System Before Building It

Budget the inspection device memory

BOTIE

Combine parameter count times width, batch size times activation bytes, and runtime overhead.
Ready to test
0 passed · 0 failed · 2 not run

An empty floor. Start with the information your machine needs.

Received result

Your answer will arrive here.

Examples, experiments and workspace controls
Live values

Connect a tool's inputs to see what it produces. You can try a branch before connecting it to Result.

Try your own inputs

Use a copy of the example to try your own data. Keep the problem's assumptions in mind, and predict the effect of a change before checking the output. You can also add another branch to compare two ways of doing the calculation.

Start at an output arrow, then click or drag to an input. Drag empty space to pan. Delete removes a selection. Ctrl/Cmd+Z undoes a change.
Context for this challenge

Combine parameter count times width, batch size times activation bytes, and runtime overhead.

Botie must leave room for the model, its intermediate values, and the runtime.

Inspect the component calculation
Add(
  First contribution: Add(
    First contribution: Multiply(
      Value: Parameter count
      Multiplier: Bytes per parameter
    )
    Second contribution: Multiply(
      Value: Batch size
      Multiplier: Activation bytes per example
    )
  )
  Second contribution: Fixed runtime bytes
)
Examples and results
Parameter count
10
Bytes per parameter
4
Batch size
2
Activation bytes per example
8
Fixed runtime bytes
12
Required result
68
Parameter count
10
Bytes per parameter
4
Batch size
8
Activation bytes per example
8
Fixed runtime bytes
12
Required result
116
Try a fresh construction

This clears this draft, including its undo history. Earlier successful attempts stay recorded. Build again without opening hints to record an independent attempt.

Stuck? Inspect a worked construction

The tools below form one possible solution. You can assemble it, follow its signals, and undo that change to return to your own construction.

Assumptions and test precision

The model assumes linear activation scaling and fixed runtime overhead. Actual peak memory and quantised-model quality need measurement. Numerical tests allow a difference of 0.001. Lists and structures must also have the right shape.

Your last tested pieces can start the full construction. An existing draft there keeps its own pieces.

A larger batch consumes the remaining memory

This check uses the pieces from “Subtract the complete allocation from the memory limit”.

BOTIE

Botie has 24 million parameters stored at two bytes each. A batch contains six items, each needing 3 MB of activation memory, and fixed runtime storage needs 10 MB. Find the remaining headroom under an 80 MB limit. All MB quantities here use one million bytes.
Parameter count
24000000
Bytes per parameter
2
Batch size
6
Activation bytes per example
3000000
Fixed runtime bytes
10000000
Memory limit in bytes
80000000

Use a number, text, or an array matching the requested result. For a matrix, put each row in brackets. Saving your prediction runs your current construction on these inputs and checks the earlier examples too.

Build a construction in the workspace above first. This case will test those pieces.

Which term explains the negative headroom for the large original-format batch?

Retain units and signed headroom, then test both peak resource use and task quality after a memory-saving change.

The model assumes linear activation scaling and fixed runtime overhead. Actual peak memory and quantised-model quality need measurement.

Work through the Python challenges →
Continue the courseShould the Prediction Happen Here or on a Server? →
← What Happens When Requests Arrive Together?