pllm
SDK
Operators

Projection and rotary variants

Represent fused projections, tensor slices, head widths, and rotary position rules.

PLLM documentationView Markdown ↗

A fused checkpoint tensor remains one linear operation followed by semantic slice operations. This preserves storage identity without teaching a compiler model-specific tensor names. Query width, KV width, head count, and head width are independent shape facts.

rotary_embedding attributes distinguish ordinary RoPE, partial rotary width, multimodal sections, and LongRoPE short/long factors. A compiler must implement the declared variant or report it missing; it cannot silently substitute ordinary full-width RoPE.

Python SDK example

from pathlib import Path

from pllm import lower_model

fixture = Path("crates/pllm-models/tests/fixtures/Phi-4-mini-instruct-cfbefac-config.json")
plan = lower_model(fixture.read_bytes(), batch=1, max_input_tokens=16, max_new_tokens=4)
operations = {operation["id"]: operation for operation in plan.prefill["operations"]}
assert operations["layer.0.q_slice"]["inputs"] == ("layer.0.qkv_linear",)
assert operations["layer.0.rope_q"]["attributes"]["rotary_dimensions"] == 96
assert len(operations["layer.0.rope_q"]["attributes"]["long_factor"]) == 48

API: Python SDK objects and signatures

Run this example from a PLLM source checkout; package installations do not include the pinned Phi-4 fixture. This reads plan records only; support still depends on compiler coverage.

On this page

Loading documentation index…

Search runs locally in this browser.