Skip to main content

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:

  1. K-out-of-N adapter routing. K-Pool LoRA's claim element, selecting K of N adapter modules per step.
  2. Adapter-gradient elastic buffer. software analog of Infinity claim 2, FIFO buffer of adapter gradients prior to aggregation.
  3. Buffer-convergence aggregation. Infinity claim 4, triggers aggregation when buffer-variance falls below threshold instead of on iteration count.
  4. Phase-correction sideband. Infinity claim 3, 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 prior-art branch; we go through torch.distributed.ProcessGroup directly to keep IP boundaries clean.
  • Not a full-model Infinity instance. This SDK demonstrates the mechanism at adapter granularity. The transport-layer / full-model instantiation is a separate (Phase 2) productization track.
  • Not yet a benchmark. The benchmark protocol is in benchmarks/llama3_8b_lora/.

Install

pip install -e ".[dev,benchmark]"

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

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 aligns with TsugiCinema's 2026-05-22 strategic doctrine: hyperscaler-product revenue as primary path; patents as defensive moat (DD scaffolding plus counter-assertion insurance) rather than offensive enforcement; unified pip install tsugi product wrapping this SDK and the companion tsugiai-mend-sdk at the packaging level.

Status

Pre-alpha. APIs will change without notice until v0.1. Repository is private and counsel-and-internal-only pending coordinated public release with the companion tsugiai-mend-sdk and the unified pip install tsugi product surface.

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

tsugi_kpool-0.1.0.tar.gz (45.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tsugi_kpool-0.1.0-py3-none-any.whl (34.2 kB view details)

Uploaded Python 3

File details

Details for the file tsugi_kpool-0.1.0.tar.gz.

File metadata

  • Download URL: tsugi_kpool-0.1.0.tar.gz
  • Upload date:
  • Size: 45.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for tsugi_kpool-0.1.0.tar.gz
Algorithm Hash digest
SHA256 bf5cf90a42fb6d56616cf49399646b9199e0fd4257e329a7fa92217bef4117f3
MD5 495245b949029f842d64100ebb165498
BLAKE2b-256 4a640ab520909b5413ec9bc73703cfe4825302666f31298b304c1c10aac55494

See more details on using hashes here.

File details

Details for the file tsugi_kpool-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: tsugi_kpool-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 34.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for tsugi_kpool-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 58e4e1c711f9a4604239e75f0e177a8eefffe759a6f69543d77f96636e1a3a33
MD5 d5e7d6784361b3d2bcedcd670423a580
BLAKE2b-256 d6adf411244b067e635aa95bc2ab88df5d60188d589aa1cdd361239bf8fe1ffa

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page