SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2406.06282 · 2024

PowerInfer-2: Fast Large Language Model Inference on a Smartphone

arXiv · PDF · Open in the Atlas

Code that ran

6 of 8 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, 1 violated it and 0 have no contract verdict; 3 failures of our instrument; 2 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/2406.06282.json · badge: /api/ran/2406.06282.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
sjtu-ipads/powerinfer canonical (classifier label)
classifier basis: census
6 ran · 2 no recorded run
FunctionStatusWhere it lives
align_offset Ran
ran, honoured the contract we drafted
sjtu-ipads/powerinfer/smallthinker/get_no_moe_weights_ffn.py
code served (permissive licence) · get_code("d77efe17194a0c90")
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
import numpy as np

# Analyzing the function:
# - offset: int - an integer offset value
# - alignment: int - an integer alignment value
# The function performs alignment calculation and returns an int

ARGS = {
    "offset": 10,
    "alignment": 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 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
get_base_tensor_name Ran
ran; our contract draft was wrong, not the code
sjtu-ipads/powerinfer/smallthinker/convert_lora_to_gguf.py
pointer only (licence: MIT); the stored copy get_code serves, from Shan-HIT/HuoziIME, is pointer only (licence: GPL-3.0) · get_code("2b23d02a693ab3d2")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from Shan-HIT/HuoziIME, and GPL-3.0, as GitHub detects it on that repository, is not in the permissive set Syntology serves inline. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

get_model_architecture Ran
ran; our contract draft was wrong, not the code
sjtu-ipads/powerinfer/smallthinker/convert_hf_to_gguf.py
code served (permissive licence) · get_code("c7d0f19587ecf3b2")
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
from enum import IntEnum

class ModelType(IntEnum):
    TEXT = 1
    MMPROJ = 2

# Test case 1: ModelType.TEXT with text_config architectures
hparams_text = {
    'architectures': ['DefaultArch'],
    'text_config': {
        'architectures': ['TextArch']
    },
    'vision_config': {
        'architectures': ['VisionArch']
    }
}

# Test case 2: ModelType.MMPROJ with vision_config architectures
hparams_mmproj = {
    'architectures': ['DefaultArch'],
    'text_config': {},
    'vision_config': {
        'architectures': ['VisionArch']
    }
}

# Test case 3: ModelType.TEXT without text_config architectures
hparams_no_text_arch = {
    'architectures': ['DefaultArch'],
    'text_config': {},
    'vision_config': {}
}

ARGS = {
    'hparams': hparams_text,
    'model_type': ModelType.TEXT
}
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_activation_weights Ran
ran; our contract draft was wrong, not the code
sjtu-ipads/powerinfer/powerinfer-py/powerinfer/export_split.py
code served (permissive licence) · get_code("5a4b1b633592d2d1")
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
from pathlib import Path
import tempfile
import os

torch.manual_seed(0)

# Create a temporary directory with activation files
temp_dir = tempfile.TemporaryDirectory()
models_base = Path(temp_dir.name)

# Create some dummy activation weight files
activation_data_1 = torch.randn(2, 4)
activation_data_2 = torch.randn(3, 5)
activation_data_3 = torch.randn(2, 6)

torch.save(activation_data_1, models_base / "activation_0.pt")
torch.save(activation_data_2, models_base / "activation_1.pt")
torch.save(activation_data_3, models_base / "activation_2.pt")

# Also create a non-matching file that should be ignored
torch.save(torch.randn(1, 2), models_base / "other_file.pt")
torch.save(torch.randn(1, 2), models_base / "activation_abc.pt")

ARGS = {
    "models_base": models_base,
}
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
looks_like_moe Ran
ran, violated the contract we drafted
sjtu-ipads/powerinfer/smallthinker/get_no_moe_weights_ffn.py
code served (permissive licence) · get_code("4d4ead54109e785e")
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

ARGS = {
    "name": "exps"
}
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 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
split_str_to_n_bytes Ran
ran, honoured the contract we drafted
sjtu-ipads/powerinfer/smallthinker/convert_hf_to_gguf.py
code served (permissive licence) · get_code("084d06902aa98802")
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.

# Analyze the function: split_str_to_n_bytes takes a single string parameter
# and converts it to an integer number of bytes based on suffixes (K, M, G) or numeric values

# The function expects:
# - split_str: a string that either:
#   - ends with 'K' (kilobytes)
#   - ends with 'M' (megabytes)
#   - ends with 'G' (gigabytes)
#   - is purely numeric
#   - otherwise raises ValueError

# Test with a valid input
split_str_input = "10M"

ARGS = {
    "split_str": split_str_input
}
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
handle_metadata Not yet run
unverified (harvested, no recorded run)
sjtu-ipads/powerinfer/smallthinker/convert_llama_ggml_to_gguf.py
pointer only (licence: MIT); the stored copy get_code serves, from Shan-HIT/HuoziIME, is pointer only (licence: GPL-3.0) · get_code("cc924525c5e81162")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from Shan-HIT/HuoziIME, and GPL-3.0, as GitHub detects it on that repository, is not in the permissive set Syntology serves inline. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

load_hparams_from_hf Not yet run
unverified (harvested, no recorded run)
sjtu-ipads/powerinfer/smallthinker/convert_lora_to_gguf.py
code served (permissive licence) · get_code("f0cf088136a25546")
How it ran

no invocation recorded.

Also present in other papers' code

Of 8 samples lifted from this paper's linked repositories, 8 carry a function identity and 0 do not. Of the 8 distinct functions with an identity, 4 are also present in other papers whose code we hold (3 with at least one paper dated earlier, 0 the same month, 4 later) and 4 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
get_base_tensor_name 3 other papers
1 dated earlier, 2 later
2306.00978 (2023-06)
AWQ: Activation-aware Weight Quantization for LLM Compression and Acceleration
2604.14159 (2026-04)
HUOZIIME: An On-Device LLM-enhanced Input Method for Deep Personalization
2609.01315 (2026-09)
A Composable Evaluation System for Reproducible Omni-Modal Foundation Model Evaluation
handle_metadata 3 other papers
1 dated earlier, 2 later
2306.00978 (2023-06)
AWQ: Activation-aware Weight Quantization for LLM Compression and Acceleration
2604.14159 (2026-04)
HUOZIIME: An On-Device LLM-enhanced Input Method for Deep Personalization
2609.01315 (2026-09)
A Composable Evaluation System for Reproducible Omni-Modal Foundation Model Evaluation
split_str_to_n_bytes 2 other papers
1 dated earlier, 1 later
2306.00978 (2023-06)
AWQ: Activation-aware Weight Quantization for LLM Compression and Acceleration
2609.01315 (2026-09)
A Composable Evaluation System for Reproducible Omni-Modal Foundation Model Evaluation
load_hparams_from_hf 1 other paper
1 later
2604.14159 (2026-04)
HUOZIIME: An On-Device LLM-enhanced Input Method for Deep Personalization

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

Large language models (LLMs) on smartphones enable real-time AI assistance and privacy-preserving, offline operation. However, resource constraints of smartphones limit current deployments to small language models (SLMs), significantly compromising their capabilities. This paper introduces PowerInfer-2, a smartphone-based framework that enables fast inference for LLMs exceeding the memory capacity. The key insight is decomposing matrix operations into neuron clusters as the basic processing unit, which enables flexible scheduling and efficient I/O-computation pipelining. PowerInfer-2 leverages this neuron-cluster-based design in both computation and storage. For computation, neuron clusters with dense activations are processed on NPU, while sparse clusters use CPU. The storage engine provides a fine-grained pipeline mechanism that coordinates cluster-level computation and I/O operations, enhanced by a segmented neuron cache to reduce I/O activities. PowerInfer-2 achieves up to a 27.8x speed increase compared to state-of-the-art frameworks. PowerInfer-2 is the first system to serve a 47B LLM on a smartphone, achieving 11.68 tokens/s. Notably, these performance improvements preserve model quality with negligible accuracy degradation.

For agents

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

get_harvested_code_for_paper("2406.06282")
get_code_for_paper("2406.06282")
have("2406.06282")

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

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

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

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

Connect an agent — have() is free.