distributed-gguf-runtime: add CMake skeleton, gRPC harness, split-GGUF provisioning, performance contracts
DGR-019 Lock alpha/beta performance contracts (evidence + contract framework) DGR-020 Run controlled whole-model GGUF baseline (benchmark results & contracts) DGR-024 Real generated-gRPC protocol harness (shard_runtime_server.py + tests) DGR-026 split-GGUF provisioning outside /home (provision script + manifest + tests) DGR-028 Numbered patch-stack apply & verify (llama_cpp_dependency.py + UPSTREAM_LOCK.json) DGR-029 Native CMake skeleton + deterministic CPU lane (UPSTREAM_LOCK.json + cmake gating) New modules: packages/node/meshnet_node/dgr_performance/ — performance contract framework packages/node/meshnet_node/split_gguf/ — split-GGUF manifest & provisioning scripts/provision_split_gguf.py — artifact provisioning CLI tests/test_dgr_performance_contract.py — contract validation tests tests/test_split_gguf_manifest.py — manifest tests tests/test_split_gguf_provision.py — provisioning tests tests/test_shard_runtime_harness.py — gRPC harness tests
This commit is contained in:
@@ -32,18 +32,26 @@ LOCK_PATH = LLAMA_DIR / "UPSTREAM_LOCK.json"
|
||||
PATCH_DIR = LLAMA_DIR / "patches"
|
||||
|
||||
|
||||
def _cmake() -> str:
|
||||
def _toolchain_binary(name: str, env_var: str) -> str:
|
||||
"""Use an explicit override, PATH, or the active Python environment."""
|
||||
configured = os.environ.get("CMAKE")
|
||||
configured = os.environ.get(env_var)
|
||||
if configured:
|
||||
return configured
|
||||
on_path = shutil.which("cmake")
|
||||
on_path = shutil.which(name)
|
||||
if on_path:
|
||||
return on_path
|
||||
sibling = pathlib.Path(sys.executable).parent / "cmake"
|
||||
sibling = pathlib.Path(sys.executable).parent / name
|
||||
if sibling.is_file():
|
||||
return str(sibling)
|
||||
raise DependencyError("cmake is unavailable; set CMAKE or activate the project toolchain")
|
||||
raise DependencyError(f"{name} is unavailable; set {env_var} or activate the project toolchain")
|
||||
|
||||
|
||||
def _cmake() -> str:
|
||||
return _toolchain_binary("cmake", "CMAKE")
|
||||
|
||||
|
||||
def _ctest() -> str:
|
||||
return _toolchain_binary("ctest", "CTEST")
|
||||
|
||||
|
||||
class DependencyError(RuntimeError):
|
||||
@@ -492,6 +500,13 @@ def smoke(binary: pathlib.Path) -> None:
|
||||
print(output)
|
||||
|
||||
|
||||
def ctest_lane(build_dir: pathlib.Path) -> None:
|
||||
"""Run the deterministic model-free CPU CTest lane and print its output."""
|
||||
lock = _load_lock()
|
||||
regex = lock["build"]["ctest_regex"]
|
||||
print(_run(_ctest(), "--test-dir", str(build_dir), "-R", regex, "--output-on-failure"))
|
||||
|
||||
|
||||
def verify(workspace: pathlib.Path) -> None:
|
||||
"""Apply, verify, reverse, and leave the exact cached pin pristine."""
|
||||
source = fetch(workspace)
|
||||
@@ -500,12 +515,16 @@ def verify(workspace: pathlib.Path) -> None:
|
||||
|
||||
|
||||
def reproduce(workspace: pathlib.Path) -> None:
|
||||
"""Configure, build, smoke-test, and CTest a clean checkout, then restore the pristine cache."""
|
||||
source = fetch(workspace)
|
||||
build_dir = workspace.resolve() / "build"
|
||||
if build_dir.exists():
|
||||
raise DependencyError(f"build directory already exists; refusing to erase possible local edits: {build_dir}")
|
||||
apply(source)
|
||||
smoke(build(source, build_dir))
|
||||
binary = build(source, build_dir)
|
||||
smoke(binary)
|
||||
ctest_lane(build_dir)
|
||||
reverse(source)
|
||||
|
||||
|
||||
def inspect() -> None:
|
||||
@@ -541,6 +560,8 @@ def main() -> int:
|
||||
build_parser.add_argument("--build-dir", type=pathlib.Path, required=True)
|
||||
smoke_parser = subcommands.add_parser("smoke")
|
||||
smoke_parser.add_argument("--binary", type=pathlib.Path, required=True)
|
||||
ctest_parser = subcommands.add_parser("ctest")
|
||||
ctest_parser.add_argument("--build-dir", type=pathlib.Path, required=True)
|
||||
reproduce_parser = subcommands.add_parser("reproduce")
|
||||
reproduce_parser.add_argument("--workspace", type=pathlib.Path, default=ROOT / "build/llama.cpp")
|
||||
args = parser.parse_args()
|
||||
@@ -559,6 +580,8 @@ def main() -> int:
|
||||
build(args.source_dir, args.build_dir)
|
||||
elif args.command == "smoke":
|
||||
smoke(args.binary)
|
||||
elif args.command == "ctest":
|
||||
ctest_lane(args.build_dir)
|
||||
else:
|
||||
reproduce(args.workspace)
|
||||
except DependencyError as error:
|
||||
|
||||
Reference in New Issue
Block a user