K-Pool LoRA SDK. software analog of TsugiCinema's Infinity provisional at LoRA adapter granularity. Productized from the K-Pool LoRA provisional (US App. 64/060,315) and the Infinity provisional (US App. 64/055,093).
Project description
tsugi-kpool
K-Pool LoRA SDK. Software productization of TsugiCinema Inc.'s K-Pool LoRA provisional (US App. 64/060,315, filed 2026-05-07) and Infinity provisional (US App. 64/055,093, filed 2026-05-01), packaged as a drop-in extension to PyTorch + PEFT for distributed LoRA fine-tuning with measurable straggler-tax recovery on cross-rack training clusters.
What this is
A Python package that wraps PyTorch distributed and PEFT to implement, at LoRA adapter granularity:
- K-out-of-N adapter routing. Selects K of N adapter modules per step.
- Adapter-gradient elastic buffer. FIFO buffer of adapter gradients prior to aggregation.
- Buffer-convergence aggregation. Triggers aggregation when buffer-variance falls below a threshold instead of on iteration count.
- Phase-correction sideband. Low-bandwidth TCP channel between training nodes carrying drift telemetry, parallel to (not displacing) the NCCL gradient data plane.
The public API stays close to peft.LoraConfig + accelerate.Accelerator so adoption friction is minimal.
What this is not
- Not a fork of OpenDiLoCo. The architectural sibling exists but Prime Intellect's open-source orchestration layer is a separate branch; this SDK goes through
torch.distributed.ProcessGroupdirectly. - Not a full-model Infinity instance. This SDK demonstrates the mechanism at adapter granularity. The transport-layer / full-model instantiation is a separate productization track.
Install
pip install tsugi-kpool
Or install the unified surface that bundles this SDK with the companion cross-rack reducer:
pip install tsugi # exposes tsugi.kpool and tsugi.mend
For local development:
pip install -e ".[dev]"
Minimal usage
from tsugi_kpool import KPoolLoraConfig, plesio_init
from transformers import AutoModelForCausalLM
from peft import get_peft_model
model = AutoModelForCausalLM.from_pretrained("meta-llama/Meta-Llama-3-8B")
config = KPoolLoraConfig(
r=16, # standard LoRA rank
lora_alpha=32,
target_modules=["q_proj", "v_proj"],
n_adapters=8, # N
k_active=2, # K-out-of-N per step
sideband_addr="tcp://0.0.0.0:51820", # phase-correction sideband
buffer_convergence_eps=1e-3, # buffer-variance trigger threshold
)
model = get_peft_model(model, config)
plesio_init(model, config) # starts the sideband + aggregator threads
# from here, train as you would any peft+accelerate fine-tune
A runnable shape-demonstration of the full surface is in
examples/minimal_finetune.py. It loads a
gated base model (meta-llama/Meta-Llama-3-8B), so running it end-to-end
requires Hugging Face authentication and a GPU; the SDK wiring it shows
(config, get_peft_model, plesio_init / plesio_shutdown) imports and
constructs on CPU without either. See
docs/benchmark_protocol.md for the
benchmark methodology and docs/architecture.md
for the mechanism description.
License
Apache License, Version 2.0 with its full automatic patent grant. TsugiCinema, Inc. is the Licensor. The Apache-2.0 patent grant in Section 3 extends to TsugiCinema's K-Pool LoRA (US App. 64/060,315) and Infinity (US App. 64/055,093) patent estates AS PRACTICED BY THE SDK CODE AS DISTRIBUTED. See LICENSE for the NOTICE preamble explaining the doctrine and the full Apache-2.0 license text.
The license posture reflects an open-source-first strategy: the SDK ships under Apache-2.0 with a full automatic patent grant for the embodiment as distributed, and is packaged together with the companion tsugi-mend SDK under the unified pip install tsugi product surface.
Status
Pre-Alpha (0.1.1). APIs are stabilizing and may change before v1.0. Published to PyPI as tsugi-kpool; also reachable through the unified tsugi meta-package as tsugi.kpool.
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 tsugi_kpool-0.1.1.tar.gz.
File metadata
- Download URL: tsugi_kpool-0.1.1.tar.gz
- Upload date:
- Size: 47.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8cb2d7baf12978354470900a04cfcbf31134549bf2aa56e72e43fda2dd3ede60
|
|
| MD5 |
67b1244efaa21761ba3a257fe74374b4
|
|
| BLAKE2b-256 |
a4709c8aea3b8025d01af4f036bff55c01620cf737d72cda4edf8ea8dc331963
|
Provenance
The following attestation bundles were made for tsugi_kpool-0.1.1.tar.gz:
Publisher:
release.yml on tsugiai/tsugi-kpool
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tsugi_kpool-0.1.1.tar.gz -
Subject digest:
8cb2d7baf12978354470900a04cfcbf31134549bf2aa56e72e43fda2dd3ede60 - Sigstore transparency entry: 1647071994
- Sigstore integration time:
-
Permalink:
tsugiai/tsugi-kpool@ddecd68fb474f584613e624217d8479954721caf -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/tsugiai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@ddecd68fb474f584613e624217d8479954721caf -
Trigger Event:
release
-
Statement type:
File details
Details for the file tsugi_kpool-0.1.1-py3-none-any.whl.
File metadata
- Download URL: tsugi_kpool-0.1.1-py3-none-any.whl
- Upload date:
- Size: 30.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
467ce58173f98c87feefa6c98a4d960c9af46888abbced69cf70fc7528484630
|
|
| MD5 |
662f37711d2c6f855e7f22caf87c43da
|
|
| BLAKE2b-256 |
7d2cdcd0c250c277263489c3f98c26c3b65e12cb6c2c680bf178e19372d8473d
|
Provenance
The following attestation bundles were made for tsugi_kpool-0.1.1-py3-none-any.whl:
Publisher:
release.yml on tsugiai/tsugi-kpool
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tsugi_kpool-0.1.1-py3-none-any.whl -
Subject digest:
467ce58173f98c87feefa6c98a4d960c9af46888abbced69cf70fc7528484630 - Sigstore transparency entry: 1647072051
- Sigstore integration time:
-
Permalink:
tsugiai/tsugi-kpool@ddecd68fb474f584613e624217d8479954721caf -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/tsugiai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@ddecd68fb474f584613e624217d8479954721caf -
Trigger Event:
release
-
Statement type: