SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2602.10718 · 2026

SnapMLA: Efficient Long-Context MLA Decoding via Hardware-Aware FP8 Quantized Pipelining

Wei Wu, Yifan Zhang, Rui Yang, Xunliang Cai, Zunhai Su, Yulei Qian, Yuchen Xie, Shuhao Hu

arXiv · PDF · Open in the Atlas

Code that ran

9 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; 1 honoured the contract we drafted, 1 violated it and 0 have no contract verdict; 7 failures of our instrument; 1 no recorded run), measured 2026-11-22; 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/2602.10718.json · badge: /api/ran/2602.10718.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
meituan-longcat/SGLang-FluentLLM canonical (classifier label)
classifier basis: census
9 ran · 1 no recorded run
FunctionStatusWhere it lives
async_request_trt_llm Ran
ran; our contract draft was wrong, not the code
meituan-longcat/SGLang-FluentLLM/python/sglang/bench_serving.py
code served (permissive licence) · get_code("d5b639e0aaac30f5")
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 coroutine. 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 json
import sys
import time
import traceback
from dataclasses import dataclass, field
from typing import Any, AsyncGenerator, Dict, List, Optional, Tuple, Union
from unittest.mock import Mock, AsyncMock, MagicMock
import aiohttp
from tqdm.asyncio import tqdm


@dataclass
class RequestFuncInput:
    prompt: str
    api_url: str
    prompt_len: int
    output_len: int
    model: str
    lora_name: str
    extra_request_body: Dict[str, Any]


@dataclass
class RequestFuncOutput:
    generated_text: str = ''
    success: bool = False
    latency: float = 0.0
    ttft: float = 0.0
    itl: List[float] = field(default_factory=list)
    prompt_len: int = 0
    error: str = ''
    output_len: int = 0
    cached_tokens: int = 0


# Create a mock RequestFuncInput
request_func_input = RequestFuncInput(
    prompt="Hello, how are you?",
    api_url="http://localhost:8000/generate_stream",
    prompt_len=5,
    output_len=10,
    model="gpt2",
    lora_name="default",
    extra_request_body={}
)

# Create a mock progress bar (or None)
pbar = None

# Define ARGS dict with all parameters
ARGS = {
    "request_func_input": request_func_input,
    "pbar": pbar
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
aiohttp, tqdm — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type coroutine — a coroutine output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a coroutine 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
contains_formats Ran
ran, violated the contract we drafted
meituan-longcat/SGLang-FluentLLM/benchmark/json_schema/bench_sglang.py
code served (permissive licence) · get_code("c35d5a367cb5def6")
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 bool, ndim 0, dtype family float, 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
import numpy as np
from typing import List

# Construct test arguments for contains_formats function

# Example 1: Simple schema dict with a format that matches
schema_1 = {
    'type': 'string',
    'format': 'email'
}
formats_1 = ['email', 'uuid']

# Example 2: Nested schema dict with format in nested value
schema_2 = {
    'type': 'object',
    'properties': {
        'date_field': {
            'type': 'string',
            'format': 'date'
        }
    }
}
formats_2 = ['date', 'time']

# Example 3: Schema with list containing dicts with formats
schema_3 = {
    'type': 'array',
    'items': [
        {
            'type': 'string',
            'format': 'uri'
        },
        {
            'type': 'integer'
        }
    ]
}
formats_3 = ['uri', 'hostname']

# Example 4: Schema without matching formats
schema_4 = {
    'type': 'string',
    'minLength': 1
}
formats_4 = ['email', 'uuid']

# Use the first example as the main test case
ARGS = {
    'schema': schema_1,
    'formats': formats_1
}
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 bool, ndim 0, dtype family float, 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
format_example Ran
ran; our contract draft was wrong, not the code
meituan-longcat/SGLang-FluentLLM/benchmark/mmlu/bench_sglang.py
code served (permissive licence) · get_code("cd763eaf1ac287e7")
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 str. 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 pandas as pd

# Create a small DataFrame with the structure expected by format_example
# The function expects:
# - Column 0: prompt text
# - Columns 1 to k: answer choices (k columns)
# - Column k+1: the correct answer
# With choices = ['A', 'B', 'C', 'D'], we have k=4 choices

data = {
    0: ["What is 2+2?"],
    1: ["3"],
    2: ["4"],
    3: ["5"],
    4: ["6"],
    5: ["B"]  # The answer is 'B' (which corresponds to choice index 1, value "4")
}

df = pd.DataFrame(data)

ARGS = {
    'df': df,
    'idx': 0,
    'include_answer': True
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
pandas — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
format_subject Ran
ran; our contract draft was wrong, not the code
meituan-longcat/SGLang-FluentLLM/benchmark/mmlu/bench_sglang.py
code served (permissive licence) · get_code("6ab745408cb8648b")
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 str. 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

def format_subject(subject):
    l = subject.split('_')
    s = ''
    for entry in l:
        s += ' ' + entry
    return s

ARGS = {
    'subject': 'machine_learning_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 str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
gen_prompt Ran
ran; our contract draft was wrong, not the code
meituan-longcat/SGLang-FluentLLM/benchmark/mmlu/bench_sglang.py
code served (permissive licence) · get_code("c7131fbea2cbdc2d")
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 str. 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 pandas as pd
import numpy as np

# Create a small DataFrame that matches what the function expects
# The function expects:
# - Column 0: question prompt
# - Columns 1 to k: answer choices (A, B, C, D)
# - Column k+1: correct answer
data = {
    0: ['What is 2+2?', 'What is the capital of France?'],
    1: ['4', 'London'],
    2: ['5', 'Paris'],
    3: ['3', 'Berlin'],
    4: ['6', 'Madrid'],
    5: ['A', 'B']
}

train_df = pd.DataFrame(data)

subject = 'mathematics_basics'
k = 2

ARGS = {
    'train_df': train_df,
    'subject': subject,
    'k': k
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, pandas — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
get_answer_value Ran
ran, honoured the contract we drafted
meituan-longcat/SGLang-FluentLLM/benchmark/multi_chain_reasoning/bench_sglang.py
code served (permissive licence) · get_code("4c13c3bdb761b46c")
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 ast
import re

INVALID = -9999999

def get_answer_value(answer_str):
    answer_str = answer_str.replace(',', '')
    numbers = re.findall('\\d+', answer_str)
    if len(numbers) < 1:
        return INVALID
    try:
        return ast.literal_eval(numbers[-1])
    except SyntaxError:
        return INVALID


ARGS = {
    'answer_str': "The answer is 42"
}
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 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
prepare_extend_inputs_for_correctness_test Ran
ran; our contract draft was wrong, not the code
meituan-longcat/SGLang-FluentLLM/python/sglang/bench_one_batch.py
code served (permissive licence) · get_code("3a75352d80906c13")
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 float; 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 torch.nn as nn

torch.manual_seed(0)

# Create a minimal bench_args object
class BenchArgs:
    def __init__(self):
        self.cut_len = 2

bench_args = BenchArgs()

# Create input_ids: list of tensors, batch_size=2
# Each tensor should have length > cut_len
input_ids = [
    torch.tensor([10, 20, 30, 40]),  # length 4, cut_len=2
    torch.tensor([50, 60, 70, 80])   # length 4, cut_len=2
]

# Create Request objects with fill_ids and prefix_indices attributes
class Request:
    def __init__(self):
        self.fill_ids = []
        self.prefix_indices = None
        self.extend_input_len = None

reqs = [Request(), Request()]

# Create a minimal model_runner with req_to_token_pool
class TokenPool:
    def __init__(self):
        # req_to_token[i, :cut_len] should return prefix indices
        # batch_size=2, some max length >= cut_len
        self.req_to_token = torch.tensor([
            [100, 101, 102, 103],  # tokens for request 0
            [200, 201, 202, 203]   # tokens for request 1
        ])

class ModelRunner:
    def __init__(self):
        self.req_to_token_pool = TokenPool()

model_runner = ModelRunner()

ARGS = {
    "bench_args": bench_args,
    "input_ids": input_ids,
    "reqs": reqs,
    "model_runner": model_runner
}
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 float — 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
remove_prefix Ran
ran; our contract draft was wrong, not the code
meituan-longcat/SGLang-FluentLLM/python/sglang/bench_serving.py
code served (permissive licence) · get_code("f299144b699f3bce")
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 str. 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)

ARGS = {
    "text": "hello_world",
    "prefix": "hello_"
}
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 str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
remove_suffix Ran
ran; our contract draft was wrong, not the code
meituan-longcat/SGLang-FluentLLM/python/sglang/bench_serving.py
code served (permissive licence) · get_code("090d09814ed741be")
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 str. 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)

ARGS = {
    "text": "hello_world",
    "suffix": "_world"
}
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 str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
load_questions Not yet run
unverified (harvested, no recorded run)
meituan-longcat/SGLang-FluentLLM/benchmark/mtbench/bench_sglang.py
code served (permissive licence) · get_code("f5ada5a1db00967b")
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, 5 are also present in other papers whose code we hold (5 with at least one paper dated earlier, 1 the same month, 2 later) and 5 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
format_subject 21 other papers
20 dated earlier, 1 later
2009.03300 (2020-09)
Measuring Massive Multitask Language Understanding
2304.12986 (2023-04)
Measuring Massive Multitask Chinese Understanding
2305.17306 (2023-05)
Chain-of-Thought Hub: A Continuous Effort to Measure Large Language Models' Reasoning Performance
and 18 more not named here
format_example 16 other papers
15 dated earlier, 1 later
2009.03300 (2020-09)
Measuring Massive Multitask Language Understanding
2305.17306 (2023-05)
Chain-of-Thought Hub: A Continuous Effort to Measure Large Language Models' Reasoning Performance
2310.05736 (2023-10)
LLMLingua: Compressing Prompts for Accelerated Inference of Large Language Models
and 13 more not named here
get_answer_value 3 other papers
2 dated earlier, 1 the same month
2312.07104 (2023-12)
SGLang: Efficient Execution of Structured Language Model Programs
2601.18999 (2026-01)
Randomization Boosts KV Caching, Learning Balances Query Load: A Joint Perspective
2602.11683 (2026-02)
THINKROUTER: Efficient Reasoning via Routing Thinking between Latent and Discrete Spaces
contains_formats 1 other paper
1 dated earlier
2312.07104 (2023-12)
SGLang: Efficient Execution of Structured Language Model Programs
gen_prompt 1 other paper
1 dated earlier
2312.07104 (2023-12)
SGLang: Efficient Execution of Structured Language Model Programs

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

While FP8 attention has shown substantial promise in innovations like FlashAttention-3, its integration into the decoding phase of the DeepSeek Multihead Latent Attention (MLA) architecture presents notable challenges. These challenges include numerical heterogeneity arising from the decoupling of positional embeddings, misalignment of quantization scales in FP8 PV GEMM, and the need for optimized system-level support. In this paper, we introduce SnapMLA, an FP8 MLA decoding framework optimized to improve long-context efficiency through the following hardware-aware algorithm-kernel co-optimization techniques: (i) RoPE-Aware Per-Token KV Quantization: Motivated by our analysis of the heterogeneous quantization sensitivity inherent to the MLA KV cache, this approach preserves the RoPE part in high precision. Furthermore, per-token granularity is employed to align with the autoregressive decoding process and maintain quantization accuracy. (ii) Quantized PV Computation Pipeline Reconstruction: Addresses the misalignment of quantization scales in FP8 PV computation caused by the shared KV structure of the MLA. (iii) End-to-End Dataflow Optimization: Establishes an efficient data read-and-write workflow using specialized kernels, ensuring streamlined data flow and improved performance. Extensive experiments on state-of-the-art MLA LLMs show that SnapMLA achieves up to a 1.91× improvement in throughput on long-output decoding workloads while maintaining near-parity benchmark quality compared with the BF16 baseline on the evaluated reasoning and code-generation benchmarks. Code is available at https://github.com/meituan-longcat/SGLang-FluentLLM.

For agents

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

get_harvested_code_for_paper("2602.10718")
get_code_for_paper("2602.10718")
have("2602.10718")

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

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

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

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

Connect an agent — have() is free.