Altifigence Academy

7 / 20 · Concept

Valid flags, tags and flushing

Distinguish numerical zero, bubbles and tokens from another job.

A token carries more than a number

Our reference token contains value, valid, job and k. An invalid token is a bubble. A valid token with value zero is a real matrix operand. The job identifies the transaction; k identifies the reduction term. Wiring fixes the A row and B column for each PE, while the wrapper remembers tile coordinates.

When both inputs are valid, verify equal job and k tags before multiplying. A(0,1)=2 paired with B(0,0)=5 produces ten, but it is not a legitimate term. The matching k=1 pair is two and seven, producing fourteen. Treat tag mismatch as a visible verification error rather than silently discarding it as an ordinary bubble.

Count terms, not clocks

Clear starts acc=0 and count=0. For each matched pair, require k=count, then increment count. Consuming k=K−1 completes the local result immediately after that edge. Bubbles and pauses do not increment count. This simple controller requires ordered k values. Supporting arbitrary order needs a received-term bitmap and duplicate detection.

For K=2, consuming one and five gives acc=5, count=1. A bubble leaves both unchanged. Consuming two and seven with k=1 gives acc=19, count=2 and done. A repeated k=1 is an error even if a downstream consumer has already accepted the result.

Drain and clear have different purposes

The array is not empty when the last boundary input enters. Tokens remain in internal forwarding registers. Keep advancing with invalid boundary inputs until the last PE consumes its final term. During this drain, retain completed accumulators until their results are collected. Starting a new job instead requires clearing accumulator, count, valid and tag state together.

This course's wrapper runs one job at a time. It completes, collects results, clears, then starts again. Overlapping jobs requires additional state or accumulators and an output protocol; tags alone do not provide that capability. Tests must include mismatched tags, missing and repeated terms, residual valid state after clear, and valid zero operands that still increment the term count.

Try it yourself

A K=3 PE consumes k=0 pair (2,4), a bubble, k=1 pair (0,9), and k=2 pair (−1,3). Find acc and count. What if the last job tag mismatches?

Read the explanation

With matching tags, acc=5 and count=3, so the result is complete. The bubble does not count; valid zero does. A mismatched job must raise a verification error and cannot be reported as successful completion.

Your choice applies to this browser. Change it any time using the footer.