Freeze the final GPU2 GINO measurement binding for narrow review
This commit is contained in:
1 parent
fa95ea8251
commit
0e73ae1504
5 files changed
+891
No files matched your search
@@ -0,0 +1,55 @@
|
||||
"""Keep the accepted GINO measurement and bind it to the approved idle V100."""
|
||||
|
||||
import argparse
|
||||
from copy import deepcopy
|
||||
from pathlib import Path
|
||||
from types import FunctionType
|
||||
|
||||
import track_b_gino_import_checked_entry as checked_entry
|
||||
from track_b_gino_shapenet_entry import checked, read, sha
|
||||
|
||||
|
||||
ROOT = checked_entry.ROOT.with_name("track-b-gino-shapenet611-gpu2-measurement-2026-11-19")
|
||||
ENTRY = Path(__file__).resolve()
|
||||
WORKER = ENTRY.with_name("track_b_gino_measurement_gpu2_worker.py")
|
||||
UUID = "GPU-b8c11c01-c91f-aa0b-abf6-dad35085cc76"
|
||||
PRIOR_CONTRACT = "ab97357150578ea649140a5be01ed5639edcd998874d3788dc9bf8a42acac28e"
|
||||
|
||||
|
||||
def expected_contract():
|
||||
c = deepcopy(read(checked(checked_entry.ROOT / "contract.json", PRIOR_CONTRACT)))
|
||||
c["gpu_uuid"] = UUID
|
||||
c["gpu_ruling"] = "h-bc42181f"
|
||||
c["code_sha256"].update({str(p): sha(p) for p in (ENTRY, WORKER)})
|
||||
return c
|
||||
|
||||
|
||||
def contract(path):
|
||||
c = checked_entry.contract(path)
|
||||
if c != expected_contract():
|
||||
raise PermissionError("Only the accepted measurement retargeted to GPU2 is authorized")
|
||||
return c
|
||||
|
||||
|
||||
def dispatch_guard(root, path):
|
||||
namespace = dict(checked_entry.dispatch_guard.__globals__, contract=contract, WORKER=WORKER)
|
||||
return FunctionType(checked_entry.dispatch_guard.__code__, namespace, "dispatch_guard")(root, path)
|
||||
|
||||
|
||||
def authorized_child(root):
|
||||
namespace = dict(checked_entry.authorized_child.__globals__, ROOT=ROOT, contract=contract)
|
||||
return FunctionType(checked_entry.authorized_child.__code__, namespace, "authorized_child")(root)
|
||||
|
||||
|
||||
def run(root):
|
||||
if (checked_entry.ROOT / "started.json").exists():
|
||||
raise FileExistsError("Previous accepted entry already has a start record")
|
||||
namespace = dict(checked_entry.run.__globals__, ROOT=ROOT, contract=contract,
|
||||
dispatch_guard=dispatch_guard)
|
||||
return FunctionType(checked_entry.run.__code__, namespace, "run")(root)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
parser = argparse.ArgumentParser(description=__doc__)
|
||||
parser.add_argument("root", type=Path)
|
||||
raise SystemExit(run(parser.parse_args().root))
|
||||
@@ -0,0 +1,21 @@
|
||||
"""Invoke the same reviewed paper measurement at its new physical card binding."""
|
||||
|
||||
import argparse
|
||||
from pathlib import Path
|
||||
import sys
|
||||
from types import FunctionType
|
||||
|
||||
from track_b_gino_measurement_gpu2 import authorized_child
|
||||
from track_b_gino_paper_keyword_patch import extract_patched_paper_code
|
||||
from track_b_gino_shapenet_worker import work
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
parser = argparse.ArgumentParser(description=__doc__)
|
||||
parser.add_argument("root", type=Path)
|
||||
root = parser.parse_args().root.resolve()
|
||||
c = authorized_child(root)
|
||||
if str(Path(sys.executable).absolute()) != c["environment"]["python"]:
|
||||
raise PermissionError("The worker did not start with the accepted interpreter")
|
||||
namespace = dict(work.__globals__, extract_paper_code=extract_patched_paper_code)
|
||||
FunctionType(work.__code__, namespace, work.__name__)(root, c)
|
||||
Reference in new issue
Block a user