SIMD-accelerated frame stacking. Batched accumulation with reduced memory traffic.
Project description
eastack
SIMD-accelerated frame stacking powered by Ea kernels.
Stack N noisy exposures into a clean result. Signal reinforces, noise cancels by sqrt(N). Useful for astronomy, microscopy, video denoising, or any workflow that averages multiple frames.
Install
pip install eastack
Pre-built wheels include compiled SIMD kernels for Linux x86_64, Linux aarch64, and Windows x86_64.
Usage
import numpy as np
from eastack import stack_mean
# Stack 16 noisy frames into a clean mean
frames = [np.random.rand(1024, 1024).astype(np.float32) for _ in range(16)]
result = stack_mean(frames)
# Also accepts 3D arrays (N, H, W)
data = np.random.rand(16, 1024, 1024).astype(np.float32)
result = stack_mean(data)
API
| Function | Description |
|---|---|
stack_mean(frames) |
Stack and compute mean. Returns f32 array. |
stack(frames) |
Accumulate without dividing. Returns sum. |
frame_stats(data) |
Single-pass (min, max, sum) of a float32 array. |
Low-level kernel access:
| Function | Description |
|---|---|
accumulate_f32x8(acc, frame) |
acc += frame using SIMD |
accumulate_batch4_f32x8(acc, f0, f1, f2, f3) |
4 frames in one pass |
accumulate_batch8_f32x8(acc, f0..f7) |
8 frames in one pass |
scale_f32x8(data, out, factor) |
out = data * factor using SIMD |
How it works
Batched accumulation reduces memory traffic by processing multiple frames per pass over the accumulator:
- Single-frame:
acc += frame— 3N memory transactions per element (read acc, read frame, write acc) repeated N times - Batched (K=8):
acc += f0 + f1 + ... + f7— one acc read/write per 8 frames
The stack() function automatically dispatches: batch8 first, then batch4 for remainder, then singles.
Performance
On 4096x4096 frames (64 MB accumulator, single-threaded):
NumPy streaming (np.add loop) : 119 ms
Ea single-frame (same loop) : 110 ms
Ea batched (8 frames/pass) : 68 ms — 1.76x faster
The speedup grows with frame size because the accumulator exceeds L3 cache — reducing acc traffic has maximum impact in DRAM.
Building from source
EA_BIN=./ea ./build_kernels.sh
pip install -e .
Requirements
- Python 3.9+
- NumPy
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
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 eastack-0.1.0-py3-none-win_amd64.whl.
File metadata
- Download URL: eastack-0.1.0-py3-none-win_amd64.whl
- Upload date:
- Size: 7.6 kB
- Tags: Python 3, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
be1f9f4a20d9e7c33363f7e0b22518520a06cb92468bbb21e97f2971a8486b0d
|
|
| MD5 |
aa2de7bd469aec74795923a65fac342f
|
|
| BLAKE2b-256 |
db2ee842a0a3ac1dedd52978691e5a292117df278c0e2969fb2ecca3181327a2
|
Provenance
The following attestation bundles were made for eastack-0.1.0-py3-none-win_amd64.whl:
Publisher:
publish.yml on petlukk/eastack
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
eastack-0.1.0-py3-none-win_amd64.whl -
Subject digest:
be1f9f4a20d9e7c33363f7e0b22518520a06cb92468bbb21e97f2971a8486b0d - Sigstore transparency entry: 1017318549
- Sigstore integration time:
-
Permalink:
petlukk/eastack@fb092f5c9cc65fbc4c3c6c906a699549ee5f1ceb -
Branch / Tag:
refs/heads/main - Owner: https://github.com/petlukk
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@fb092f5c9cc65fbc4c3c6c906a699549ee5f1ceb -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file eastack-0.1.0-py3-none-manylinux_2_17_x86_64.whl.
File metadata
- Download URL: eastack-0.1.0-py3-none-manylinux_2_17_x86_64.whl
- Upload date:
- Size: 8.7 kB
- Tags: Python 3, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3f6d4eb7d40387b2af49e0ba1fcee91c6e3dae88fb135403d974e03874f1c6b9
|
|
| MD5 |
59d731af7d893c3f72913ec0984b2118
|
|
| BLAKE2b-256 |
e617d9015c02a835e5958d13e2adb09b34e62b571e75af726257c747ef5c8569
|
Provenance
The following attestation bundles were made for eastack-0.1.0-py3-none-manylinux_2_17_x86_64.whl:
Publisher:
publish.yml on petlukk/eastack
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
eastack-0.1.0-py3-none-manylinux_2_17_x86_64.whl -
Subject digest:
3f6d4eb7d40387b2af49e0ba1fcee91c6e3dae88fb135403d974e03874f1c6b9 - Sigstore transparency entry: 1017318607
- Sigstore integration time:
-
Permalink:
petlukk/eastack@fb092f5c9cc65fbc4c3c6c906a699549ee5f1ceb -
Branch / Tag:
refs/heads/main - Owner: https://github.com/petlukk
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@fb092f5c9cc65fbc4c3c6c906a699549ee5f1ceb -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file eastack-0.1.0-py3-none-manylinux_2_17_aarch64.whl.
File metadata
- Download URL: eastack-0.1.0-py3-none-manylinux_2_17_aarch64.whl
- Upload date:
- Size: 9.0 kB
- Tags: Python 3, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
253972f130f25527ed9a4b8caa5434327afb18d6b130052567821163bea620df
|
|
| MD5 |
e4aa70a2aac7e85533fb97d73d81f2fe
|
|
| BLAKE2b-256 |
529f27b189b17c106a9decbf9e6a87addf6d7cc588612f60f13c0920a738b699
|
Provenance
The following attestation bundles were made for eastack-0.1.0-py3-none-manylinux_2_17_aarch64.whl:
Publisher:
publish.yml on petlukk/eastack
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
eastack-0.1.0-py3-none-manylinux_2_17_aarch64.whl -
Subject digest:
253972f130f25527ed9a4b8caa5434327afb18d6b130052567821163bea620df - Sigstore transparency entry: 1017318665
- Sigstore integration time:
-
Permalink:
petlukk/eastack@fb092f5c9cc65fbc4c3c6c906a699549ee5f1ceb -
Branch / Tag:
refs/heads/main - Owner: https://github.com/petlukk
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@fb092f5c9cc65fbc4c3c6c906a699549ee5f1ceb -
Trigger Event:
workflow_dispatch
-
Statement type: