A blazing-fast, minimalist, and researcher-friendly simulation framework for Federated Learning.
Project description
What is BlazeFL?
BlazeFL is a lightweight framework for single-node Federated Learning (FL) simulation that eliminates the trade-off between throughput and reproducibility. By leveraging Python's free-threading architecture, BlazeFL allows for shared-memory execution that bypasses the heavy overhead of inter-process communication (IPC) and serialization.
Architecture overview: Shared-memory execution eliminates serialization/IPC overhead. Isolated RNG streams ensure deterministic results.
Feature Highlights
- 🚀 Zero-Copy Parallelism: Uses thread-based parallelism (PEP 703) to exchange model parameters via shared memory. Achieve up to 3.1x speedup on communication-heavy workloads compared to traditional process-based frameworks.
- 🔄 Bitwise Reproducibility: Guarantees identical results across runs, even with high concurrency. By assigning isolated RNG streams to each client, BlazeFL eliminates non-determinism caused by worker scheduling or completion-order-dependent aggregation.
- 🧩 No Framework Lock-in: Built on Python
Protocols. Integrate your existing PyTorch models and training loops with minimal changes. No rigid inheritance required. - 🍃 Minimalist Stack: Core execution relies only on PyTorch and Python standard libraries. Lightweight, easy to package, and highly portable.
Quick Look
BlazeFL keeps the simulation loop explicit and easy to debug. Here is the core pattern:
# Server-Client interaction is straightforward
while not handler.is_stopped():
# 1. Server: Sample clients and prepare downlink
sampled_clients = handler.sample_clients()
broadcast = handler.downlink_package()
# 2. Client Trainer: Process clients in parallel (Threads/Processes)
trainer.local_process(broadcast, sampled_clients)
uploads = trainer.uplink_package()
# 3. Server: Aggregate uploads
for pack in uploads:
handler.load(pack)
Execution Modes
BlazeFL offers three execution modes to suit your environment:
- Multi-Threaded (Recommended): Best for Python 3.14+ (Free-threading). Zero-copy sharing and minimal overhead.
- Multi-Process: Utilizes separate processes to achieve isolation. Uses shared-memory tensors for efficient parameter exchange.
- Single-Threaded: Simple, sequential execution. Perfect for debugging and initial prototyping.
Robust Reproducibility
Parallel execution often breaks reproducibility due to floating-point rounding differences and global random state interference. BlazeFL solves this with a Generator-Based Strategy:
- Each client is assigned a dedicated RNGSuite.
- Random operations (sampling, shuffling, augmentation) consume these client-isolated generators.
- Results are materialized in a deterministic order, ensuring bitwise-identical aggregation.
[!TIP] To ensure full determinism in vision pipelines, use transforms that accept explicit generators. BlazeFL provides utilities to snapshot and restore these states seamlessly.
Benchmarks
In image classification experiments (CIFAR-10), BlazeFL substantially reduces execution time relative to widely used frameworks. The performance advantage is most pronounced in workloads where parameter exchange is the primary bottleneck.
Installation
uv add blazefl
# Or with reproducibility features
uv add blazefl[reproducibility]
Examples
Contributing
We welcome contributions! Please see our contribution guidelines.
Citation
@misc{azuma2026blazeflfastdeterministicfederated,
title={BlazeFL: Fast and Deterministic Federated Learning Simulation},
author={Kitsuya Azuma and Takayuki Nishio},
year={2026},
eprint={2604.03606},
archivePrefix={arXiv},
primaryClass={cs.LG},
url={https://arxiv.org/abs/2604.03606},
}
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 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 blazefl-3.0.0rc1.tar.gz.
File metadata
- Download URL: blazefl-3.0.0rc1.tar.gz
- Upload date:
- Size: 817.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
67ae9433c7011d29e97af829cd434b6c2f6f4b0badfde22b2b80f5122a2dd5b6
|
|
| MD5 |
70a0359999a7ca07796295345a2cbd31
|
|
| BLAKE2b-256 |
a8b6eaf380aec669ac034a9215ce88a14d8f1c8339ee4a276a6f9b980abb3cd7
|
Provenance
The following attestation bundles were made for blazefl-3.0.0rc1.tar.gz:
Publisher:
publish.yaml on kitsuyaazuma/blazefl
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
blazefl-3.0.0rc1.tar.gz -
Subject digest:
67ae9433c7011d29e97af829cd434b6c2f6f4b0badfde22b2b80f5122a2dd5b6 - Sigstore transparency entry: 1380993808
- Sigstore integration time:
-
Permalink:
kitsuyaazuma/blazefl@398e4113ce9bbf51e49a057649636f9e702b1c9b -
Branch / Tag:
refs/tags/v3.0.0rc1 - Owner: https://github.com/kitsuyaazuma
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yaml@398e4113ce9bbf51e49a057649636f9e702b1c9b -
Trigger Event:
push
-
Statement type:
File details
Details for the file blazefl-3.0.0rc1-py3-none-any.whl.
File metadata
- Download URL: blazefl-3.0.0rc1-py3-none-any.whl
- Upload date:
- Size: 30.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
551c25744a3e1aa9ad35829b9ae58e736ce3d19fffbda32b6217faa230b41044
|
|
| MD5 |
3f18d5893c0b285de0ab703197c8b987
|
|
| BLAKE2b-256 |
5cfb36098574f6eeddacbcb9a06d7bd0c3ed80b7c0b13b32e92c057b2ed333a5
|
Provenance
The following attestation bundles were made for blazefl-3.0.0rc1-py3-none-any.whl:
Publisher:
publish.yaml on kitsuyaazuma/blazefl
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
blazefl-3.0.0rc1-py3-none-any.whl -
Subject digest:
551c25744a3e1aa9ad35829b9ae58e736ce3d19fffbda32b6217faa230b41044 - Sigstore transparency entry: 1380993935
- Sigstore integration time:
-
Permalink:
kitsuyaazuma/blazefl@398e4113ce9bbf51e49a057649636f9e702b1c9b -
Branch / Tag:
refs/tags/v3.0.0rc1 - Owner: https://github.com/kitsuyaazuma
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yaml@398e4113ce9bbf51e49a057649636f9e702b1c9b -
Trigger Event:
push
-
Statement type: