SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2509.01624 · ICML · 2025

Q-Sched: Pushing the Boundaries of Few-Step Diffusion Models with Quantization-Aware Scheduling

Diana Marculescu, Natalia Frumkin

arXiv · PDF · Open in the Atlas

Code that ran

8 of 11 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; 8 failures of our instrument; 3 no recorded run), measured 2026-11-24; 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/2509.01624.json · badge: /api/ran/2509.01624.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
enyac-group/q-sched canonical (classifier label)
classifier basis: census
8 ran · 3 no recorded run
FunctionStatusWhere it lives
get_json_content Ran
ran; our contract draft was wrong, not the code
enyac-group/q-sched/src/email_notifs/send_email.py
code served (permissive licence) · get_code("1987befc06c78ee4")
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 json
import tempfile
import os

# Create a temporary JSON file for testing
temp_dir = tempfile.mkdtemp()
json_path = os.path.join(temp_dir, "test.json")

# Write a valid JSON file
test_data = {
    "name": "test",
    "values": [1, 2, 3],
    "nested": {
        "key": "value"
    }
}

with open(json_path, 'w') as f:
    json.dump(test_data, f)

ARGS = {
    "json_path": json_path
}
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 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_module_kohya_state_dict Ran
ran; our contract draft was wrong, not the code
enyac-group/q-sched/src/eval_dataset.py
code served (permissive licence) · get_code("ee47db1d466f595b")
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 dict. 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)

# Construct a dict that mimics a PEFT state dict with LoRA weights
# The function expects items() to work, so it should be dict-like
module = {
    'base_model.model.layer1.lora_A.weight': torch.randn(4, 3),
    'base_model.model.layer1.lora_B.weight': torch.randn(3, 4),
    'base_model.model.layer2.lora_A.weight': torch.randn(5, 4),
    'base_model.model.layer2.lora_B.weight': torch.randn(4, 5),
}

prefix = 'model'
dtype = torch.float32
adapter_name = 'default'

ARGS = {
    'module': module,
    'prefix': prefix,
    'dtype': dtype,
    'adapter_name': adapter_name,
}
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 dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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_token_to_pos_dictionary Ran
ran; our contract draft was wrong, not the code
enyac-group/q-sched/src/metrics/aqmap.py
code served (permissive licence) · get_code("c43e4a5fa8b7873c")
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 dict. 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 numpy as np

class MockToken:
    def __init__(self, text, pos_):
        self.text = text
        self.pos_ = pos_

class MockDoc:
    def __init__(self, tokens):
        self.tokens = tokens
    
    def __iter__(self):
        return iter(self.tokens)

# Create a mock doc with several tokens
tokens = [
    MockToken("The", "DET"),
    MockToken("cat", "NOUN"),
    MockToken("sat", "VERB"),
    MockToken(".", "PUNCT")
]

doc = MockDoc(tokens)

ARGS = {
    "doc": doc
}
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 dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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_images_and_captions Ran
ran; our contract draft was wrong, not the code
enyac-group/q-sched/src/metrics/pickscore.py
code served (permissive licence) · get_code("591b59d216857af5")
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 tempfile
import os
import json
from PIL import Image
import numpy as np

# Create temporary directory structure
temp_dir = tempfile.mkdtemp()
image_folder = os.path.join(temp_dir, "images")
os.makedirs(image_folder, exist_ok=True)

# Create sample images
img1 = Image.new('RGB', (64, 48), color='red')
img2 = Image.new('RGB', (64, 48), color='blue')
img1.save(os.path.join(image_folder, "image1.jpg"))
img2.save(os.path.join(image_folder, "image2.jpg"))

# Create captions JSON file
captions_data = {
    "image1.jpg": "A red square image",
    "image2.jpg": "A blue square image"
}
captions_file = os.path.join(temp_dir, "captions.json")
with open(captions_file, 'w') as f:
    json.dump(captions_data, f)

ARGS = {
    "image_folder": image_folder,
    "captions_file": captions_file
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, numpy — 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
partition Ran
ran; our contract draft was wrong, not the code
enyac-group/q-sched/src/metrics/aqmap.py
code served (permissive licence) · get_code("d60bfded080c331f")
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

# Construct valid arguments for the partition function
sentence = "The quick brown fox jumps over the lazy dog"
noun_phrases = ["quick brown fox", "lazy dog"]

ARGS = {
    "sentence": sentence,
    "noun_phrases": noun_phrases,
}
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
quantize_pipe Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
enyac-group/q-sched/src/eval_dataset.py
code served (permissive licence) · get_code("21e400f44e9a8819")
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 MockPipe. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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 random
import numpy as np

torch.manual_seed(0)
random.seed(0)
np.random.seed(0)

class MockUNet(torch.nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = torch.nn.Linear(4, 4)
    
    def forward(self, x):
        return self.linear(x)

class MockVAE(torch.nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = torch.nn.Linear(4, 4)
    
    def forward(self, x):
        return self.linear(x)

class MockTextEncoder(torch.nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = torch.nn.Linear(4, 4)
    
    def forward(self, x):
        return self.linear(x)

class MockScheduler:
    pass

class MockPipe(torch.nn.Module):
    def __init__(self):
        super().__init__()
        self.unet = MockUNet()
        self.vae = MockVAE()
        self.text_encoder = MockTextEncoder()
        self.scheduler = MockScheduler()
    
    def quantize_unet(self, w_bit=8, a_bit=8, bos=True):
        pass
    
    def set_cuda_graph(self, run_pipeline=False):
        pass
    
    def to(self, device):
        return self
    
    def enable_model_cpu_offload(self):
        pass

class MockArgs:
    def __init__(self):
        self.quant_type = 'fp16'
        self.checkpoint = 'PCM-2Step'
        self.quantized_modules = []
        self.mode = 'sd15'

pipe = MockPipe()
args = MockArgs()

ARGS = {
    'pipe': pipe,
    'args': args
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
diffusers, flux, lcm, numpy, pcm, scipy, sdxl_turbo, torch, torchao, tqdm, w4a4_config — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type MockPipe — a MockPipe output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a MockPipe 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
retrieve_timesteps Ran
ran; our contract draft was wrong, not the code
enyac-group/q-sched/src/lcm/lcm_pipeline.py
pointer only (licence: BSD-3-Clause); the stored copy get_code serves, from krafton-ai/Rare-to-Frequent, is pointer only (licence: NONE) · get_code("0b56680ee1708fee")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (BSD-3-Clause), but get_code serves the stored copy, first harvested from krafton-ai/Rare-to-Frequent, and GitHub detected no licence in that repository when it was checked. 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.

rope Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
enyac-group/q-sched/src/flux/transformer_flux.py
code served (permissive licence) · get_code("2660a25b7c20d6d4")
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 5, dtype family float, shape (2, 3, 2, 1, 2) 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)

# pos: torch.Tensor - should be 2D tensor with shape (batch_size, seq_length)
# The function uses pos.shape to get batch_size and seq_length
# and uses pos.device for device consistency
pos = torch.arange(0, 6, dtype=torch.float32).reshape(2, 3)  # batch_size=2, seq_length=3

# dim: int - must be even (asserted in function)
# Used to calculate scale and in view operations
dim = 4

# theta: int - used as base for computing omega = 1.0 / theta ** scale
theta = 10000

ARGS = {
    "pos": pos,
    "dim": dim,
    "theta": theta,
}
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 5, dtype family float, shape (2, 3, 2, 1, 2) — shape (2, 3, 2, 1, 2) 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
encode_text Not yet run
unverified (harvested, no recorded run)
enyac-group/q-sched/src/metrics/pqmap.py
code served (permissive licence) · get_code("f296a9164f5381b8")
How it ran

no invocation recorded.

load_pipe Not yet run
unverified (harvested, no recorded run)
enyac-group/q-sched/src/eval_dataset.py
code served (permissive licence) · get_code("c779c63a254a3d50")
How it ran

no invocation recorded.

remove_stopwords_and_punctuation Not yet run
unverified (harvested, no recorded run)
enyac-group/q-sched/src/metrics/aqmap.py
code served (permissive licence) · get_code("0f9408250465e7f2")
How it ran

no invocation recorded.

Also present in other papers' code

Of 11 samples lifted from this paper's linked repositories, 11 carry a function identity and 0 do not. Of the 11 distinct functions with an identity, 2 are also present in other papers whose code we hold (2 with at least one paper dated earlier, 0 the same month, 1 later) and 9 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
retrieve_timesteps 46 other papers
32 dated earlier, 11 later, 1 same year, order not determinable, 2 undated
2312.04461 (2023-12)
PhotoMaker: Customizing Realistic Human Photos via Stacked ID Embedding
2402.10491 (2024-02)
Make a Cheap Scaling: A Self-Cascade Diffusion Model for Higher-Resolution Adaptation
2405.18991 (2024-05)
EasyAnimate: High-Performance Video Generation Framework with Hybrid Windows Attention and Reward Backpropagation
and 43 more not named here
get_module_kohya_state_dict 1 other paper
1 dated earlier
2410.07303 (2024-10)
Rectified Diffusion: Straightness Is Not Your Need in Rectified Flow

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

Q-Sched introduces a quantization-aware noise scheduler to few-step diffusion backbones and achieves excellent image fidelity. We find quantization and few-step diffusions to be complementary model compression strategies.

For agents

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

get_harvested_code_for_paper("2509.01624")
get_code_for_paper("2509.01624")
have("2509.01624")

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

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

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

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

Connect an agent — have() is free.