ShayManor commited on
Commit
86b1ff6
·
verified ·
1 Parent(s): f4b7730

results: jobs/20261009-100135-large-ilqr-fast/** index/episodes.jsonl leaderboard/*

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. .gitattributes +6 -0
  2. results/index/episodes.jsonl +0 -0
  3. results/jobs/20261009-100135-large-ilqr-fast/breakdown.json +0 -0
  4. results/jobs/20261009-100135-large-ilqr-fast/episodes.jsonl +3 -0
  5. results/jobs/20261009-100135-large-ilqr-fast/gautschi/0/done.txt +0 -0
  6. results/jobs/20261009-100135-large-ilqr-fast/gautschi/0/episodes.json +3 -0
  7. results/jobs/20261009-100135-large-ilqr-fast/gautschi/0/gautschi_launch.py +145 -0
  8. results/jobs/20261009-100135-large-ilqr-fast/gautschi/0/sbatch.sh +5 -0
  9. results/jobs/20261009-100135-large-ilqr-fast/gautschi/1/done.txt +0 -0
  10. results/jobs/20261009-100135-large-ilqr-fast/gautschi/1/episodes.json +3 -0
  11. results/jobs/20261009-100135-large-ilqr-fast/gautschi/1/gautschi_launch.py +145 -0
  12. results/jobs/20261009-100135-large-ilqr-fast/gautschi/1/sbatch.sh +5 -0
  13. results/jobs/20261009-100135-large-ilqr-fast/gautschi/2/done.txt +0 -0
  14. results/jobs/20261009-100135-large-ilqr-fast/gautschi/2/episodes.json +3 -0
  15. results/jobs/20261009-100135-large-ilqr-fast/gautschi/2/gautschi_launch.py +145 -0
  16. results/jobs/20261009-100135-large-ilqr-fast/gautschi/2/sbatch.sh +5 -0
  17. results/jobs/20261009-100135-large-ilqr-fast/gautschi/3/done.txt +0 -0
  18. results/jobs/20261009-100135-large-ilqr-fast/gautschi/3/episodes.json +3 -0
  19. results/jobs/20261009-100135-large-ilqr-fast/gautschi/3/gautschi_launch.py +145 -0
  20. results/jobs/20261009-100135-large-ilqr-fast/gautschi/3/sbatch.sh +5 -0
  21. results/jobs/20261009-100135-large-ilqr-fast/job.json +40 -0
  22. results/jobs/20261009-100135-large-ilqr-fast/logs/shard-0000.jsonl.gz +3 -0
  23. results/jobs/20261009-100135-large-ilqr-fast/logs/shard-0001.jsonl.gz +3 -0
  24. results/jobs/20261009-100135-large-ilqr-fast/logs/shard-0002.jsonl.gz +3 -0
  25. results/jobs/20261009-100135-large-ilqr-fast/logs/shard-0003.jsonl.gz +3 -0
  26. results/jobs/20261009-100135-large-ilqr-fast/logs/shard-0004.jsonl.gz +3 -0
  27. results/jobs/20261009-100135-large-ilqr-fast/logs/shard-0005.jsonl.gz +3 -0
  28. results/jobs/20261009-100135-large-ilqr-fast/logs/shard-0006.jsonl.gz +3 -0
  29. results/jobs/20261009-100135-large-ilqr-fast/logs/shard-0007.jsonl.gz +3 -0
  30. results/jobs/20261009-100135-large-ilqr-fast/logs/shard-0008.jsonl.gz +3 -0
  31. results/jobs/20261009-100135-large-ilqr-fast/logs/shard-0009.jsonl.gz +3 -0
  32. results/jobs/20261009-100135-large-ilqr-fast/logs/shard-0010.jsonl.gz +3 -0
  33. results/jobs/20261009-100135-large-ilqr-fast/logs/shard-0011.jsonl.gz +3 -0
  34. results/jobs/20261009-100135-large-ilqr-fast/logs/shard-0012.jsonl.gz +3 -0
  35. results/jobs/20261009-100135-large-ilqr-fast/logs/shard-0013.jsonl.gz +3 -0
  36. results/jobs/20261009-100135-large-ilqr-fast/logs/shard-0014.jsonl.gz +3 -0
  37. results/jobs/20261009-100135-large-ilqr-fast/logs/shard-0015.jsonl.gz +3 -0
  38. results/jobs/20261009-100135-large-ilqr-fast/logs/shard-0016.jsonl.gz +3 -0
  39. results/jobs/20261009-100135-large-ilqr-fast/logs/shard-0017.jsonl.gz +3 -0
  40. results/jobs/20261009-100135-large-ilqr-fast/logs/shard-0018.jsonl.gz +3 -0
  41. results/jobs/20261009-100135-large-ilqr-fast/logs/shard-0019.jsonl.gz +3 -0
  42. results/jobs/20261009-100135-large-ilqr-fast/logs/shard-0020.jsonl.gz +3 -0
  43. results/jobs/20261009-100135-large-ilqr-fast/logs/shard-0021.jsonl.gz +3 -0
  44. results/jobs/20261009-100135-large-ilqr-fast/logs/shard-0022.jsonl.gz +3 -0
  45. results/jobs/20261009-100135-large-ilqr-fast/logs/shard-0023.jsonl.gz +3 -0
  46. results/jobs/20261009-100135-large-ilqr-fast/logs/shard-0024.jsonl.gz +3 -0
  47. results/jobs/20261009-100135-large-ilqr-fast/logs/shard-0025.jsonl.gz +3 -0
  48. results/jobs/20261009-100135-large-ilqr-fast/logs/shard-0026.jsonl.gz +3 -0
  49. results/jobs/20261009-100135-large-ilqr-fast/logs/shard-0027.jsonl.gz +3 -0
  50. results/jobs/20261009-100135-large-ilqr-fast/logs/shard-0028.jsonl.gz +3 -0
.gitattributes CHANGED
@@ -63,3 +63,9 @@ results/jobs/20261006-203943-pure-pursuit/episodes.jsonl filter=lfs diff=lfs mer
63
  results/jobs/20261008-135505-best-stack/episodes.jsonl filter=lfs diff=lfs merge=lfs -text
64
  results/jobs/20261008-135505-best-stack/gautschi/0/episodes.json filter=lfs diff=lfs merge=lfs -text
65
  results/jobs/20261008-135505-best-stack/gautschi/1/episodes.json filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
 
 
63
  results/jobs/20261008-135505-best-stack/episodes.jsonl filter=lfs diff=lfs merge=lfs -text
64
  results/jobs/20261008-135505-best-stack/gautschi/0/episodes.json filter=lfs diff=lfs merge=lfs -text
65
  results/jobs/20261008-135505-best-stack/gautschi/1/episodes.json filter=lfs diff=lfs merge=lfs -text
66
+ results/jobs/20261009-100135-large-ilqr-fast/episodes.jsonl filter=lfs diff=lfs merge=lfs -text
67
+ results/jobs/20261009-100135-large-ilqr-fast/gautschi/0/episodes.json filter=lfs diff=lfs merge=lfs -text
68
+ results/jobs/20261009-100135-large-ilqr-fast/gautschi/1/episodes.json filter=lfs diff=lfs merge=lfs -text
69
+ results/jobs/20261009-100135-large-ilqr-fast/gautschi/3/episodes.json filter=lfs diff=lfs merge=lfs -text
70
+ results/jobs/20261009-100135-large-ilqr-fast/gautschi/2/episodes.json filter=lfs diff=lfs merge=lfs -text
71
+ results/index/episodes.jsonl filter=lfs diff=lfs merge=lfs -text
results/index/episodes.jsonl CHANGED
The diff for this file is too large to render. See raw diff
 
results/jobs/20261009-100135-large-ilqr-fast/breakdown.json ADDED
The diff for this file is too large to render. See raw diff
 
results/jobs/20261009-100135-large-ilqr-fast/episodes.jsonl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3fa71473e9d5e0eb454d1e2a94eff417506c8852914c07b58ab00c84c908d8a3
3
+ size 240728768
results/jobs/20261009-100135-large-ilqr-fast/gautschi/0/done.txt ADDED
The diff for this file is too large to render. See raw diff
 
results/jobs/20261009-100135-large-ilqr-fast/gautschi/0/episodes.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:50ec7a7f06bb66e43d484d7e617bca71ff39971ce6bdd8f0419f466603f51eb3
3
+ size 13433524
results/jobs/20261009-100135-large-ilqr-fast/gautschi/0/gautschi_launch.py ADDED
@@ -0,0 +1,145 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Runs on a Gautschi node (stdlib only): episodes from a queue in parallel workers, one contained Apptainer per episode."""
2
+ import argparse
3
+ import json
4
+ import os
5
+ import queue
6
+ import shutil
7
+ import subprocess
8
+ import threading
9
+ import time
10
+
11
+ RUN = ("source /opt/ros/humble/setup.bash && source /ws/install/setup.bash"
12
+ " && python3 -m simnode.batch /batch.json /out")
13
+ CUDA_LIB = "/ws/mpc_cuda/libmpc_cuda.so" # built per stack by runner/gautschi.build_stack for gautschi-gpu
14
+ SAMPLE_S = 15
15
+ STAGGER_S = 0.25 # between worker starts: the dev job's one error was a stack starved in the 96-way start burst
16
+ EPISODE_TIMEOUT_S = 1200 # about 4x the slowest lap; a killed episode has no outcome and is retried by the host
17
+
18
+
19
+ def worker_cmd(i, work, out, ep, sif, engine, stack, gpu=None):
20
+ """Private /tmp, HOME, /dev/shm, IPC, PIDs and loopback per episode, plus a distinct ROS_DOMAIN_ID per worker;
21
+ gpu (a host CUDA device) adds the driver and the stack's CUDA MPC kernel."""
22
+ cuda = ["--nv", "--env", f"CUDA_VISIBLE_DEVICES={gpu}", "--env", f"MPC_CUDA_LIB={CUDA_LIB}"] if gpu is not None else []
23
+ if gpu is None and os.path.exists(os.path.join(stack, "mpc_cuda", "libmpc_cuda.so")):
24
+ cuda = ["--env", f"MPC_CUDA_LIB={CUDA_LIB}"] # CPU node: the library's native iLQR solve still loads; its MPPI falls back to numpy
25
+ return ["apptainer", "exec", *cuda, "--contain", "--cleanenv", "--ipc", "--pid", "--net", "--network", "none", "--workdir", work,
26
+ "--env", f"ROS_DOMAIN_ID={i + 1}", "--env", "ROS_HOME=/tmp/ros", "--env", "TMPDIR=/tmp",
27
+ "--bind", f"{engine}:/opt/sim:ro", "--bind", f"{stack}:/ws:ro", "--bind", f"{out}:/out",
28
+ "--bind", f"{ep}:/batch.json:ro", sif, "bash", "-lc", RUN]
29
+
30
+
31
+ def parse_smi(text):
32
+ """nvidia-smi 'utilization.gpu, memory.used' csv rows to per-GPU lists."""
33
+ rows = [[int(v) for v in ln.split(",")] for ln in text.strip().splitlines() if ln.strip()]
34
+ return {"gpu_util": [r[0] for r in rows], "gpu_mem_mib": [r[1] for r in rows]}
35
+
36
+
37
+ def _solver(logdir):
38
+ """pathfinder's 'MPC solver: ...' and CUDA fallback lines from the episode's ROS logs."""
39
+ lines = []
40
+ for dp, _, fns in os.walk(logdir):
41
+ for fn in fns:
42
+ try:
43
+ with open(os.path.join(dp, fn), errors="replace") as f:
44
+ lines += [ln.strip() for ln in f if "MPC solver:" in ln or "CUDA MPC unavailable" in ln]
45
+ except OSError:
46
+ pass
47
+ return "\n".join(dict.fromkeys(lines))
48
+
49
+
50
+ def main(argv=None):
51
+ p = argparse.ArgumentParser()
52
+ for a in ("episodes", "out", "sif", "engine", "stack", "work", "timeline", "done"):
53
+ p.add_argument("--" + a, required=True)
54
+ p.add_argument("--workers", type=int, required=True)
55
+ p.add_argument("--gpus", type=int, default=0)
56
+ a = p.parse_args(argv)
57
+ with open(a.episodes) as f:
58
+ q = queue.Queue()
59
+ for e in json.load(f): # the host already ordered them, longest first
60
+ q.put(e)
61
+ os.makedirs(a.out, exist_ok=True)
62
+ lock, t0 = threading.Lock(), time.time()
63
+ devs = [d for d in os.environ.get("CUDA_VISIBLE_DEVICES", "").split(",") if d][:a.gpus] or [str(n) for n in range(a.gpus)]
64
+
65
+ def log(**ev):
66
+ with lock, open(a.timeline, "a") as f:
67
+ f.write(json.dumps(dict(ev, t=round(time.time() - t0, 3))) + "\n")
68
+
69
+ def worker(i):
70
+ time.sleep(i * STAGGER_S)
71
+ while True:
72
+ try:
73
+ e = q.get_nowait()
74
+ except queue.Empty:
75
+ return
76
+ key, work = e["key"], os.path.join(a.work, e["key"])
77
+ stage, ep = os.path.join(work, "stage"), os.path.join(work, "ep.json")
78
+ os.makedirs(stage)
79
+ with open(ep, "w") as f:
80
+ json.dump([e], f)
81
+ log(ev="start", key=key, worker=i)
82
+ gpu = devs[i % len(devs)] if devs and e["resolved"].get("recipe", {}).get("sim", {}).get("cuda") else None
83
+ limit = EPISODE_TIMEOUT_S * max(1, e["resolved"]["scenario"].get("laps", 1)) # per lap: 5-lap episodes run 5x longer
84
+ try:
85
+ rc = subprocess.run(worker_cmd(i, work, stage, ep, a.sif, a.engine, a.stack, gpu), stdout=subprocess.DEVNULL,
86
+ stderr=subprocess.DEVNULL, timeout=limit).returncode
87
+ except subprocess.TimeoutExpired:
88
+ rc = "timeout"
89
+ solver = _solver(os.path.join(work, "tmp", "ros", "log"))
90
+ if solver and os.path.isdir(os.path.join(stage, key)):
91
+ with open(os.path.join(stage, key, "solver.txt"), "w") as f:
92
+ f.write(solver + "\n")
93
+ if os.path.exists(os.path.join(stage, key, "outcome.json")):
94
+ tmp, dst = os.path.join(a.out, ".tmp-" + key), os.path.join(a.out, key)
95
+ shutil.rmtree(tmp, ignore_errors=True)
96
+ shutil.copytree(os.path.join(stage, key), tmp)
97
+ shutil.rmtree(dst, ignore_errors=True)
98
+ os.rename(tmp, dst) # the host's rsync sees a key only once its directory is complete
99
+ with lock, open(a.done, "a") as f:
100
+ f.write(key + "\n")
101
+ shutil.rmtree(work, ignore_errors=True)
102
+ log(ev="end", key=key, worker=i, rc=rc, gpu=gpu,
103
+ solver=solver.split("MPC solver: ")[-1] if "MPC solver: " in solver else solver or None)
104
+
105
+ def sampler(stop):
106
+ """Job CPU use from its cgroup, as busy cores, every SAMPLE_S."""
107
+ try:
108
+ with open("/proc/self/cgroup") as f:
109
+ path = "/sys/fs/cgroup" + f.read().strip().split(":")[-1] + "/cpu.stat"
110
+ prev = None
111
+ while not stop.wait(SAMPLE_S if prev else 0):
112
+ with open(path) as f:
113
+ use = next(int(ln.split()[1]) for ln in f if ln.startswith("usage_usec"))
114
+ now = time.time()
115
+ if prev:
116
+ log(ev="cpu", busy_cores=round((use - prev[0]) / 1e6 / (now - prev[1]), 2))
117
+ prev = (use, now)
118
+ except (OSError, StopIteration, ValueError):
119
+ pass
120
+
121
+ def gpu_sampler(stop):
122
+ """GPU utilisation and memory of the job's GPUs, every SAMPLE_S."""
123
+ while not stop.wait(SAMPLE_S):
124
+ try:
125
+ p = subprocess.Popen(["nvidia-smi", "--query-gpu=utilization.gpu,memory.used", "--format=csv,noheader,nounits"],
126
+ stdout=subprocess.PIPE, stderr=subprocess.DEVNULL, text=True)
127
+ log(ev="gpu", **parse_smi(p.communicate(timeout=30)[0]))
128
+ except Exception: # no driver or a hung query: skip this sample
129
+ pass
130
+
131
+ cores = len(os.sched_getaffinity(0)) if hasattr(os, "sched_getaffinity") else os.cpu_count()
132
+ log(ev="launch", workers=a.workers, cores=cores)
133
+ stop = threading.Event()
134
+ threads = [threading.Thread(target=worker, args=(i,)) for i in range(a.workers)]
135
+ samplers = [sampler] + ([gpu_sampler] if a.gpus else [])
136
+ for t in threads + [threading.Thread(target=f, args=(stop,), daemon=True) for f in samplers]:
137
+ t.start()
138
+ for t in threads:
139
+ t.join()
140
+ stop.set()
141
+ log(ev="done")
142
+
143
+
144
+ if __name__ == "__main__":
145
+ main()
results/jobs/20261009-100135-large-ilqr-fast/gautschi/0/sbatch.sh ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ #!/bin/bash
2
+ #SBATCH -p highmem -A lilly-rob1 -N 1 -n 1 -c 192 --time 177 -J AutoSim-large-large-ilqr-fast-1 --comment 20261009-100135-large-ilqr-fast -o AutoSim/jobs/20261009-100135-large-ilqr-fast/0/slurm-%j.out
3
+ W=/dev/shm/AutoSim-$SLURM_JOB_ID
4
+ trap 'rm -rf "$W"' EXIT
5
+ python3 $HOME/AutoSim/jobs/20261009-100135-large-ilqr-fast/0/gautschi_launch.py --episodes $HOME/AutoSim/jobs/20261009-100135-large-ilqr-fast/0/episodes.json --out /scratch/gautschi/manors/AutoSim/out/20261009-100135-large-ilqr-fast --sif $HOME/AutoSim/images/AutoSim-99d206f40cb1.sif --engine $HOME/AutoSim/engine/ded6f8168dff9c052caad6fa1d16ca257ed3716e49b4cd161aa09ae1c01f4af8 --stack $HOME/AutoSim/stacks/04b9fd4babb22ac6bc9054b48914fd04cb4b0fdd0f061e9143868303fd91b22f --workers 96 --work $W --timeline $HOME/AutoSim/jobs/20261009-100135-large-ilqr-fast/0/timeline.jsonl --done $HOME/AutoSim/jobs/20261009-100135-large-ilqr-fast/0/done.txt
results/jobs/20261009-100135-large-ilqr-fast/gautschi/1/done.txt ADDED
The diff for this file is too large to render. See raw diff
 
results/jobs/20261009-100135-large-ilqr-fast/gautschi/1/episodes.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6a5953a9526f8c3eba2e934ca726712bb2cf06082519d1560a846fe52c8953b4
3
+ size 13433603
results/jobs/20261009-100135-large-ilqr-fast/gautschi/1/gautschi_launch.py ADDED
@@ -0,0 +1,145 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Runs on a Gautschi node (stdlib only): episodes from a queue in parallel workers, one contained Apptainer per episode."""
2
+ import argparse
3
+ import json
4
+ import os
5
+ import queue
6
+ import shutil
7
+ import subprocess
8
+ import threading
9
+ import time
10
+
11
+ RUN = ("source /opt/ros/humble/setup.bash && source /ws/install/setup.bash"
12
+ " && python3 -m simnode.batch /batch.json /out")
13
+ CUDA_LIB = "/ws/mpc_cuda/libmpc_cuda.so" # built per stack by runner/gautschi.build_stack for gautschi-gpu
14
+ SAMPLE_S = 15
15
+ STAGGER_S = 0.25 # between worker starts: the dev job's one error was a stack starved in the 96-way start burst
16
+ EPISODE_TIMEOUT_S = 1200 # about 4x the slowest lap; a killed episode has no outcome and is retried by the host
17
+
18
+
19
+ def worker_cmd(i, work, out, ep, sif, engine, stack, gpu=None):
20
+ """Private /tmp, HOME, /dev/shm, IPC, PIDs and loopback per episode, plus a distinct ROS_DOMAIN_ID per worker;
21
+ gpu (a host CUDA device) adds the driver and the stack's CUDA MPC kernel."""
22
+ cuda = ["--nv", "--env", f"CUDA_VISIBLE_DEVICES={gpu}", "--env", f"MPC_CUDA_LIB={CUDA_LIB}"] if gpu is not None else []
23
+ if gpu is None and os.path.exists(os.path.join(stack, "mpc_cuda", "libmpc_cuda.so")):
24
+ cuda = ["--env", f"MPC_CUDA_LIB={CUDA_LIB}"] # CPU node: the library's native iLQR solve still loads; its MPPI falls back to numpy
25
+ return ["apptainer", "exec", *cuda, "--contain", "--cleanenv", "--ipc", "--pid", "--net", "--network", "none", "--workdir", work,
26
+ "--env", f"ROS_DOMAIN_ID={i + 1}", "--env", "ROS_HOME=/tmp/ros", "--env", "TMPDIR=/tmp",
27
+ "--bind", f"{engine}:/opt/sim:ro", "--bind", f"{stack}:/ws:ro", "--bind", f"{out}:/out",
28
+ "--bind", f"{ep}:/batch.json:ro", sif, "bash", "-lc", RUN]
29
+
30
+
31
+ def parse_smi(text):
32
+ """nvidia-smi 'utilization.gpu, memory.used' csv rows to per-GPU lists."""
33
+ rows = [[int(v) for v in ln.split(",")] for ln in text.strip().splitlines() if ln.strip()]
34
+ return {"gpu_util": [r[0] for r in rows], "gpu_mem_mib": [r[1] for r in rows]}
35
+
36
+
37
+ def _solver(logdir):
38
+ """pathfinder's 'MPC solver: ...' and CUDA fallback lines from the episode's ROS logs."""
39
+ lines = []
40
+ for dp, _, fns in os.walk(logdir):
41
+ for fn in fns:
42
+ try:
43
+ with open(os.path.join(dp, fn), errors="replace") as f:
44
+ lines += [ln.strip() for ln in f if "MPC solver:" in ln or "CUDA MPC unavailable" in ln]
45
+ except OSError:
46
+ pass
47
+ return "\n".join(dict.fromkeys(lines))
48
+
49
+
50
+ def main(argv=None):
51
+ p = argparse.ArgumentParser()
52
+ for a in ("episodes", "out", "sif", "engine", "stack", "work", "timeline", "done"):
53
+ p.add_argument("--" + a, required=True)
54
+ p.add_argument("--workers", type=int, required=True)
55
+ p.add_argument("--gpus", type=int, default=0)
56
+ a = p.parse_args(argv)
57
+ with open(a.episodes) as f:
58
+ q = queue.Queue()
59
+ for e in json.load(f): # the host already ordered them, longest first
60
+ q.put(e)
61
+ os.makedirs(a.out, exist_ok=True)
62
+ lock, t0 = threading.Lock(), time.time()
63
+ devs = [d for d in os.environ.get("CUDA_VISIBLE_DEVICES", "").split(",") if d][:a.gpus] or [str(n) for n in range(a.gpus)]
64
+
65
+ def log(**ev):
66
+ with lock, open(a.timeline, "a") as f:
67
+ f.write(json.dumps(dict(ev, t=round(time.time() - t0, 3))) + "\n")
68
+
69
+ def worker(i):
70
+ time.sleep(i * STAGGER_S)
71
+ while True:
72
+ try:
73
+ e = q.get_nowait()
74
+ except queue.Empty:
75
+ return
76
+ key, work = e["key"], os.path.join(a.work, e["key"])
77
+ stage, ep = os.path.join(work, "stage"), os.path.join(work, "ep.json")
78
+ os.makedirs(stage)
79
+ with open(ep, "w") as f:
80
+ json.dump([e], f)
81
+ log(ev="start", key=key, worker=i)
82
+ gpu = devs[i % len(devs)] if devs and e["resolved"].get("recipe", {}).get("sim", {}).get("cuda") else None
83
+ limit = EPISODE_TIMEOUT_S * max(1, e["resolved"]["scenario"].get("laps", 1)) # per lap: 5-lap episodes run 5x longer
84
+ try:
85
+ rc = subprocess.run(worker_cmd(i, work, stage, ep, a.sif, a.engine, a.stack, gpu), stdout=subprocess.DEVNULL,
86
+ stderr=subprocess.DEVNULL, timeout=limit).returncode
87
+ except subprocess.TimeoutExpired:
88
+ rc = "timeout"
89
+ solver = _solver(os.path.join(work, "tmp", "ros", "log"))
90
+ if solver and os.path.isdir(os.path.join(stage, key)):
91
+ with open(os.path.join(stage, key, "solver.txt"), "w") as f:
92
+ f.write(solver + "\n")
93
+ if os.path.exists(os.path.join(stage, key, "outcome.json")):
94
+ tmp, dst = os.path.join(a.out, ".tmp-" + key), os.path.join(a.out, key)
95
+ shutil.rmtree(tmp, ignore_errors=True)
96
+ shutil.copytree(os.path.join(stage, key), tmp)
97
+ shutil.rmtree(dst, ignore_errors=True)
98
+ os.rename(tmp, dst) # the host's rsync sees a key only once its directory is complete
99
+ with lock, open(a.done, "a") as f:
100
+ f.write(key + "\n")
101
+ shutil.rmtree(work, ignore_errors=True)
102
+ log(ev="end", key=key, worker=i, rc=rc, gpu=gpu,
103
+ solver=solver.split("MPC solver: ")[-1] if "MPC solver: " in solver else solver or None)
104
+
105
+ def sampler(stop):
106
+ """Job CPU use from its cgroup, as busy cores, every SAMPLE_S."""
107
+ try:
108
+ with open("/proc/self/cgroup") as f:
109
+ path = "/sys/fs/cgroup" + f.read().strip().split(":")[-1] + "/cpu.stat"
110
+ prev = None
111
+ while not stop.wait(SAMPLE_S if prev else 0):
112
+ with open(path) as f:
113
+ use = next(int(ln.split()[1]) for ln in f if ln.startswith("usage_usec"))
114
+ now = time.time()
115
+ if prev:
116
+ log(ev="cpu", busy_cores=round((use - prev[0]) / 1e6 / (now - prev[1]), 2))
117
+ prev = (use, now)
118
+ except (OSError, StopIteration, ValueError):
119
+ pass
120
+
121
+ def gpu_sampler(stop):
122
+ """GPU utilisation and memory of the job's GPUs, every SAMPLE_S."""
123
+ while not stop.wait(SAMPLE_S):
124
+ try:
125
+ p = subprocess.Popen(["nvidia-smi", "--query-gpu=utilization.gpu,memory.used", "--format=csv,noheader,nounits"],
126
+ stdout=subprocess.PIPE, stderr=subprocess.DEVNULL, text=True)
127
+ log(ev="gpu", **parse_smi(p.communicate(timeout=30)[0]))
128
+ except Exception: # no driver or a hung query: skip this sample
129
+ pass
130
+
131
+ cores = len(os.sched_getaffinity(0)) if hasattr(os, "sched_getaffinity") else os.cpu_count()
132
+ log(ev="launch", workers=a.workers, cores=cores)
133
+ stop = threading.Event()
134
+ threads = [threading.Thread(target=worker, args=(i,)) for i in range(a.workers)]
135
+ samplers = [sampler] + ([gpu_sampler] if a.gpus else [])
136
+ for t in threads + [threading.Thread(target=f, args=(stop,), daemon=True) for f in samplers]:
137
+ t.start()
138
+ for t in threads:
139
+ t.join()
140
+ stop.set()
141
+ log(ev="done")
142
+
143
+
144
+ if __name__ == "__main__":
145
+ main()
results/jobs/20261009-100135-large-ilqr-fast/gautschi/1/sbatch.sh ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ #!/bin/bash
2
+ #SBATCH -p highmem -A lilly-rob1 -N 1 -n 1 -c 192 --time 177 -J AutoSim-large-large-ilqr-fast-2 --comment 20261009-100135-large-ilqr-fast -o AutoSim/jobs/20261009-100135-large-ilqr-fast/1/slurm-%j.out
3
+ W=/dev/shm/AutoSim-$SLURM_JOB_ID
4
+ trap 'rm -rf "$W"' EXIT
5
+ python3 $HOME/AutoSim/jobs/20261009-100135-large-ilqr-fast/1/gautschi_launch.py --episodes $HOME/AutoSim/jobs/20261009-100135-large-ilqr-fast/1/episodes.json --out /scratch/gautschi/manors/AutoSim/out/20261009-100135-large-ilqr-fast --sif $HOME/AutoSim/images/AutoSim-99d206f40cb1.sif --engine $HOME/AutoSim/engine/ded6f8168dff9c052caad6fa1d16ca257ed3716e49b4cd161aa09ae1c01f4af8 --stack $HOME/AutoSim/stacks/04b9fd4babb22ac6bc9054b48914fd04cb4b0fdd0f061e9143868303fd91b22f --workers 96 --work $W --timeline $HOME/AutoSim/jobs/20261009-100135-large-ilqr-fast/1/timeline.jsonl --done $HOME/AutoSim/jobs/20261009-100135-large-ilqr-fast/1/done.txt
results/jobs/20261009-100135-large-ilqr-fast/gautschi/2/done.txt ADDED
The diff for this file is too large to render. See raw diff
 
results/jobs/20261009-100135-large-ilqr-fast/gautschi/2/episodes.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8c772ac5846fbdee8047ad7db5cb24ec394d2377e4cee37f6c9549a77efedef2
3
+ size 13433461
results/jobs/20261009-100135-large-ilqr-fast/gautschi/2/gautschi_launch.py ADDED
@@ -0,0 +1,145 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Runs on a Gautschi node (stdlib only): episodes from a queue in parallel workers, one contained Apptainer per episode."""
2
+ import argparse
3
+ import json
4
+ import os
5
+ import queue
6
+ import shutil
7
+ import subprocess
8
+ import threading
9
+ import time
10
+
11
+ RUN = ("source /opt/ros/humble/setup.bash && source /ws/install/setup.bash"
12
+ " && python3 -m simnode.batch /batch.json /out")
13
+ CUDA_LIB = "/ws/mpc_cuda/libmpc_cuda.so" # built per stack by runner/gautschi.build_stack for gautschi-gpu
14
+ SAMPLE_S = 15
15
+ STAGGER_S = 0.25 # between worker starts: the dev job's one error was a stack starved in the 96-way start burst
16
+ EPISODE_TIMEOUT_S = 1200 # about 4x the slowest lap; a killed episode has no outcome and is retried by the host
17
+
18
+
19
+ def worker_cmd(i, work, out, ep, sif, engine, stack, gpu=None):
20
+ """Private /tmp, HOME, /dev/shm, IPC, PIDs and loopback per episode, plus a distinct ROS_DOMAIN_ID per worker;
21
+ gpu (a host CUDA device) adds the driver and the stack's CUDA MPC kernel."""
22
+ cuda = ["--nv", "--env", f"CUDA_VISIBLE_DEVICES={gpu}", "--env", f"MPC_CUDA_LIB={CUDA_LIB}"] if gpu is not None else []
23
+ if gpu is None and os.path.exists(os.path.join(stack, "mpc_cuda", "libmpc_cuda.so")):
24
+ cuda = ["--env", f"MPC_CUDA_LIB={CUDA_LIB}"] # CPU node: the library's native iLQR solve still loads; its MPPI falls back to numpy
25
+ return ["apptainer", "exec", *cuda, "--contain", "--cleanenv", "--ipc", "--pid", "--net", "--network", "none", "--workdir", work,
26
+ "--env", f"ROS_DOMAIN_ID={i + 1}", "--env", "ROS_HOME=/tmp/ros", "--env", "TMPDIR=/tmp",
27
+ "--bind", f"{engine}:/opt/sim:ro", "--bind", f"{stack}:/ws:ro", "--bind", f"{out}:/out",
28
+ "--bind", f"{ep}:/batch.json:ro", sif, "bash", "-lc", RUN]
29
+
30
+
31
+ def parse_smi(text):
32
+ """nvidia-smi 'utilization.gpu, memory.used' csv rows to per-GPU lists."""
33
+ rows = [[int(v) for v in ln.split(",")] for ln in text.strip().splitlines() if ln.strip()]
34
+ return {"gpu_util": [r[0] for r in rows], "gpu_mem_mib": [r[1] for r in rows]}
35
+
36
+
37
+ def _solver(logdir):
38
+ """pathfinder's 'MPC solver: ...' and CUDA fallback lines from the episode's ROS logs."""
39
+ lines = []
40
+ for dp, _, fns in os.walk(logdir):
41
+ for fn in fns:
42
+ try:
43
+ with open(os.path.join(dp, fn), errors="replace") as f:
44
+ lines += [ln.strip() for ln in f if "MPC solver:" in ln or "CUDA MPC unavailable" in ln]
45
+ except OSError:
46
+ pass
47
+ return "\n".join(dict.fromkeys(lines))
48
+
49
+
50
+ def main(argv=None):
51
+ p = argparse.ArgumentParser()
52
+ for a in ("episodes", "out", "sif", "engine", "stack", "work", "timeline", "done"):
53
+ p.add_argument("--" + a, required=True)
54
+ p.add_argument("--workers", type=int, required=True)
55
+ p.add_argument("--gpus", type=int, default=0)
56
+ a = p.parse_args(argv)
57
+ with open(a.episodes) as f:
58
+ q = queue.Queue()
59
+ for e in json.load(f): # the host already ordered them, longest first
60
+ q.put(e)
61
+ os.makedirs(a.out, exist_ok=True)
62
+ lock, t0 = threading.Lock(), time.time()
63
+ devs = [d for d in os.environ.get("CUDA_VISIBLE_DEVICES", "").split(",") if d][:a.gpus] or [str(n) for n in range(a.gpus)]
64
+
65
+ def log(**ev):
66
+ with lock, open(a.timeline, "a") as f:
67
+ f.write(json.dumps(dict(ev, t=round(time.time() - t0, 3))) + "\n")
68
+
69
+ def worker(i):
70
+ time.sleep(i * STAGGER_S)
71
+ while True:
72
+ try:
73
+ e = q.get_nowait()
74
+ except queue.Empty:
75
+ return
76
+ key, work = e["key"], os.path.join(a.work, e["key"])
77
+ stage, ep = os.path.join(work, "stage"), os.path.join(work, "ep.json")
78
+ os.makedirs(stage)
79
+ with open(ep, "w") as f:
80
+ json.dump([e], f)
81
+ log(ev="start", key=key, worker=i)
82
+ gpu = devs[i % len(devs)] if devs and e["resolved"].get("recipe", {}).get("sim", {}).get("cuda") else None
83
+ limit = EPISODE_TIMEOUT_S * max(1, e["resolved"]["scenario"].get("laps", 1)) # per lap: 5-lap episodes run 5x longer
84
+ try:
85
+ rc = subprocess.run(worker_cmd(i, work, stage, ep, a.sif, a.engine, a.stack, gpu), stdout=subprocess.DEVNULL,
86
+ stderr=subprocess.DEVNULL, timeout=limit).returncode
87
+ except subprocess.TimeoutExpired:
88
+ rc = "timeout"
89
+ solver = _solver(os.path.join(work, "tmp", "ros", "log"))
90
+ if solver and os.path.isdir(os.path.join(stage, key)):
91
+ with open(os.path.join(stage, key, "solver.txt"), "w") as f:
92
+ f.write(solver + "\n")
93
+ if os.path.exists(os.path.join(stage, key, "outcome.json")):
94
+ tmp, dst = os.path.join(a.out, ".tmp-" + key), os.path.join(a.out, key)
95
+ shutil.rmtree(tmp, ignore_errors=True)
96
+ shutil.copytree(os.path.join(stage, key), tmp)
97
+ shutil.rmtree(dst, ignore_errors=True)
98
+ os.rename(tmp, dst) # the host's rsync sees a key only once its directory is complete
99
+ with lock, open(a.done, "a") as f:
100
+ f.write(key + "\n")
101
+ shutil.rmtree(work, ignore_errors=True)
102
+ log(ev="end", key=key, worker=i, rc=rc, gpu=gpu,
103
+ solver=solver.split("MPC solver: ")[-1] if "MPC solver: " in solver else solver or None)
104
+
105
+ def sampler(stop):
106
+ """Job CPU use from its cgroup, as busy cores, every SAMPLE_S."""
107
+ try:
108
+ with open("/proc/self/cgroup") as f:
109
+ path = "/sys/fs/cgroup" + f.read().strip().split(":")[-1] + "/cpu.stat"
110
+ prev = None
111
+ while not stop.wait(SAMPLE_S if prev else 0):
112
+ with open(path) as f:
113
+ use = next(int(ln.split()[1]) for ln in f if ln.startswith("usage_usec"))
114
+ now = time.time()
115
+ if prev:
116
+ log(ev="cpu", busy_cores=round((use - prev[0]) / 1e6 / (now - prev[1]), 2))
117
+ prev = (use, now)
118
+ except (OSError, StopIteration, ValueError):
119
+ pass
120
+
121
+ def gpu_sampler(stop):
122
+ """GPU utilisation and memory of the job's GPUs, every SAMPLE_S."""
123
+ while not stop.wait(SAMPLE_S):
124
+ try:
125
+ p = subprocess.Popen(["nvidia-smi", "--query-gpu=utilization.gpu,memory.used", "--format=csv,noheader,nounits"],
126
+ stdout=subprocess.PIPE, stderr=subprocess.DEVNULL, text=True)
127
+ log(ev="gpu", **parse_smi(p.communicate(timeout=30)[0]))
128
+ except Exception: # no driver or a hung query: skip this sample
129
+ pass
130
+
131
+ cores = len(os.sched_getaffinity(0)) if hasattr(os, "sched_getaffinity") else os.cpu_count()
132
+ log(ev="launch", workers=a.workers, cores=cores)
133
+ stop = threading.Event()
134
+ threads = [threading.Thread(target=worker, args=(i,)) for i in range(a.workers)]
135
+ samplers = [sampler] + ([gpu_sampler] if a.gpus else [])
136
+ for t in threads + [threading.Thread(target=f, args=(stop,), daemon=True) for f in samplers]:
137
+ t.start()
138
+ for t in threads:
139
+ t.join()
140
+ stop.set()
141
+ log(ev="done")
142
+
143
+
144
+ if __name__ == "__main__":
145
+ main()
results/jobs/20261009-100135-large-ilqr-fast/gautschi/2/sbatch.sh ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ #!/bin/bash
2
+ #SBATCH -p highmem -A lilly-rob1 -N 1 -n 1 -c 192 --time 177 --dependency=afterany:16923599 -J AutoSim-large-large-ilqr-fast-3 --comment 20261009-100135-large-ilqr-fast -o AutoSim/jobs/20261009-100135-large-ilqr-fast/2/slurm-%j.out
3
+ W=/dev/shm/AutoSim-$SLURM_JOB_ID
4
+ trap 'rm -rf "$W"' EXIT
5
+ python3 $HOME/AutoSim/jobs/20261009-100135-large-ilqr-fast/2/gautschi_launch.py --episodes $HOME/AutoSim/jobs/20261009-100135-large-ilqr-fast/2/episodes.json --out /scratch/gautschi/manors/AutoSim/out/20261009-100135-large-ilqr-fast --sif $HOME/AutoSim/images/AutoSim-99d206f40cb1.sif --engine $HOME/AutoSim/engine/ded6f8168dff9c052caad6fa1d16ca257ed3716e49b4cd161aa09ae1c01f4af8 --stack $HOME/AutoSim/stacks/04b9fd4babb22ac6bc9054b48914fd04cb4b0fdd0f061e9143868303fd91b22f --workers 96 --work $W --timeline $HOME/AutoSim/jobs/20261009-100135-large-ilqr-fast/2/timeline.jsonl --done $HOME/AutoSim/jobs/20261009-100135-large-ilqr-fast/2/done.txt
results/jobs/20261009-100135-large-ilqr-fast/gautschi/3/done.txt ADDED
The diff for this file is too large to render. See raw diff
 
results/jobs/20261009-100135-large-ilqr-fast/gautschi/3/episodes.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3c0d8143428dae123e40928b7347433146b80fdbef181a06bbadfa61d0c7a36d
3
+ size 13433378
results/jobs/20261009-100135-large-ilqr-fast/gautschi/3/gautschi_launch.py ADDED
@@ -0,0 +1,145 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Runs on a Gautschi node (stdlib only): episodes from a queue in parallel workers, one contained Apptainer per episode."""
2
+ import argparse
3
+ import json
4
+ import os
5
+ import queue
6
+ import shutil
7
+ import subprocess
8
+ import threading
9
+ import time
10
+
11
+ RUN = ("source /opt/ros/humble/setup.bash && source /ws/install/setup.bash"
12
+ " && python3 -m simnode.batch /batch.json /out")
13
+ CUDA_LIB = "/ws/mpc_cuda/libmpc_cuda.so" # built per stack by runner/gautschi.build_stack for gautschi-gpu
14
+ SAMPLE_S = 15
15
+ STAGGER_S = 0.25 # between worker starts: the dev job's one error was a stack starved in the 96-way start burst
16
+ EPISODE_TIMEOUT_S = 1200 # about 4x the slowest lap; a killed episode has no outcome and is retried by the host
17
+
18
+
19
+ def worker_cmd(i, work, out, ep, sif, engine, stack, gpu=None):
20
+ """Private /tmp, HOME, /dev/shm, IPC, PIDs and loopback per episode, plus a distinct ROS_DOMAIN_ID per worker;
21
+ gpu (a host CUDA device) adds the driver and the stack's CUDA MPC kernel."""
22
+ cuda = ["--nv", "--env", f"CUDA_VISIBLE_DEVICES={gpu}", "--env", f"MPC_CUDA_LIB={CUDA_LIB}"] if gpu is not None else []
23
+ if gpu is None and os.path.exists(os.path.join(stack, "mpc_cuda", "libmpc_cuda.so")):
24
+ cuda = ["--env", f"MPC_CUDA_LIB={CUDA_LIB}"] # CPU node: the library's native iLQR solve still loads; its MPPI falls back to numpy
25
+ return ["apptainer", "exec", *cuda, "--contain", "--cleanenv", "--ipc", "--pid", "--net", "--network", "none", "--workdir", work,
26
+ "--env", f"ROS_DOMAIN_ID={i + 1}", "--env", "ROS_HOME=/tmp/ros", "--env", "TMPDIR=/tmp",
27
+ "--bind", f"{engine}:/opt/sim:ro", "--bind", f"{stack}:/ws:ro", "--bind", f"{out}:/out",
28
+ "--bind", f"{ep}:/batch.json:ro", sif, "bash", "-lc", RUN]
29
+
30
+
31
+ def parse_smi(text):
32
+ """nvidia-smi 'utilization.gpu, memory.used' csv rows to per-GPU lists."""
33
+ rows = [[int(v) for v in ln.split(",")] for ln in text.strip().splitlines() if ln.strip()]
34
+ return {"gpu_util": [r[0] for r in rows], "gpu_mem_mib": [r[1] for r in rows]}
35
+
36
+
37
+ def _solver(logdir):
38
+ """pathfinder's 'MPC solver: ...' and CUDA fallback lines from the episode's ROS logs."""
39
+ lines = []
40
+ for dp, _, fns in os.walk(logdir):
41
+ for fn in fns:
42
+ try:
43
+ with open(os.path.join(dp, fn), errors="replace") as f:
44
+ lines += [ln.strip() for ln in f if "MPC solver:" in ln or "CUDA MPC unavailable" in ln]
45
+ except OSError:
46
+ pass
47
+ return "\n".join(dict.fromkeys(lines))
48
+
49
+
50
+ def main(argv=None):
51
+ p = argparse.ArgumentParser()
52
+ for a in ("episodes", "out", "sif", "engine", "stack", "work", "timeline", "done"):
53
+ p.add_argument("--" + a, required=True)
54
+ p.add_argument("--workers", type=int, required=True)
55
+ p.add_argument("--gpus", type=int, default=0)
56
+ a = p.parse_args(argv)
57
+ with open(a.episodes) as f:
58
+ q = queue.Queue()
59
+ for e in json.load(f): # the host already ordered them, longest first
60
+ q.put(e)
61
+ os.makedirs(a.out, exist_ok=True)
62
+ lock, t0 = threading.Lock(), time.time()
63
+ devs = [d for d in os.environ.get("CUDA_VISIBLE_DEVICES", "").split(",") if d][:a.gpus] or [str(n) for n in range(a.gpus)]
64
+
65
+ def log(**ev):
66
+ with lock, open(a.timeline, "a") as f:
67
+ f.write(json.dumps(dict(ev, t=round(time.time() - t0, 3))) + "\n")
68
+
69
+ def worker(i):
70
+ time.sleep(i * STAGGER_S)
71
+ while True:
72
+ try:
73
+ e = q.get_nowait()
74
+ except queue.Empty:
75
+ return
76
+ key, work = e["key"], os.path.join(a.work, e["key"])
77
+ stage, ep = os.path.join(work, "stage"), os.path.join(work, "ep.json")
78
+ os.makedirs(stage)
79
+ with open(ep, "w") as f:
80
+ json.dump([e], f)
81
+ log(ev="start", key=key, worker=i)
82
+ gpu = devs[i % len(devs)] if devs and e["resolved"].get("recipe", {}).get("sim", {}).get("cuda") else None
83
+ limit = EPISODE_TIMEOUT_S * max(1, e["resolved"]["scenario"].get("laps", 1)) # per lap: 5-lap episodes run 5x longer
84
+ try:
85
+ rc = subprocess.run(worker_cmd(i, work, stage, ep, a.sif, a.engine, a.stack, gpu), stdout=subprocess.DEVNULL,
86
+ stderr=subprocess.DEVNULL, timeout=limit).returncode
87
+ except subprocess.TimeoutExpired:
88
+ rc = "timeout"
89
+ solver = _solver(os.path.join(work, "tmp", "ros", "log"))
90
+ if solver and os.path.isdir(os.path.join(stage, key)):
91
+ with open(os.path.join(stage, key, "solver.txt"), "w") as f:
92
+ f.write(solver + "\n")
93
+ if os.path.exists(os.path.join(stage, key, "outcome.json")):
94
+ tmp, dst = os.path.join(a.out, ".tmp-" + key), os.path.join(a.out, key)
95
+ shutil.rmtree(tmp, ignore_errors=True)
96
+ shutil.copytree(os.path.join(stage, key), tmp)
97
+ shutil.rmtree(dst, ignore_errors=True)
98
+ os.rename(tmp, dst) # the host's rsync sees a key only once its directory is complete
99
+ with lock, open(a.done, "a") as f:
100
+ f.write(key + "\n")
101
+ shutil.rmtree(work, ignore_errors=True)
102
+ log(ev="end", key=key, worker=i, rc=rc, gpu=gpu,
103
+ solver=solver.split("MPC solver: ")[-1] if "MPC solver: " in solver else solver or None)
104
+
105
+ def sampler(stop):
106
+ """Job CPU use from its cgroup, as busy cores, every SAMPLE_S."""
107
+ try:
108
+ with open("/proc/self/cgroup") as f:
109
+ path = "/sys/fs/cgroup" + f.read().strip().split(":")[-1] + "/cpu.stat"
110
+ prev = None
111
+ while not stop.wait(SAMPLE_S if prev else 0):
112
+ with open(path) as f:
113
+ use = next(int(ln.split()[1]) for ln in f if ln.startswith("usage_usec"))
114
+ now = time.time()
115
+ if prev:
116
+ log(ev="cpu", busy_cores=round((use - prev[0]) / 1e6 / (now - prev[1]), 2))
117
+ prev = (use, now)
118
+ except (OSError, StopIteration, ValueError):
119
+ pass
120
+
121
+ def gpu_sampler(stop):
122
+ """GPU utilisation and memory of the job's GPUs, every SAMPLE_S."""
123
+ while not stop.wait(SAMPLE_S):
124
+ try:
125
+ p = subprocess.Popen(["nvidia-smi", "--query-gpu=utilization.gpu,memory.used", "--format=csv,noheader,nounits"],
126
+ stdout=subprocess.PIPE, stderr=subprocess.DEVNULL, text=True)
127
+ log(ev="gpu", **parse_smi(p.communicate(timeout=30)[0]))
128
+ except Exception: # no driver or a hung query: skip this sample
129
+ pass
130
+
131
+ cores = len(os.sched_getaffinity(0)) if hasattr(os, "sched_getaffinity") else os.cpu_count()
132
+ log(ev="launch", workers=a.workers, cores=cores)
133
+ stop = threading.Event()
134
+ threads = [threading.Thread(target=worker, args=(i,)) for i in range(a.workers)]
135
+ samplers = [sampler] + ([gpu_sampler] if a.gpus else [])
136
+ for t in threads + [threading.Thread(target=f, args=(stop,), daemon=True) for f in samplers]:
137
+ t.start()
138
+ for t in threads:
139
+ t.join()
140
+ stop.set()
141
+ log(ev="done")
142
+
143
+
144
+ if __name__ == "__main__":
145
+ main()
results/jobs/20261009-100135-large-ilqr-fast/gautschi/3/sbatch.sh ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ #!/bin/bash
2
+ #SBATCH -p highmem -A lilly-rob1 -N 1 -n 1 -c 192 --time 177 --dependency=afterany:16923600 -J AutoSim-large-large-ilqr-fast-4 --comment 20261009-100135-large-ilqr-fast -o AutoSim/jobs/20261009-100135-large-ilqr-fast/3/slurm-%j.out
3
+ W=/dev/shm/AutoSim-$SLURM_JOB_ID
4
+ trap 'rm -rf "$W"' EXIT
5
+ python3 $HOME/AutoSim/jobs/20261009-100135-large-ilqr-fast/3/gautschi_launch.py --episodes $HOME/AutoSim/jobs/20261009-100135-large-ilqr-fast/3/episodes.json --out /scratch/gautschi/manors/AutoSim/out/20261009-100135-large-ilqr-fast --sif $HOME/AutoSim/images/AutoSim-99d206f40cb1.sif --engine $HOME/AutoSim/engine/ded6f8168dff9c052caad6fa1d16ca257ed3716e49b4cd161aa09ae1c01f4af8 --stack $HOME/AutoSim/stacks/04b9fd4babb22ac6bc9054b48914fd04cb4b0fdd0f061e9143868303fd91b22f --workers 96 --work $W --timeline $HOME/AutoSim/jobs/20261009-100135-large-ilqr-fast/3/timeline.jsonl --done $HOME/AutoSim/jobs/20261009-100135-large-ilqr-fast/3/done.txt
results/jobs/20261009-100135-large-ilqr-fast/job.json ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "id": "20261009-100135-large-ilqr-fast",
3
+ "tier": "large",
4
+ "tier_version": 3,
5
+ "recipe": {
6
+ "name": "large-ilqr-fast",
7
+ "source": {
8
+ "repo": "AutonomousKart",
9
+ "ref": "worktree:ilqr-fast"
10
+ },
11
+ "params": {
12
+ "pathfinder_node": {
13
+ "planner": "ilqr",
14
+ "mpc.num_samples": 16
15
+ }
16
+ },
17
+ "sim": {},
18
+ "notes": "Gradient MPC (tuned iLQR) on the best stack; telemetry MPPI at 16 samples (iLQR never reads it)"
19
+ },
20
+ "user": "shay",
21
+ "notes": "large v3: gradient MPC (tuned iLQR, numpy fallback on highmem) on the best stack",
22
+ "where": "gautschi",
23
+ "status": "done",
24
+ "submitted_at": "2026-10-09T14:01:35.060+00:00",
25
+ "started_at": "2026-10-09T14:01:35.061+00:00",
26
+ "finished_at": "2026-10-10T01:23:26.136+00:00",
27
+ "total": 32076,
28
+ "done": 32076,
29
+ "errors": 0,
30
+ "build_log": null,
31
+ "workers": 96,
32
+ "slurm_id": "16923599",
33
+ "slurm_ids": [
34
+ "16923599",
35
+ "16923600",
36
+ "16923601",
37
+ "16923602"
38
+ ],
39
+ "engine_version": "ded6f8168dff9c052caad6fa1d16ca257ed3716e49b4cd161aa09ae1c01f4af8"
40
+ }
results/jobs/20261009-100135-large-ilqr-fast/logs/shard-0000.jsonl.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9c3f320c6b8d328c6dfbc88cecc9f28a791b39c6be2ad87694bf8d114f282516
3
+ size 18842858
results/jobs/20261009-100135-large-ilqr-fast/logs/shard-0001.jsonl.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6b3947948b7bf71923b8459467f791187ad4b99fdeca329cf14611132680721b
3
+ size 107358809
results/jobs/20261009-100135-large-ilqr-fast/logs/shard-0002.jsonl.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:da26bfd395997b37cb3efa69432dbf097d76f3a180e96ad01f22b731ff63e162
3
+ size 314409531
results/jobs/20261009-100135-large-ilqr-fast/logs/shard-0003.jsonl.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ac486fc90e18df20ed52095f5d1e0b4ae8349be23dd2dfaa35ee2e539452fce3
3
+ size 364860132
results/jobs/20261009-100135-large-ilqr-fast/logs/shard-0004.jsonl.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3169590106e37fc56f8edb670eee2f8ada3340a17f59b7f8ac13720f6bc06a72
3
+ size 456384060
results/jobs/20261009-100135-large-ilqr-fast/logs/shard-0005.jsonl.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:accebd83c6065533199fdb1d019b4d98bc4dd8b52f7818e0799fbd18718c15de
3
+ size 355331630
results/jobs/20261009-100135-large-ilqr-fast/logs/shard-0006.jsonl.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e0ee463649ae8dde0cfac05722a3c7a0618c5280cda302b8902ab0cc6d5b031e
3
+ size 337630590
results/jobs/20261009-100135-large-ilqr-fast/logs/shard-0007.jsonl.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9882aed66af61eb9ad130d1769eb856df09c53c75d169b953dd70fd8bc9dcb6c
3
+ size 324962987
results/jobs/20261009-100135-large-ilqr-fast/logs/shard-0008.jsonl.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:db87ed7c7fb8d742132bf5dce938bceb84584e8f78d4deb1e82680fb19ccc52e
3
+ size 335266395
results/jobs/20261009-100135-large-ilqr-fast/logs/shard-0009.jsonl.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d6feb98cfbff88c7200420b4ea6179545f55ccf13fd3b2641d11f004940d7a58
3
+ size 290342768
results/jobs/20261009-100135-large-ilqr-fast/logs/shard-0010.jsonl.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:871916e7d50ecdb3563e3db4adc356c0c81cd0afb07b74bd833cbc8a0f665f61
3
+ size 134541819
results/jobs/20261009-100135-large-ilqr-fast/logs/shard-0011.jsonl.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:91ed8e8d047a4db36dbbe20f439f3b0e86a909adecea4941353baba9cb6d6e44
3
+ size 157734045
results/jobs/20261009-100135-large-ilqr-fast/logs/shard-0012.jsonl.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7ab2d63f14180b249a3ff85d6b7c8c8f8b32dcf5c4401d7fecc87ac8af3d2dec
3
+ size 226257026
results/jobs/20261009-100135-large-ilqr-fast/logs/shard-0013.jsonl.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:befb735a9f098441db8350c79f6514576a666b85cb336c7728478da0dafa90c8
3
+ size 164634585
results/jobs/20261009-100135-large-ilqr-fast/logs/shard-0014.jsonl.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ab4a1234804979372a1d0a0a60690f4c7b1da0fd23a1042c2a8a8f292aa85655
3
+ size 303342727
results/jobs/20261009-100135-large-ilqr-fast/logs/shard-0015.jsonl.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:77e8de1679473553a8972a037b52efb520b91a6c4cf8180b2bc71fbaaeaf5424
3
+ size 174714732
results/jobs/20261009-100135-large-ilqr-fast/logs/shard-0016.jsonl.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:415f53987b6b6a8a96f6080f6f5ba874a16499fca5b19b91cd16d59e5050b419
3
+ size 32568242
results/jobs/20261009-100135-large-ilqr-fast/logs/shard-0017.jsonl.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b629a027b55ab571e9bda9797980fda566523a8f4c3eba870d366b5e3f4c3110
3
+ size 75560388
results/jobs/20261009-100135-large-ilqr-fast/logs/shard-0018.jsonl.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c02d060142f0326e220a145b228e879804d0cae956a04e1022c9cff51857bd79
3
+ size 80787831
results/jobs/20261009-100135-large-ilqr-fast/logs/shard-0019.jsonl.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3ae9aa4f7c405e4a47af73a71c6f2439f24dd71c9ddf9dfb4cf56d9c95283b77
3
+ size 69176386
results/jobs/20261009-100135-large-ilqr-fast/logs/shard-0020.jsonl.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:89bc2f009fe8cf2575f17202925f1f493b2f7dddf244c590e965e5d0dc54272a
3
+ size 93170810
results/jobs/20261009-100135-large-ilqr-fast/logs/shard-0021.jsonl.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d483ede8e2d29dabb210423b4fc17c4148a19e44152f4cdb676767ff35502f7c
3
+ size 28809492
results/jobs/20261009-100135-large-ilqr-fast/logs/shard-0022.jsonl.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fffec694fac123055d3d0f5b7af0f419f95fe5f0d727ff512508066e0c19088c
3
+ size 73967512
results/jobs/20261009-100135-large-ilqr-fast/logs/shard-0023.jsonl.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:db4015f19d62942c869856b6746fa93433bbe597a44adc83e7491a16208ff7bd
3
+ size 35952388
results/jobs/20261009-100135-large-ilqr-fast/logs/shard-0024.jsonl.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8ab26073b4f910479f869858a26b1b3e24d47da89cf0e6adaa0ceadd6de8745f
3
+ size 47947422
results/jobs/20261009-100135-large-ilqr-fast/logs/shard-0025.jsonl.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5de9208fd5aab183630b965d5eba43f5f4b8706eed24e7c821d5bf6b6832cc57
3
+ size 75548366
results/jobs/20261009-100135-large-ilqr-fast/logs/shard-0026.jsonl.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:09d0784ab1c5a45434bb47591a44664ccbde6b5da118f7d2e8c199f45f5971a2
3
+ size 74757634
results/jobs/20261009-100135-large-ilqr-fast/logs/shard-0027.jsonl.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a07a98db9edaf120c85fc4ec3f00fe215e3a613b3cfef2ac177968318940e7ba
3
+ size 20796442
results/jobs/20261009-100135-large-ilqr-fast/logs/shard-0028.jsonl.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7504655a6eba709789ed68759df00858ce00d2b5dff18a9a3089c217fa0818dd
3
+ size 66980447