41 lines
1.8 KiB
Python
41 lines
1.8 KiB
Python
#!/usr/bin/env python3
|
|
"""Writes the arm profiles of the laptop A/B next to each other, for `leleka up --profile FILE`.
|
|
|
|
make_arm_profiles.py OUT_DIR [BASE_PROFILE.json] (default base: deploy/rust-runtime/profiles/rtx3080-16g.json)
|
|
|
|
Arms (each is one engine start; the arm name is the file name):
|
|
A-before engine_env empty: the profile as it was before 2026-11-13
|
|
B-shipped the profile as shipped now (one pin: global rank fill, which is the engine default)
|
|
C-lossless B + LELEKA_PREFILL_LOAN_TIERS=1 + LELEKA_PREFIX_PARK_FAST=1 (identity-gated on the 5090, not yet run on the 3080)
|
|
D-seed-off C + LELEKA_ORIGINAL_SERVE_SEED=off (placement class)
|
|
E-tail7 C + LELEKA_ROUTE_TAIL_SKIP=7 + LELEKA_ROUTE_TAIL_SKIP_MAX_CACHED=100 (LOSSY, opt-in; speed only)
|
|
Offline tooling; the engine and `leleka up` need no Python.
|
|
"""
|
|
import json
|
|
import pathlib
|
|
import sys
|
|
|
|
LOSSLESS = {"LELEKA_PREFILL_LOAN_TIERS": "1", "LELEKA_PREFIX_PARK_FAST": "1"}
|
|
ARMS = {
|
|
"A-before": lambda env: {},
|
|
"B-shipped": lambda env: dict(env),
|
|
"C-lossless": lambda env: {**env, **LOSSLESS},
|
|
"D-seed-off": lambda env: {**env, **LOSSLESS, "LELEKA_ORIGINAL_SERVE_SEED": "off"},
|
|
"E-tail7": lambda env: {**env, **LOSSLESS, "LELEKA_ROUTE_TAIL_SKIP": "7", "LELEKA_ROUTE_TAIL_SKIP_MAX_CACHED": "100"},
|
|
}
|
|
|
|
|
|
def main(argv):
|
|
out = pathlib.Path(argv[1])
|
|
base = pathlib.Path(argv[2]) if len(argv) > 2 else pathlib.Path(__file__).resolve().parents[2] / "deploy/rust-runtime/profiles/rtx3080-16g.json"
|
|
profile = json.loads(base.read_text(encoding="utf-8"))
|
|
out.mkdir(parents=True, exist_ok=True)
|
|
for name, make in ARMS.items():
|
|
arm = dict(profile, engine_env=make(profile["engine_env"]))
|
|
(out / f"{name}.json").write_text(json.dumps(arm, indent=2) + "\n", encoding="utf-8")
|
|
print(name, arm["engine_env"])
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main(sys.argv)
|