Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
c936cad
feat(placement): pack several models onto one GPU and price shared la…
krisztian-gajdar Nov 5, 2026
091bb89
chore: merge feat/sie-placement-availability
krisztian-gajdar Nov 5, 2026
62481f7
fix(placement): hold joined lanes to their memory and ask the right r…
krisztian-gajdar Nov 5, 2026
f553e14
chore: merge feat/sie-placement-availability
krisztian-gajdar Nov 5, 2026
e8d0f5e
test(placement): hold shared lanes to the ceilings at maxContainers
krisztian-gajdar Nov 5, 2026
85313d8
fix(placement): put each pinning lane on a named queue pool of its own
krisztian-gajdar Nov 5, 2026
bc48ae5
chore: merge feat/sie-placement-availability
krisztian-gajdar Nov 6, 2026
2601bb6
test(placement): hold a shared lane to the shared quota at its envelo…
krisztian-gajdar Nov 6, 2026
2ec35fa
chore: merge feat/sie-placement-availability
krisztian-gajdar Nov 6, 2026
b8ff7d8
fix(placement): check memory sizes as integers in documents built in …
krisztian-gajdar Nov 6, 2026
cb0ed0a
docs(placement): say a derived queue pool is the slug of the lane name
krisztian-gajdar Nov 6, 2026
84844ba
chore: merge feat/sie-placement-availability
krisztian-gajdar Nov 6, 2026
ed5c652
chore: merge feat/sie-placement-availability
krisztian-gajdar Nov 6, 2026
8676b86
fix(placement): compare kept queue pools without regard to case
krisztian-gajdar Nov 6, 2026
5f3d1a6
docs(placement): say when the planner requests footprints and what a …
krisztian-gajdar Nov 6, 2026
c35ea60
fix(placement): size a shared lane from its residents' demand together
krisztian-gajdar Nov 6, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
218 changes: 172 additions & 46 deletions packages/sie_placement/README.md

Large diffs are not rendered by default.

858 changes: 796 additions & 62 deletions packages/sie_placement/src/sie_placement/planner.py

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions packages/sie_placement/src/sie_placement/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ class ComeAliveBasis(StrEnum):
class Measurement(StrEnum):
RECEIPT = "receipt"
BOOT_EVIDENCE = "boot-evidence"
FOOTPRINT = "footprint"
CO_RESIDENCY_RECEIPT = "co-residency-receipt"


class RequestReason(StrEnum):
Expand Down Expand Up @@ -108,6 +110,7 @@ class Option:
lane: str | None = None
fallback_cells: tuple[Cell, ...] = ()
placement_wait_s: float | None = None
co_residents: tuple[str, ...] = ()

def to_dict(self) -> dict[str, object]:
return _compact(
Expand All @@ -117,6 +120,7 @@ def to_dict(self) -> dict[str, object]:
"containerShape": self.container_shape.to_dict(),
"concurrency": self.concurrency,
"lane": self.lane,
"coResidents": list(self.co_residents) or None,
"warmth": self.warmth.value,
"monthlyCost": _money(self.monthly_cost),
"saving": None if self.saving is None else _money(self.saving),
Expand Down Expand Up @@ -173,6 +177,8 @@ class LaneReport:
envelope_max_monthly_cost: float | None = None
unpriced_reason: str | None = None
unpriced_identities: tuple[str, ...] = ()
memory_mib: int | None = None
memory_limit_mib: float | None = None

@property
def unpriced(self) -> bool:
Expand All @@ -191,6 +197,8 @@ def to_dict(self) -> dict[str, object]:
),
"unpricedReason": self.unpriced_reason,
"unpricedIdentities": list(self.unpriced_identities) or None,
"memoryMiB": self.memory_mib,
"memoryLimitMiB": self.memory_limit_mib,
}
)

Expand Down Expand Up @@ -223,6 +231,7 @@ class MeasurementRequest:
container_shape: ContainerShape | None = None
concurrency: int | None = None
lane: str | None = None
co_residents: tuple[str, ...] = ()

def to_dict(self) -> dict[str, object]:
return _compact(
Expand All @@ -232,6 +241,7 @@ def to_dict(self) -> dict[str, object]:
"containerShape": None if self.container_shape is None else self.container_shape.to_dict(),
"concurrency": self.concurrency,
"lane": self.lane,
"coResidents": list(self.co_residents) or None,
"measure": [measurement.value for measurement in self.measure],
"warmth": self.warmth.value,
"reason": self.reason.value,
Expand Down Expand Up @@ -418,6 +428,7 @@ class Report:
warm_bound_undeclared: tuple[str, ...] = ()
capacity: tuple[CapacityUse, ...] = ()
scarcity: tuple[Scarcity, ...] = ()
gpu_memory_undeclared: tuple[str, ...] = ()

@property
def monthly_cost(self) -> float:
Expand Down Expand Up @@ -462,6 +473,7 @@ def to_dict(self) -> dict[str, object]:
"scarcity": [entry.to_dict() for entry in self.scarcity],
"queueWaitUnattained": list(self.queue_wait_unattained),
"warmBoundUndeclared": list(self.warm_bound_undeclared),
"gpuMemoryUndeclared": list(self.gpu_memory_undeclared),
"refusals": [refusal.to_dict() for refusal in self.refusals],
"changes": {
"identities": [change.to_dict() for change in self.identity_changes],
Expand Down
49 changes: 42 additions & 7 deletions packages/sie_placement/src/sie_placement/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,12 @@ def _string(self, key: str, value: object) -> str:
raise SchemaError(self._at(key), f"expected a string, got {_describe(value)}")
return value

@staticmethod
def text(value: object, path: str) -> str:
if not isinstance(value, str):
raise SchemaError(path, f"expected a string, got {_describe(value)}")
return value

def _boolean(self, key: str, value: object) -> bool:
if not isinstance(value, bool):
raise SchemaError(self._at(key), f"expected a boolean, got {_describe(value)}")
Expand Down Expand Up @@ -631,10 +637,21 @@ class Receipt:
latency: Percentiles | None = None
ttft: Percentiles | None = None
itl: Percentiles | None = None
footprint_mib: int | None = None
working_memory_mib: int | None = None
co_residents: tuple[str, ...] = ()

def __post_init__(self) -> None:
_require_identifier("identity", self.identity)
_require_count("concurrency", self.concurrency, 1)
_require_count("footprintMiB", self.footprint_mib, 1)
_require_count("workingMemoryMiB", self.working_memory_mib, 0)
for index, resident in enumerate(self.co_residents):
_require_identifier(f"coResidents[{index}]", resident)
if resident == self.identity:
raise SchemaError(f"coResidents[{index}]", f"names the receipt's own identity {resident!r}")
if resident in self.co_residents[:index]:
raise SchemaError(f"coResidents[{index}]", f"duplicates {resident!r}")
if self.request_shape.operation is Operation.GENERATE:
_require_absent("latency", self.latency, "for the generate operation, which reports ttft and itl")
if self.ttft is None:
Expand Down Expand Up @@ -667,6 +684,9 @@ def from_dict(cls, data: object, path: str = ROOT_PATH) -> Self:
latency=reader.optional_child("latency", Percentiles.from_dict),
ttft=reader.optional_child("ttft", Percentiles.from_dict),
itl=reader.optional_child("itl", Percentiles.from_dict),
footprint_mib=reader.optional_integer("footprintMiB"),
working_memory_mib=reader.optional_integer("workingMemoryMiB"),
co_residents=reader.children("coResidents", _Reader.text, required=False),
source=reader.child("source", SourceRef.from_dict),
)

Expand All @@ -679,11 +699,14 @@ def to_dict(self) -> dict[str, object]:
"cell": self.cell.to_dict(),
"containerShape": self.container_shape.to_dict(),
"concurrency": self.concurrency,
"coResidents": list(self.co_residents) or None,
"requestShape": self.request_shape.to_dict(),
"throughput": self.throughput.to_dict(),
"latency": None if self.latency is None else self.latency.to_dict(),
"ttft": None if self.ttft is None else self.ttft.to_dict(),
"itl": None if self.itl is None else self.itl.to_dict(),
"footprintMiB": self.footprint_mib,
"workingMemoryMiB": self.working_memory_mib,
"source": self.source.to_dict(),
}
)
Expand All @@ -699,6 +722,7 @@ class BootEvidence:
source: SourceRef
boot_seconds: float | None = None
placement_wait_s: float | None = None
footprint_mib: int | None = None
borrowed: bool = False

def __post_init__(self) -> None:
Expand All @@ -718,6 +742,9 @@ def __post_init__(self) -> None:
raise SchemaError("bootSeconds", "is required for an attempt that was placed")
_require_at_least("placementWaitS", self.placement_wait_s, 0)
_require_at_least("bootSeconds", self.boot_seconds, 0)
_require_count("footprintMiB", self.footprint_mib, 1)
if self.outcome is not BootOutcome.SUCCEEDED:
_require_absent("footprintMiB", self.footprint_mib, "for an attempt that did not succeed")

@classmethod
def from_dict(cls, data: object, path: str = ROOT_PATH) -> Self:
Expand All @@ -732,6 +759,7 @@ def from_dict(cls, data: object, path: str = ROOT_PATH) -> Self:
placement_wait_s=reader.optional_number("placementWaitS"),
boot_seconds=reader.optional_number("bootSeconds"),
outcome=reader.enum("outcome", BootOutcome),
footprint_mib=reader.optional_integer("footprintMiB"),
borrowed=reader.optional_boolean("borrowed") is True,
source=reader.child("source", SourceRef.from_dict),
)
Expand All @@ -748,6 +776,7 @@ def to_dict(self) -> dict[str, object]:
"placementWaitS": self.placement_wait_s,
"bootSeconds": self.boot_seconds,
"outcome": self.outcome.value,
"footprintMiB": self.footprint_mib,
"borrowed": True if self.borrowed else None,
"source": self.source.to_dict(),
}
Expand All @@ -761,13 +790,15 @@ class MachineProfilePrice:
accelerator_per_hour: float
core_per_hour: float
memory_gib_per_hour: float
gpu_memory_mib: int | None = None

def __post_init__(self) -> None:
_require_identifier("name", self.name)
_require_identifier("gpuProduct", self.gpu_product)
_require_at_least("acceleratorPerHour", self.accelerator_per_hour, 0)
_require_at_least("corePerHour", self.core_per_hour, 0)
_require_at_least("memoryGiBPerHour", self.memory_gib_per_hour, 0)
_require_count("gpuMemoryMiB", self.gpu_memory_mib, 1)

@classmethod
def from_dict(cls, data: object, path: str = ROOT_PATH) -> Self:
Expand All @@ -776,19 +807,23 @@ def from_dict(cls, data: object, path: str = ROOT_PATH) -> Self:
cls,
name=reader.string("name"),
gpu_product=reader.string("gpuProduct"),
gpu_memory_mib=reader.optional_integer("gpuMemoryMiB"),
accelerator_per_hour=reader.number("acceleratorPerHour"),
core_per_hour=reader.number("corePerHour"),
memory_gib_per_hour=reader.number("memoryGiBPerHour"),
)

def to_dict(self) -> dict[str, object]:
return {
"name": self.name,
"gpuProduct": self.gpu_product,
"acceleratorPerHour": self.accelerator_per_hour,
"corePerHour": self.core_per_hour,
"memoryGiBPerHour": self.memory_gib_per_hour,
}
return _compact(
{
"name": self.name,
"gpuProduct": self.gpu_product,
"gpuMemoryMiB": self.gpu_memory_mib,
"acceleratorPerHour": self.accelerator_per_hour,
"corePerHour": self.core_per_hour,
"memoryGiBPerHour": self.memory_gib_per_hour,
}
)


@dataclass(frozen=True, slots=True, kw_only=True)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
},
{
"name": "default-l4-default",
"queuePool": "default",
"queuePool": "default-l4-default",
"bundle": "default",
"cell": {
"machineProfile": "l4",
Expand Down Expand Up @@ -65,7 +65,7 @@
},
{
"name": "qwen-qwen3-embedding-4b-l4",
"queuePool": "default",
"queuePool": "qwen-qwen3-embedding-4b-l4",
"bundle": "default",
"cell": {
"machineProfile": "l4",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,15 @@
"memoryMiB": 16384
},
"concurrency": 16,
"coResidents": [
"intfloat/e5-base-v2"
],
"warmth": "pinned",
"monthlyCost": 759.2,
"comeAliveS": 0.0,
"comeAliveBasis": "warm-floor",
"receipt": {
"uri": "receipts/baai-bge-m3/l4-c16-16384.json",
"sha256": "0000000000000000000000000000000000000000000000000000000000000001"
"uri": "receipts/baai-bge-m3/l4-c16-16384-beside-e5-base-v2.json"
}
},
"peakContainers": 1,
Expand Down Expand Up @@ -325,18 +327,7 @@
}
],
"capacity": [],
"sharedChartLanes": [
{
"queuePool": "default",
"machineProfile": "l4",
"bundle": "default",
"lanes": [
"baai-bge-m3-sparse-l4",
"default-l4-default",
"qwen-qwen3-embedding-4b-l4"
]
}
],
"sharedChartLanes": [],
"measurementRequests": [
{
"identity": "Qwen/Qwen3-Reranker-0.6B",
Expand Down Expand Up @@ -407,8 +398,11 @@
},
"concurrency": 16,
"lane": "default-l4-default",
"coResidents": [
"BAAI/bge-m3"
],
"measure": [
"receipt"
"co-residency-receipt"
],
"warmth": "pinned",
"reason": "unmeasured",
Expand Down Expand Up @@ -483,6 +477,27 @@
"reason": "unmeasured",
"costBound": 0.0,
"savingBound": 47.45
},
{
"identity": "intfloat/e5-base-v2",
"cell": {
"machineProfile": "l4",
"gpuProduct": "NVIDIA-L4"
},
"containerShape": {
"gpuCount": 1,
"cpuCores": 4,
"memoryMiB": 16384
},
"concurrency": 16,
"lane": "default-l4-default",
"measure": [
"footprint"
],
"warmth": "pinned",
"reason": "unmeasured",
"costBound": 0.0,
"savingBound": 47.45
}
],
"comeAliveLevers": [
Expand Down Expand Up @@ -534,6 +549,7 @@
"intfloat/e5-base-v2"
],
"warmBoundUndeclared": [],
"gpuMemoryUndeclared": [],
"refusals": [
{
"record": "boot-evidence",
Expand Down Expand Up @@ -605,11 +621,54 @@
}
}
},
{
"name": "default-l4-default",
"before": {
"name": "default-l4-default",
"queuePool": "default",
"bundle": "default",
"cell": {
"machineProfile": "l4",
"gpuProduct": "NVIDIA-L4"
},
"containerShape": {
"gpuCount": 1,
"cpuCores": 4,
"memoryMiB": 16384
},
"concurrency": 16,
"maxContainers": 4,
"envelope": {
"floorMin": 1,
"floorMax": 2
}
},
"after": {
"name": "default-l4-default",
"queuePool": "default-l4-default",
"bundle": "default",
"cell": {
"machineProfile": "l4",
"gpuProduct": "NVIDIA-L4"
},
"containerShape": {
"gpuCount": 1,
"cpuCores": 4,
"memoryMiB": 16384
},
"concurrency": 16,
"maxContainers": 4,
"envelope": {
"floorMin": 1,
"floorMax": 2
}
}
},
{
"name": "qwen-qwen3-embedding-4b-l4",
"after": {
"name": "qwen-qwen3-embedding-4b-l4",
"queuePool": "default",
"queuePool": "qwen-qwen3-embedding-4b-l4",
"bundle": "default",
"cell": {
"machineProfile": "l4",
Expand Down
Loading
Loading