MIT Missing Semester · Debugging and Profiling
Optional, 15 min. Use the logging and profiling examples to identify one observation that distinguishes waiting for a worker from spending CPU time in Python.
Client and server clocks may differ. Measure client intervals on one monotonic clock, then correlate gateway events by request ID.
A working gateway and its failure tests. Run one request without concurrency before building a load generator.
Inference Engineering · §1.4.1–1.4.2 pp. 36–38; §4.5 pp. 112–115; §7.4.3 pp. 203–204
Use the printed page numbers. In the supplied PDF, add two to reach the viewer page. Write a prediction for the question below before opening its answer.
Prometheus · histograms · Baseten · Inference Engineering
Optional, 15 min. Use the logging and profiling examples to identify one observation that distinguishes waiting for a worker from spending CPU time in Python.
Instrument admission, queue wait, first content token, inter-token gaps and completion. Compare equal and mixed prompt lengths. Check histogram units.
Record arrival, admission, first content token and last token using the same monotonic clock. Save the output token count.
For arrival 0 ms, first token 150 ms, last token 350 ms and five tokens, TTFT is 150 ms and TPOT is 50 ms.
Emit histogram buckets with matching boundaries. Sum by bucket before estimating p95. Report completed and attempted counts beside the percentile.
If the slowest run looks best, inspect which timed-out requests disappeared from the sample.
Save requests.csv with an attempt ID, status, first-token time, finish time and output count. Record failures even when TTFT is undefined.
A stream has one output token. What goes in the TPOT column?
Leave it undefined. There are zero inter-token intervals. Count the successful completion separately.
Save a latency distribution plus a request count. Explain how excluding timeouts can make p95 look better.