S04 · Quantum & Scale · L-16

Online-Softmax Block

Difficulty
expert
Type
generation
Session
Deep
Stack
C++ gcc13-cpp20
Domain
AI Systems
Est. solve
~45 min

01 · The task

Implement one tiled online-softmax attention block from scratch: the streaming block update that keeps softmax numerically stable across tiles. The tensor views, tiling helpers, and attention driver are provided — you write the single block-update function. Checked against a dense reference with tight tolerances, including tiles whose scores overflow a naive implementation.

02 · Constraints

  • Reference math provided

    The math and tiling helpers are given — write the one block.

  • One function

    The change is confined to a single block-update function.

03 · Skills exercised

gpu-free-attentionComputing attention/softmax on CPU with numerically stable tiling.tilingProcessing data in blocks to stay cache- and numerically-friendly.numerical-stabilityArranging computations to avoid overflow, NaNs, and catastrophic rounding.

How to playDaemon

The whole level runs through the local promptly daemon — it pulls the workspace, captures your token usage, tests locally, and submits the ranked run.

  1. Pair this machine

    One-time — approve the code under your devices.

    promptly pair
  2. Pull the workspace

    Downloads the starter kit into the current folder and starts the solve clock.

    promptly init stage-4-16-online-softmax-block
  3. Start the captured session

    Then drive your AI tool — the daemon meters every prompt and token live.

    promptly start stage-4-16-online-softmax-block
  4. Submit for ranked grading

    Runs the full hidden suite and ends the attempt.

    promptly submit

Or combine steps 02–03 into one commandShortcut

promptly play pulls the workspace, launches the daemon, and starts the captured session in a single step — the same as running init then start.

promptly play stage-4-16-online-softmax-block