harbor run -t bespokelabs/cpu-llm-decode-throughputharbor download bespokelabs/cpu-llm-decode-throughputBuild a generation engine that serves the concurrent workload faster while returning the same greedy token ids as the reference engine.
/app/reference/reference_engine.py serves generation requests one at a time on a 12-layer
causal language model (GPT-2 124M geometry, fp32). Its weights and config.json are at
/opt/model.
/app/output/engine.py, plus any module it imports./app/output/ is put on sys.path before your module is loaded.class Engine:
def __init__(self, model_dir: str) -> None: ...
def generate(self, requests: list[dict]) -> list[list[int]]: ...
requests is the whole workload, handed over in one call. Each element is a dict with:
| key | type | range |
|---|---|---|
id |
int |
unique within the call |
prompt_token_ids |
list[int] |
16 to 160 ids, each in $[0, 50257)$ |
max_new_tokens |
int |
4 to 64 |
generate returns a list the same length as requests, in the same order.i is a list[int] of exactly requests[i]["max_new_tokens"] token ids.i is the greedy continuation of prompt i.Your score is the generated-token throughput speedup $S$ of your engine over the reference engine, measured on held-out request sets you never see.
generate() call.Each timed run is a fresh process, pinned to the machine's 8 cores, running as an unprivileged user from a read-only copy of your deliverable. In that process the harness:
Engine(model_dir) with model_dir = "/opt/model",generate once on a small warm-up workload,OMP_NUM_THREADS, MKL_NUM_THREADS, and
OPENBLAS_NUM_THREADS to the core count, and calls torch.set_num_threads with it. Your
engine may change any of that.$HOME, $TMPDIR, and the working directory all point at one empty scratch directory that
is destroyed after the run./app/output/engine.py, an empty one, or one without a working Engine./app/output, or more than 4 GiB there.torch (CPU build), numpy, safetensors./app/output/ is what gets graded; it's the only thing carried over to the grading run./app/reference/, /app/harness/, and /app/data/ are inputs. The grading run reads the
reference engine, harness, and workloads from its own copies, so changes you make to yours
only affect what your local numbers mean./opt/model/ is read-only for everyone./app/data/ holds four dev workloads drawn the same way as the held-out ones.
python3 /app/harness/bench.py
python3 /app/harness/bench.py --draws all
python3 /app/harness/bench.py --draws 2 --limit 32
/app/output/engine.py against the reference on the dev workloads, using the
same protocol, timing boundary, and agreement rule as the grader.