Efficient convolution for sparse data on FPGAs
Project description
SparsePixels: Efficient convolution for sparse data on FPGAs
Note: we are actively working on making this usable soon, before integrating into hls4ml (first qkeras with keras2, and then HGQ with keras3), we are also working on a major upgrade with partial paralleliztion and streaming for sparse layers in HLS. stay tuned!!
Installation
With Python 3.10 or 3.11 (for now):
pip install sparsepixels
Getting Started
On the model training in Python, import sparse layers:
from sparsepixels.layers import *
Sparse input reduction:
x_in = keras.Input(shape=(x_train.shape[1], x_train.shape[2], x_train.shape[3]), name='x_in')
x, keep_mask = InputReduce(n_max_pixels=n_max_pixels, threshold=threshold, name='input_reduce')(x_in)
Sparse convolution:
x = QConv2DSparse(filters=1, kernel_size=7, use_bias=True, name='conv1', padding='same', strides=1,
kernel_quantizer=quantizer, bias_quantizer=quantizer)([x, keep_mask])
Sparse pooling:
x, keep_mask = AveragePooling2DSparse(4, name='pool1')([x, keep_mask])
We are working on hls4ml integration that auto parses the sparse layers into HLS.
Documentation
Citation
If you find this useful in your research, please consider citing:
@article{Tsoi:2025nvg,
author = "Tsoi, Ho Fung and Rankin, Dylan and Loncar, Vladimir and Harris, Philip",
title = "{SparsePixels: Efficient Convolution for Sparse Data on FPGAs}",
eprint = "2512.06208",
archivePrefix = "arXiv",
primaryClass = "cs.AR",
month = "12",
year = "2025"
}
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sparsepixels-0.1.1.tar.gz.
File metadata
- Download URL: sparsepixels-0.1.1.tar.gz
- Upload date:
- Size: 82.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4945c26995f828ff122c55830134db631e184920107b2231d387a657896c4163
|
|
| MD5 |
7b6e215df93f9b0d074c889783ab6a2f
|
|
| BLAKE2b-256 |
bf19cbc7c203590eb11f004a8a9c79e92b005ac472207bc5da9b2925cb625686
|
File details
Details for the file sparsepixels-0.1.1-py3-none-any.whl.
File metadata
- Download URL: sparsepixels-0.1.1-py3-none-any.whl
- Upload date:
- Size: 79.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7b233aed8f75188ea8c0bceb39bdcc1bebf166559fda6c1b2be3bd4e2deef89c
|
|
| MD5 |
0a36fe0ee00f0a6d8b9768b855813984
|
|
| BLAKE2b-256 |
004b0d607e698689a3a1c72770f15feaaf51fa7ae8794c79579146693f3f04a1
|