feat: checkpoint contact-cycle evaluation and RootXY PPO progress
Consolidate next-stage docs, archive superseded narratives, and preserve frozen document inputs. Retain invalid P2 pairs, partial RootXY training, failed attempts and nonselectable checkpoints as explicit limitations. Include supervised evaluation/training, desktop GPU admission, bounded evidence and atomic-publication monitor repairs with CPU regressions. Ignore local dotenv configuration. Validation: 1403 passed, 6 skipped for contact-cycle and related contracts/CLI tests. Full-suite legacy ABI and registration tests require Python 3.12/Torch 2.10/pxr; no runtime checks relaxed. No new physical run or accepted skill.
This commit is contained in:
+49
-31
@@ -17,12 +17,7 @@ from pathlib import Path
|
||||
from runtime_common import critical_log_lines, write_json
|
||||
|
||||
|
||||
def main():
|
||||
import torch
|
||||
from SkillFactory.legs.policy import LegActorCritic, load_policy, ppo_update, save_policy
|
||||
from SkillFactory.legs.spec import load_bundle
|
||||
from SkillFactory.legs.tokens import FEATURE_SCHEMA
|
||||
|
||||
def parse_args(argv=None):
|
||||
parser = argparse.ArgumentParser(description=__doc__)
|
||||
parser.add_argument("--bundles", type=Path, nargs="+", required=True)
|
||||
parser.add_argument("--num_envs", type=int, default=16, help="Per-asset environment count")
|
||||
@@ -32,14 +27,60 @@ def main():
|
||||
parser.add_argument("--episode-length", type=float, default=0.2)
|
||||
parser.add_argument("--seed", type=int, default=42)
|
||||
parser.add_argument("--device", default="cuda:0")
|
||||
parser.add_argument(
|
||||
"--viz",
|
||||
"--visualizer",
|
||||
choices=("none", "kit"),
|
||||
help="Worker visualization (omitted: worker default). Kit windows restart for each asset/update.",
|
||||
)
|
||||
parser.add_argument("--output", type=Path, default=Path("logs/leg_interface/train_smoke"))
|
||||
args = parser.parse_args()
|
||||
args = parser.parse_args(argv)
|
||||
if (
|
||||
min(args.num_envs, args.max_joints, args.horizon, args.updates) < 1
|
||||
or not math.isfinite(args.episode_length)
|
||||
or args.episode_length <= 0
|
||||
):
|
||||
parser.error("Counts and episode length must be positive")
|
||||
return args
|
||||
|
||||
|
||||
def worker_command(args, bundle_path, weights, directory, seed):
|
||||
command = [
|
||||
sys.executable,
|
||||
str(Path(__file__).with_name("leg_worker.py")),
|
||||
"--bundle",
|
||||
str(bundle_path.resolve()),
|
||||
"--mode",
|
||||
"rollout",
|
||||
"--weights",
|
||||
str(weights.resolve()),
|
||||
"--num_envs",
|
||||
str(args.num_envs),
|
||||
"--max-joints",
|
||||
str(args.max_joints),
|
||||
"--horizon",
|
||||
str(args.horizon),
|
||||
"--episode-length",
|
||||
str(args.episode_length),
|
||||
"--seed",
|
||||
str(seed),
|
||||
"--device",
|
||||
args.device,
|
||||
"--output",
|
||||
str(directory.resolve()),
|
||||
]
|
||||
if args.viz is not None:
|
||||
command.extend(["--viz", args.viz])
|
||||
return command
|
||||
|
||||
|
||||
def main():
|
||||
args = parse_args()
|
||||
import torch
|
||||
from SkillFactory.legs.policy import LegActorCritic, load_policy, ppo_update, save_policy
|
||||
from SkillFactory.legs.spec import load_bundle
|
||||
from SkillFactory.legs.tokens import FEATURE_SCHEMA
|
||||
|
||||
args.output.mkdir(parents=True, exist_ok=True)
|
||||
report = {
|
||||
"passed": False,
|
||||
@@ -73,30 +114,7 @@ def main():
|
||||
directory = args.output / f"update_{update:04d}" / part_id
|
||||
directory.mkdir(parents=True, exist_ok=True)
|
||||
log_path = directory / "worker.log"
|
||||
command = [
|
||||
sys.executable,
|
||||
str(Path(__file__).with_name("leg_worker.py")),
|
||||
"--bundle",
|
||||
str(bundle_path.resolve()),
|
||||
"--mode",
|
||||
"rollout",
|
||||
"--weights",
|
||||
str(weights.resolve()),
|
||||
"--num_envs",
|
||||
str(args.num_envs),
|
||||
"--max-joints",
|
||||
str(args.max_joints),
|
||||
"--horizon",
|
||||
str(args.horizon),
|
||||
"--episode-length",
|
||||
str(args.episode_length),
|
||||
"--seed",
|
||||
str(args.seed + index + update * 100),
|
||||
"--device",
|
||||
args.device,
|
||||
"--output",
|
||||
str(directory.resolve()),
|
||||
]
|
||||
command = worker_command(args, bundle_path, weights, directory, args.seed + index + update * 100)
|
||||
with log_path.open("w") as log:
|
||||
child = subprocess.run(command, stdout=log, stderr=subprocess.STDOUT)
|
||||
critical = critical_log_lines(log_path)
|
||||
|
||||
Reference in New Issue
Block a user