SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2305.18334 · 2023

PQA: Exploring the Potential of Product Quantization in DNN Hardware Acceleration

arXiv · PDF · Open in the Atlas

Code that ran

9 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 8 have no contract verdict; 1 failure 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/2305.18334.json · badge: /api/ran/2305.18334.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
abdelfattah-lab/PQA community (classifier label)
classifier basis not recorded on the link
9 ran · 2 no recorded run
FunctionStatusWhere it lives
generate_layer Ran
ran on a synthesized input
abdelfattah-lab/PQA/analytical_model/layer_params_dimensions_speedup_heatmap.py
code served (permissive licence) · get_code("c6008e7b113c67eb")
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
import torch.nn as nn

torch.manual_seed(0)

ARGS = {
    "channel": 3,
    "dimension": 4
}
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
generate_networks Ran
ran on a synthesized input
abdelfattah-lab/PQA/analytical_model/layer_params_dimensions_speedup_heatmap.py
code served (permissive licence) · get_code("f6368817c0e56f06")
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

torch.manual_seed(0)

ARGS = {
    "lower_ch": 8,
    "upper_ch": 1024,
    "lower_dim": 4,
    "upper_dim": 224,
    "horizontal": [16, 32, 64, 128, 256]
}
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
get_x_from_cnt_draw Ran
ran on a synthesized input
abdelfattah-lab/PQA/analytical_model/speedup_vs_layer_params_different_hardware.py
code served (permissive licence) · get_code("405e2560392db019")
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

NCOLS = 1

def get_x_from_cnt_draw(cnt_draw):
    return cnt_draw // NCOLS

# The function takes a single parameter: cnt_draw
# It performs integer division on cnt_draw by NCOLS
# cnt_draw should be an integer

ARGS = {
    "cnt_draw": 5
}
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_y_from_cnt_draw Ran
ran on a synthesized input
abdelfattah-lab/PQA/analytical_model/speedup_vs_layer_params_different_hardware.py
code served (permissive licence) · get_code("4723272f6b0f68e3")
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)

NCOLS = 1

cnt_draw = 0

ARGS = {
    "cnt_draw": cnt_draw
}
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
map_layer Ran
ran on a synthesized input
abdelfattah-lab/PQA/analytical_model/speedup_vs_layer_params_different_hardware.py
code served (permissive licence) · get_code("7c54b24192509763")
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
import torch.nn as nn

# The function map_layer takes a single parameter 'name' which is an integer key
# It looks up the key in a hardcoded dictionary and returns a string value
# Valid keys are: 0, 6, 7, 12, 13

ARGS = {
    'name': 0
}
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
read_pickle Ran
ran; our contract draft was wrong, not the code
abdelfattah-lab/PQA/analytical_model/mse_vs_latency.py
code served (permissive licence) · get_code("c7497cceeb28ffef")
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 pickle
import tempfile
import os

# Create a temporary directory and file for testing
temp_dir = tempfile.mkdtemp()
pickle_path = os.path.join(temp_dir, "test_data.pkl")

# Create some sample data and pickle it
sample_data = {
    "key1": "value1",
    "key2": [1, 2, 3],
    "key3": {"nested": "dict"}
}

with open(pickle_path, 'wb') as f:
    pickle.dump(sample_data, f)

# Define ARGS with the path to the pickled file
ARGS = {
    "path": pickle_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 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
simulate_layer_on_dla Ran
ran on a synthesized input
abdelfattah-lab/PQA/analytical_model/model.py
code served (permissive licence) · get_code("758642da3310783f")
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 math

# Call manual seed for reproducibility
import torch
torch.manual_seed(0)

# Define ARGS dictionary with all required parameters
ARGS = {
    'FILTER_SHAPE': (3, 5, 7),  # (batch, F_HEIGHT, F_WIDTH)
    'INPUT_SHAPE': (2, 16, 32, 64),  # (batch, channels, height, width)
    'NUM_OUT_CHAN': 32,
    'STRIDES': 2,
    'DATA_TYPE': 8,  # bits per element
    'Cvec': 4,
    'Kvec': 8,
    'Qvec': 4,
    'Wvec': 8,
    'Svec': 2,
    'Lh': 2,
    'Lw': 2,
    'FREQUENCY_DLA': 300000000.0,
    'USE_WINOGRAD': False,
    'USE_CUSTOM_EQUATION': False,
    'M20K_CLBS': 1.5,
    'DSP_CLBS': 2.0,
    'EXTRA_CLBS_DLA': 100.0,
    'ACTUAL_MAX_IN_BITS_PER_SEC': 1000000000.0,
    'MAX_DSPs': 1000,
    'MAX_BRAMs': 500,
}
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
simulate_layer_on_mobile_dla Ran
ran on a synthesized input
abdelfattah-lab/PQA/analytical_model/model.py
code served (permissive licence) · get_code("d547beb110ce56bb")
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 math

ARGS = {
    'FILTER_SHAPE': (1, 3, 3, 64),
    'INPUT_SHAPE': (2, 32, 64, 128),
    'NUM_OUT_CHAN': 64,
    'STRIDES': 1,
    'DATA_TYPE': 'float32',
    'M20K_CLBS': 10,
    'DSP_CLBS': 5,
    'EXTRA_CLBS_DLA': 100,
    'ACTUAL_MAX_IN_BITS_PER_SEC': 1000000,
    'MAX_DSPs': 2000,
    'MAX_BRAMs': 5000,
}
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 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
simulate_layer_on_pq Ran
ran on a synthesized input
abdelfattah-lab/PQA/analytical_model/model.py
code served (permissive licence) · get_code("ee337d44ef3e25fc")
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 math
import torch
import numpy as np

# Analyze the function to determine what values make sense
# The function performs calculations on hardware specs and layer parameters

ARGS = {
    'FILTER_SHAPE': (1, 3, 3),  # (batch, height, width) - typical conv filter
    'INPUT_SHAPE': (2, 8, 16, 16),  # (batch, channels, height, width)
    'STRIDES': (1, 1),  # (height_stride, width_stride)
    'NUM_INPUT_COLS': 256,  # Number of input columns to process
    'NUM_OUT_CHAN': 64,  # Number of output channels
    'NUM_PROTO_LAYER': 4,  # Number of prototype layers
    'PROTO_LENGTH_LAYER': 32,  # Length of prototype per layer
    'NUM_PROTO_VEC': 8,  # Number of prototype vectors
    'PROTO_LENGTH_VEC': 16,  # Length of prototype vector
    'NUM_SUBSPACE_VEC': 16,  # Number of subspace vectors
    'NUM_OUT_VEC': 8,  # Number of output vectors
    'FREQUENCY_PQ': 259000000.0,  # Frequency in Hz
    'MAX_OUT_CHANNEL': 128,  # Maximum output channels
    'PROTO_TABLE_ENTRY': 16,  # Bits per prototype table entry
    'PQ_TABLE_ENTRY': 8,  # Bits per PQ table entry
    'MEM_BITS_PER_UNIT': 20480,  # Memory bits per unit (M20K block size)
    'LIMITED_INTERFACE': False,  # Whether interface is limited
    'DUAL_PORT': True,  # Dual port memory
    'OVERLAPPING_IN_CALC': True,  # Overlapping initialization and calculation
    'L2_DIFF': True,  # L2 difference calculation
    'M20K_CLBS': 870.0,  # M20K CLBs per unit
    'DSP_CLBS': 10.0,  # DSP CLBs per unit
    'ACTUAL_MAX_IN_BITS_PER_SEC': 2e9,  # Max input bits per second
    'MODEL_FREQUENCY': 200000000.0,  # Model frequency in Hz
    'MAX_DSPs': 5000,  # Maximum DSPs available
    'MAX_BRAMs': 800,  # Maximum BRAMs available
}
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
convert_to_heatmap_matrix Not yet run
unverified (harvested, no recorded run)
abdelfattah-lab/PQA/analytical_model/utils/heatmap.py
code served (permissive licence) · get_code("168f624d43ebbd3a")
How it ran

no invocation recorded.

run_on_hardware Not yet run
unverified (harvested, no recorded run)
abdelfattah-lab/PQA/analytical_model/mse_vs_latency.py
code served (permissive licence) · get_code("0345716a406bb238")
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, 1 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 1 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.

FunctionAlso present inEarliest-datedOthers named
read_pickle 1 other paper
1 later
2407.15847 (2024-07)
LLMmap: Fingerprinting For Large Language Models

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

Conventional multiply-accumulate (MAC) operations have long dominated computation time for deep neural networks (DNNs), espcially convolutional neural networks (CNNs). Recently, product quantization (PQ) has been applied to these workloads, replacing MACs with memory lookups to pre-computed dot products. To better understand the efficiency tradeoffs of product-quantized DNNs (PQ-DNNs), we create a custom hardware accelerator to parallelize and accelerate nearest-neighbor search and dot-product lookups. Additionally, we perform an empirical study to investigate the efficiency--accuracy tradeoffs of different PQ parameterizations and training methods. We identify PQ configurations that improve performance-per-area for ResNet20 by up to 3.1$\times$, even when compared to a highly optimized conventional DNN accelerator, with similar improvements on two additional compact DNNs. When comparing to recent PQ solutions, we outperform prior work by $4\times$ in terms of performance-per-area with a 0.6% accuracy degradation. Finally, we reduce the bitwidth of PQ operations to investigate the impact on both hardware efficiency and accuracy. With only 2-6-bit precision on three compact DNNs, we were able to maintain DNN accuracy eliminating the need for DSPs.

For agents

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

get_harvested_code_for_paper("2305.18334")
get_code_for_paper("2305.18334")
have("2305.18334")

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

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

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

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

Connect an agent — have() is free.