Architecture#
Public alpha interfaces use the dependency-free ExperimentalAPI annotation.
Selected NF4 operators and Qwen3.5 integrations ship in the installed package;
their explicit opt-ins and compatibility boundaries are documented in
experimental APIs. Benchmarks consume those implementations
and retain fixture preparation, measurements and rejected candidates.
LoRAForge provides LoRA compression, adapter formats, and efficient execution
components. The current API exposes loraforge.ops.qr_factor and
loraforge.compression.refactor_lora / truncate_lora.
loraforge.adapters provides local PEFT I/O, compact export and the file
compression workflow; its configuration rules live in an internal module.
The optional integrations.vllm module activates a pinned vLLM 0.26.0 linear
decode replacement. Framework-independent padded-slot kernels live in
ops/vllm_gemv.py and ops/_vllm_gemv_kernels.py; serving imports remain lazy.
See the vLLM contract for dispatch, ownership and validation limits.
ops.row_shrink and ops.row_expand separately provide BF16 retained-rank
tensor operators with a compact-B layout. They have no serving-framework
dependency and are not yet wired into vLLM. See row operators
for the packed layout, device metadata and graph-lifetime contract.
Package boundaries#
Location |
Responsibility |
|---|---|
|
Spectral refactoring, compact truncation, budget allocation |
|
Adapter structures, scaling, PEFT I/O, versioned manifests |
|
Tensor-level operator contracts and dispatch; Triton implementations |
|
Compact layouts, slot ownership, loading and execution metadata |
|
Thin, optional SGLang and vLLM adapters |
|
Native CUDA/HIP implementations and bindings, shipped for lazy compilation |
|
Public behavior, numerics, lifecycle, and compatibility checks |
|
Reproducible performance programs with documented protocols |
|
Small, complete user workflows |
Entrypoints and integrations depend on the library; tensor operations never import a serving framework. Compression and runtime share operator and adapter contracts rather than reaching into each other’s internals.
Execution contracts#
FlashTSQR remains the default spectral compression backend. Reference implementations serve correctness comparisons; they must not silently replace the accelerated path. Return the backend actually used with operation results.
Factorization handles must own their reflectors and remain valid across later factorizations. Device, stream, workspace lifetime, and concurrent use must have explicit contracts before the first numerical API is published. A module-global last-result field is insufficient for execution metadata.
Compact export stores the retained tensor dimensions. Padding is an explicit compatibility option and cannot be counted as a storage reduction. Preserve adapter scaling independently of the factorization and document its convention.
Core configuration belongs in typed arguments or configuration objects. Framework registration must be repeatable within each worker process and must validate the supported framework version. Plugin discovery does not by itself provide a stable hook for arbitrary operator replacement.