harbor run -t bespokelabs/cpu-decoder-graph-executorharbor download bespokelabs/cpu-decoder-graph-executor/app/reference_executor.py runs transformer-decoder compute graphs on CPU. Write an
executor that computes the same thing faster.
/app/output/executor.py, plus any helper modules placed beside it in
/app/output/./app/output/ is collected and graded. Everything else under /app is reference
material. Grading happens in a separate environment, so your submission must be
self-contained inside /app/output/. Other paths, running processes, and environment
state do not carry over.build_executor(graph_spec: dict,
weights: dict[str, numpy.ndarray],
n_workers: int) -> Callable[[numpy.ndarray], numpy.ndarray]
x of shape (T, d_model), dtype float32, and returns the
final hidden states of shape (T, d_model), dtype float32.graph_spec describes a decoder stack. It contains n_layers, d_model, d_ff,
n_heads, n_kv_heads, head_dim, T, rms_eps, a per-layer list of nodes, and a
final node. Each node has an operation, named inputs, an output name, and a weight name.weights maps every weight name in the spec to a C-contiguous float32 array, plus
rope_cos, rope_sin and attn_mask.n_workers is 8./app/reference_executor.py defines what a correct forward pass is: its module docstring
states the semantics of every node type, and its code is the tie-breaker if anything is
ambiguous. Read it. /app/graph_spec.py builds instances and their weights from an
integer seed.
For every call, output y is compared against the reference's y_ref on the same input.
Both bounds must hold:
$$\max(|y - y_{ref}|) \le 10^{-3}$$
$$\frac{\lVert y - y_{ref} \rVert_F}{\lVert y_{ref} \rVert_F} \le 10^{-3}$$
reference_time / your_time.The sealed instances use the same generator and ranges as the public ones:
d_model |
192, 256 or 384 |
d_ff / d_model |
2.6875 or 4.0, rounded to a multiple of 32 |
n_layers |
16 or 32 |
n_heads |
4 or 8, head_dim = d_model // n_heads |
n_kv_heads |
n_heads, n_heads // 2 or n_heads // 4 |
T |
1, 8 or 32, with 1 drawn half the time |
build_executor must return within 20 seconds per instance. Each call to the returned
callable must finish within 120 seconds. Time spent in build_executor is not included
in the runtime metric.OPENBLAS_NUM_THREADS=OMP_NUM_THREADS=MKL_NUM_THREADS=NUMEXPR_NUM_THREADS=8. The only
third-party Python packages installed are numpy and threadpoolctl.python3 /app/bench.py measures whatever is in /app/output/ against the reference on
the 16 public instances (seeds 0-15). It uses the same protocol, tolerances, and worker
budget as the sealed run. It prints per-instance times, ratios, equivalence errors, and
the geometric mean. python3 /app/bench.py --seeds 0,4,9 restricts it to those seeds.
Public instances are for development only; nothing about them is graded.
A submission scores 0 if any of the following holds:
/app/output/executor.py is missing.