SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2403.02310 · 2024

Taming Throughput-Latency Tradeoff in LLM Inference with Sarathi-Serve

arXiv · PDF · Open in the Atlas

Code that ran

7 of 7 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 2 honoured the contract we drafted, 2 violated it and 0 have no contract verdict; 3 failures of our instrument; 0 no recorded run), measured 2026-11-22; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2403.02310.json · badge: /api/ran/2403.02310.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
microsoft/sarathi-serve canonical (classifier label)
classifier basis: census
7 ran · 0 no recorded run
FunctionStatusWhere it lives
convert_pyslice_to_tensor Ran
ran, honoured the contract we drafted
microsoft/sarathi-serve/sarathi/model_executor/weight_utils.py
code served (permissive licence) · get_code("68ee0f6ef8eb5004")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 2, dtype family float, shape (2, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# The function expects either a torch.Tensor or an object that supports
# indexing (like PySafeSlice). We'll test both cases.

# Case 1: A torch.Tensor (should be returned as-is)
tensor_input = torch.randn(2, 4)

# Case 2: A mock PySafeSlice object that supports indexing
class MockPySafeSlice:
    """Mock object simulating safetensors.PySafeSlice with indexing support"""
    def __init__(self, data):
        self.data = data
    
    def __getitem__(self, key):
        # Supports indexing and returns the full tensor when sliced with [:]
        return self.data[key]

# Create a mock PySafeSlice instance
mock_safe_slice = MockPySafeSlice(torch.randn(2, 4))

# Test with tensor input
ARGS = {
    "x": tensor_input
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float, shape (2, 4) — shape (2, 4) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_lock Ran
ran; our contract draft was wrong, not the code
microsoft/sarathi-serve/sarathi/model_executor/weight_utils.py
code served (permissive licence) · get_code("75f9e29d6669a2b6")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned UnixFileLock. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import os
import filelock
from typing import Optional

# The function get_lock takes two parameters:
# - model_name_or_path: str (required)
# - cache_dir: Optional[str] (optional, defaults to None)

# Reading the function body:
# - model_name_or_path is used with .replace('/', '-') to create a lock file name
# - cache_dir is used in a conditional check (if cache_dir is not None else '/tmp')
# - The function creates a FileLock with os.path.join(lock_dir, lock_file_name)

# Construct valid arguments
model_name = "bert-base-uncased"
cache_directory = "/tmp/model_cache"

ARGS = {
    "model_name_or_path": model_name,
    "cache_dir": cache_directory
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
filelock — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type UnixFileLock — a UnixFileLock output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a UnixFileLock output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
init_logger Ran
ran; our contract draft was wrong, not the code
microsoft/sarathi-serve/sarathi/logger.py
code served (permissive licence) · get_code("197a0f338024eca9")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Logger. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import logging

def init_logger(name: str):
    return logging.getLogger(name)

ARGS = {
    "name": "test_logger"
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Logger — a Logger output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Logger output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
pad_to_alignment Ran
ran, violated the contract we drafted
microsoft/sarathi-serve/sarathi/model_executor/utils.py
code served (permissive licence) · get_code("43e0fdf0b69f6fd5")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 1, dtype family int; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

torch.manual_seed(0)

# Analyze the function:
# - x: List[int] - needs to be a list of integers
# - multiple_of: int - needs to be a positive integer for alignment
# The function pads a list with zeros to align its length to a multiple

ARGS = {
    "x": [1, 2, 3, 4, 5],
    "multiple_of": 8
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family int — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
pad_to_max Ran
ran, violated the contract we drafted
microsoft/sarathi-serve/sarathi/model_executor/utils.py
code served (permissive licence) · get_code("9dcee4f7df3d2300")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 1, dtype family int; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

# Set seed for reproducibility
torch.manual_seed(0)

# Construct arguments for pad_to_max function
# The function takes a list of integers and pads it with zeros to reach max_len

x = [1, 2, 3]  # A list of integers shorter than max_len
max_len = 7    # The target length to pad to

ARGS = {
    "x": x,
    "max_len": max_len
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family int — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
prepare_hf_model_weights Ran
ran; our contract draft was wrong, not the code
microsoft/sarathi-serve/sarathi/model_executor/weight_utils.py
code served (permissive licence) · get_code("04ad4cad55976bc7")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import os
import tempfile
import shutil

# Create a temporary directory with mock model weight files
temp_dir = tempfile.mkdtemp()

# Create a mock .safetensors file
safetensors_file = os.path.join(temp_dir, "model.safetensors")
with open(safetensors_file, 'w') as f:
    f.write("mock safetensors content")

# Create a mock .bin file
bin_file = os.path.join(temp_dir, "pytorch_model.bin")
with open(bin_file, 'w') as f:
    f.write("mock bin content")

# Create a mock training_args.bin file to test filtering
training_args_file = os.path.join(temp_dir, "training_args.bin")
with open(training_args_file, 'w') as f:
    f.write("mock training args")

ARGS = {
    "model_name_or_path": temp_dir,
    "cache_dir": None,
    "use_safetensors": False,
    "fall_back_to_pt": True,
    "revision": None,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
filelock, huggingface_hub, tqdm — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
round_up_to_multiple Ran
ran, honoured the contract we drafted
microsoft/sarathi-serve/sarathi/model_executor/utils.py
code served (permissive licence) · get_code("2748c310c15773c2")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned int, ndim 0, dtype family int, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# The function round_up_to_multiple takes two integer parameters:
# x: an integer to round up
# multiple: the multiple to round up to

# Example values:
x_value = 17
multiple_value = 5

ARGS = {
    "x": x_value,
    "multiple": multiple_value,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type int, ndim 0, dtype family int, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block

Also present in other papers' code

Of 7 samples lifted from this paper's linked repositories, 7 carry a function identity and 0 do not. Of the 7 distinct functions with an identity, 7 are also present in other papers whose code we hold (2 with at least one paper dated earlier, 0 the same month, 7 later) and 0 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
init_logger 5 other papers
1 dated earlier, 4 later
2401.09670 (2024-01)
DistServe: Disaggregating Prefill and Decoding for Goodput-optimized Large Language Model Serving
2404.02015 (2024-04)
MuxServe: Flexible Spatial-Temporal Multiplexing for Multiple LLM Serving
2405.05465 (2024-05)
Vidur: A Large-Scale Simulation Framework For LLM Inference
and 2 more not named here
get_lock 3 other papers
2 dated earlier, 1 later
2309.06180 (2023-09)
Efficient Memory Management for Large Language Model Serving with PagedAttention
2402.14808 (2024-02)
RelayAttention for Efficient Large Language Model Serving with Long System Prompts
2501.14808 (2025-01)
HyGen: Efficient LLM Serving via Elastic Online-Offline Request Co-location
convert_pyslice_to_tensor 1 other paper
1 later
2501.14808 (2025-01)
HyGen: Efficient LLM Serving via Elastic Online-Offline Request Co-location
pad_to_alignment 1 other paper
1 later
2501.14808 (2025-01)
HyGen: Efficient LLM Serving via Elastic Online-Offline Request Co-location
pad_to_max 1 other paper
1 later
2501.14808 (2025-01)
HyGen: Efficient LLM Serving via Elastic Online-Offline Request Co-location
prepare_hf_model_weights 1 other paper
1 later
2501.14808 (2025-01)
HyGen: Efficient LLM Serving via Elastic Online-Offline Request Co-location
round_up_to_multiple 1 other paper
1 later
2501.14808 (2025-01)
HyGen: Efficient LLM Serving via Elastic Online-Offline Request Co-location

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-22.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Each LLM serving request goes through two phases. The first is prefill which processes the entire input prompt and produces the first output token and the second is decode which generates the rest of output tokens, one-at-a-time. Prefill iterations have high latency but saturate GPU compute due to parallel processing of the input prompt. In contrast, decode iterations have low latency but also low compute utilization because a decode iteration processes only a single token per request. This makes batching highly effective for decodes and consequently for overall throughput. However, batching multiple requests leads to an interleaving of prefill and decode iterations which makes it challenging to achieve both high throughput and low latency. We introduce an efficient LLM inference scheduler, Sarathi-Serve, to address this throughput-latency tradeoff. Sarathi-Serve introduces chunked-prefills which splits a prefill request into near equal sized chunks and creates stall-free schedules that adds new requests in a batch without pausing ongoing decodes. Stall-free scheduling unlocks the opportunity to improve throughput with large batch sizes while minimizing the effect of batching on latency. Furthermore, uniform batches in Sarathi-Serve ameliorate the imbalance between iterations resulting in minimal pipeline bubbles. Our techniques yield significant improvements in inference performance across models and hardware under tail latency constraints. For Mistral-7B on single A100 GPUs, we achieve 2.6x higher serving capacity and up to 3.7x higher serving capacity for the Yi-34B model on two A100 GPUs as compared to vLLM. When used with pipeline parallelism on Falcon-180B, Sarathi-Serve provides up to 5.6x gain in the end-to-end serving capacity. The source code for Sarathi-Serve is available at https://github.com/microsoft/sarathi-serve.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2403.02310")
get_code_for_paper("2403.02310")
have("2403.02310")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2403.02310.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2403.02310.svg)](https://syntology.ai/paper/2403.02310)

Connect an agent — have() is free.