SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2311.11514 · ICML · 2024

HEXGEN: Generative Inference of Large Language Model over Heterogeneous Environment

Beidi Chen, Yang Zhou, Xiaozhe Yao, Binhang Yuan, Youhe Jiang, Ran Yan

arXiv · PDF · Open in the Atlas

Code that ran

3 of 10 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; 0 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 3 failures of our instrument; 7 no recorded run), measured 2026-11-24; 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/2311.11514.json · badge: /api/ran/2311.11514.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
Relaxed-System-Lab/HexGen canonical (classifier label)
classifier basis: classifier_2025
1 ran · 0 no recorded run
relaxed-system-lab/hexgen marked official in Papers with Code
Papers with Code archive
2 ran · 7 no recorded run
FunctionStatusWhere it lives
chunk_batch Ran
ran; our contract draft was wrong, not the code
relaxed-system-lab/hexgen/hexgen/hexgen_core/heterogeneous_pipeline.py
code served (permissive licence) · get_code("0d939562cce3288d")
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. 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 torch

torch.manual_seed(0)

# Create test inputs: a mix of tensors and non-tensor values
# The function iterates through inputs and either chunks tensors or repeats non-tensors
inputs = [
    torch.randn(4, 3),  # A tensor that can be chunked
    torch.randn(4, 5),  # Another tensor
    "non_tensor_value",  # A non-tensor value
]

chunks = 2

ARGS = {
    "inputs": inputs,
    "chunks": chunks,
}
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 — a list 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
forward_step_func Ran
ran; our contract draft was wrong, not the code
Relaxed-System-Lab/HexGen/hexgen/llama/llama_inference.py
code served (permissive licence) · get_code("be32a1cb7f68aa17")
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) and returned Tensor, ndim 2, dtype family float, shape (2, 3) 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
import torch.nn as nn
from typing import Tuple, List

torch.manual_seed(0)

# Create a minimal model that accepts the signature used in forward_step_func
class MinimalModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)
    
    def forward(self, inputs, position_ids=None, inference_params=None):
        # Handle both single tensor and tuple/list of tensors
        if isinstance(inputs, (Tuple, List)):
            # Concatenate inputs if it's a tuple/list
            x = torch.cat(inputs, dim=-1)
        else:
            x = inputs
        return self.linear(x)

# Create minimal inference_params (can be a dict or simple object)
class InferenceParams:
    def __init__(self):
        self.max_seq_len = 10
        self.batch_size = 2

# Create test inputs
inputs = torch.randn(2, 4)  # batch_size=2, feature_dim=4

# Create position_ids
position_ids = torch.arange(4).unsqueeze(0).expand(2, -1)  # shape (2, 4)

# Create model
model = MinimalModel()

# Create inference params
inference_params = InferenceParams()

ARGS = {
    "inputs": inputs,
    "inference_params": inference_params,
    "position_ids": position_ids,
    "model": model
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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, 3) — shape (2, 3) 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
unwrap_model Ran
ran; our contract draft was wrong, not the code
relaxed-system-lab/hexgen/hexgen/hexgen_core/heterogeneous_pipeline.py
code served (permissive licence) · get_code("85b5684d7d73dde9")
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 SimpleModel. 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 torch
import torch.nn as nn
from torch.nn.parallel import DistributedDataParallel

torch.manual_seed(0)

# Create a simple base model
class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)
    
    def forward(self, x):
        return self.linear(x)

# Create base model instance
base_model = SimpleModel()

# Wrap it with DistributedDataParallel (simulating a wrapped model)
# Note: DDP normally requires specific setup, but we can create it with device_ids=[] for CPU testing
try:
    wrapped_model = DistributedDataParallel(base_model, device_ids=[])
except Exception:
    # Fallback: if DDP initialization fails, just use the base model
    wrapped_model = base_model

# Test case 1: single wrapped model
single_model = wrapped_model

# Test case 2: list of models (mixed wrapped and unwrapped)
model_list = [wrapped_model, base_model]

ARGS = {
    "model": single_model,
    "module_instances": (DistributedDataParallel,)
}
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 SimpleModel — a SimpleModel output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a SimpleModel 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
PipelineParallel Not yet run
unverified (harvested, no recorded run)
relaxed-system-lab/hexgen/hexgen/hexgen_core/heterogeneous_pipeline.py
code served (permissive licence) · get_code("c7bc94829fa993b8")
How it ran

no invocation recorded.

delete_ddp_backward_hook Not yet run
unverified (harvested, no recorded run)
relaxed-system-lab/hexgen/hexgen/hexgen_core/heterogeneous_pipeline.py
code served (permissive licence) · get_code("132c20e5030631e6")
How it ran

no invocation recorded.

delete_fsdp_post_backward_hook Not yet run
unverified (harvested, no recorded run)
relaxed-system-lab/hexgen/hexgen/hexgen_core/heterogeneous_pipeline.py
code served (permissive licence) · get_code("d4881cd6a9d551d8")
How it ran

no invocation recorded.

forward_delete_backward_hook Not yet run
unverified (harvested, no recorded run)
relaxed-system-lab/hexgen/hexgen/hexgen_core/heterogeneous_pipeline.py
code served (permissive licence) · get_code("f21a8acd941c3235")
How it ran

no invocation recorded.

post_pipeline_forward Not yet run
unverified (harvested, no recorded run)
relaxed-system-lab/hexgen/hexgen/hexgen_core/heterogeneous_pipeline.py
code served (permissive licence) · get_code("e38a8d0be6c626f6")
How it ran

no invocation recorded.

pre_pipeline_forward Not yet run
unverified (harvested, no recorded run)
relaxed-system-lab/hexgen/hexgen/hexgen_core/heterogeneous_pipeline.py
code served (permissive licence) · get_code("6fc0d1e65a75823d")
How it ran

no invocation recorded.

rewrite_fsdp_forward_no_post_backward Not yet run
unverified (harvested, no recorded run)
relaxed-system-lab/hexgen/hexgen/hexgen_core/heterogeneous_pipeline.py
code served (permissive licence) · get_code("bab49f78b2154c6f")
How it ran

no invocation recorded.

Also present in other papers' code

Of 10 samples lifted from this paper's linked repositories, 10 carry a function identity and 0 do not. Of the 10 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 10 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.

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-24.

Repositories linked to this paper

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

Abstract

Serving generative inference of the large language model is a crucial component of contemporary AI applications. This paper focuses on deploying such services in a heterogeneous and crossdatacenter setting to mitigate the substantial inference costs typically associated with a single centralized datacenter. Towards this end, we propose HEXGEN, a flexible distributed inference engine that uniquely supports the asymmetric partition of generative inference computations over both tensor model parallelism and pipeline parallelism and allows for effective deployment across diverse GPUs interconnected by a fully heterogeneous network. We further propose a sophisticated scheduling algorithm grounded in constrained optimization that can adaptively assign asymmetric inference computation across the GPUs to fulfill inference requests while maintaining acceptable latency levels. We conduct an extensive evaluation to verify the efficiency of HEXGEN by serving the state-of-the-art LLAMA-2 (70B) model. The results suggest that HEX-GEN can choose to achieve up to 2.3× lower latency deadlines or tolerate up to 4× more request rates compared with the homogeneous baseline given the same budget. Our implementation is available at https://github.com/ Relaxed-System-Lab/HexGen.

For agents

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

get_harvested_code_for_paper("2311.11514")
get_code_for_paper("2311.11514")
have("2311.11514")

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

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

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

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

Connect an agent — have() is free.