ShayManor commited on
Commit
043ff19
·
verified ·
1 Parent(s): 802f49e

results: jobs/20261008-135505-best-stack/** 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 +3 -0
  2. results/index/episodes.jsonl +0 -0
  3. results/jobs/20261008-135505-best-stack/breakdown.json +0 -0
  4. results/jobs/20261008-135505-best-stack/episodes.jsonl +3 -0
  5. results/jobs/20261008-135505-best-stack/gautschi/0/done.txt +0 -0
  6. results/jobs/20261008-135505-best-stack/gautschi/0/episodes.json +3 -0
  7. results/jobs/20261008-135505-best-stack/gautschi/0/gautschi_launch.py +143 -0
  8. results/jobs/20261008-135505-best-stack/gautschi/0/sbatch.sh +5 -0
  9. results/jobs/20261008-135505-best-stack/gautschi/1/done.txt +0 -0
  10. results/jobs/20261008-135505-best-stack/gautschi/1/episodes.json +3 -0
  11. results/jobs/20261008-135505-best-stack/gautschi/1/gautschi_launch.py +143 -0
  12. results/jobs/20261008-135505-best-stack/gautschi/1/sbatch.sh +5 -0
  13. results/jobs/20261008-135505-best-stack/job.json +37 -0
  14. results/jobs/20261008-135505-best-stack/logs/shard-0000.jsonl.gz +3 -0
  15. results/jobs/20261008-135505-best-stack/logs/shard-0001.jsonl.gz +3 -0
  16. results/jobs/20261008-135505-best-stack/logs/shard-0002.jsonl.gz +3 -0
  17. results/jobs/20261008-135505-best-stack/logs/shard-0003.jsonl.gz +3 -0
  18. results/jobs/20261008-135505-best-stack/logs/shard-0004.jsonl.gz +3 -0
  19. results/jobs/20261008-135505-best-stack/logs/shard-0005.jsonl.gz +3 -0
  20. results/jobs/20261008-135505-best-stack/logs/shard-0006.jsonl.gz +3 -0
  21. results/jobs/20261008-135505-best-stack/logs/shard-0007.jsonl.gz +3 -0
  22. results/jobs/20261008-135505-best-stack/logs/shard-0008.jsonl.gz +3 -0
  23. results/jobs/20261008-135505-best-stack/logs/shard-0009.jsonl.gz +3 -0
  24. results/jobs/20261008-135505-best-stack/logs/shard-0010.jsonl.gz +3 -0
  25. results/jobs/20261008-135505-best-stack/logs/shard-0011.jsonl.gz +3 -0
  26. results/jobs/20261008-135505-best-stack/logs/shard-0012.jsonl.gz +3 -0
  27. results/jobs/20261008-135505-best-stack/logs/shard-0013.jsonl.gz +3 -0
  28. results/jobs/20261008-135505-best-stack/logs/shard-0014.jsonl.gz +3 -0
  29. results/jobs/20261008-135505-best-stack/logs/shard-0015.jsonl.gz +3 -0
  30. results/jobs/20261008-135505-best-stack/logs/shard-0016.jsonl.gz +3 -0
  31. results/jobs/20261008-135505-best-stack/logs/shard-0017.jsonl.gz +3 -0
  32. results/jobs/20261008-135505-best-stack/logs/shard-0018.jsonl.gz +3 -0
  33. results/jobs/20261008-135505-best-stack/logs/shard-0019.jsonl.gz +3 -0
  34. results/jobs/20261008-135505-best-stack/logs/shard-0020.jsonl.gz +3 -0
  35. results/jobs/20261008-135505-best-stack/logs/shard-0021.jsonl.gz +3 -0
  36. results/jobs/20261008-135505-best-stack/logs/shard-0022.jsonl.gz +3 -0
  37. results/jobs/20261008-135505-best-stack/logs/shard-0023.jsonl.gz +3 -0
  38. results/jobs/20261008-135505-best-stack/logs/shard-0024.jsonl.gz +3 -0
  39. results/jobs/20261008-135505-best-stack/logs/shard-0025.jsonl.gz +3 -0
  40. results/jobs/20261008-135505-best-stack/logs/shard-0026.jsonl.gz +3 -0
  41. results/jobs/20261008-135505-best-stack/logs/shard-0027.jsonl.gz +3 -0
  42. results/jobs/20261008-135505-best-stack/logs/shard-0028.jsonl.gz +3 -0
  43. results/jobs/20261008-135505-best-stack/logs/shard-0029.jsonl.gz +3 -0
  44. results/jobs/20261008-135505-best-stack/logs/shard-0030.jsonl.gz +3 -0
  45. results/jobs/20261008-135505-best-stack/logs/shard-0031.jsonl.gz +3 -0
  46. results/jobs/20261008-135505-best-stack/logs/shard-0032.jsonl.gz +3 -0
  47. results/jobs/20261008-135505-best-stack/logs/shard-0033.jsonl.gz +3 -0
  48. results/jobs/20261008-135505-best-stack/logs/shard-0034.jsonl.gz +3 -0
  49. results/jobs/20261008-135505-best-stack/logs/shard-0035.jsonl.gz +3 -0
  50. results/jobs/20261008-135505-best-stack/logs/shard-0036.jsonl.gz +3 -0
.gitattributes CHANGED
@@ -60,3 +60,6 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
60
  *.webm filter=lfs diff=lfs merge=lfs -text
61
  results/jobs/20261006-100132-pure-pursuit/episodes.jsonl filter=lfs diff=lfs merge=lfs -text
62
  results/jobs/20261006-203943-pure-pursuit/episodes.jsonl filter=lfs diff=lfs merge=lfs -text
 
 
 
 
60
  *.webm filter=lfs diff=lfs merge=lfs -text
61
  results/jobs/20261006-100132-pure-pursuit/episodes.jsonl filter=lfs diff=lfs merge=lfs -text
62
  results/jobs/20261006-203943-pure-pursuit/episodes.jsonl 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
results/index/episodes.jsonl CHANGED
The diff for this file is too large to render. See raw diff
 
results/jobs/20261008-135505-best-stack/breakdown.json ADDED
The diff for this file is too large to render. See raw diff
 
results/jobs/20261008-135505-best-stack/episodes.jsonl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b7b30aab269b6b929000c66b01f9337821eebee6dbdb80e3ecd4166a4de0034d
3
+ size 93311328
results/jobs/20261008-135505-best-stack/gautschi/0/done.txt ADDED
The diff for this file is too large to render. See raw diff
 
results/jobs/20261008-135505-best-stack/gautschi/0/episodes.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1593d525b4ce2f6c79dd22c71ec9c5ae232955cba90ab9602e905ccf96db1988
3
+ size 12317536
results/jobs/20261008-135505-best-stack/gautschi/0/gautschi_launch.py ADDED
@@ -0,0 +1,143 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ return ["apptainer", "exec", *cuda, "--contain", "--cleanenv", "--ipc", "--pid", "--net", "--network", "none", "--workdir", work,
24
+ "--env", f"ROS_DOMAIN_ID={i + 1}", "--env", "ROS_HOME=/tmp/ros", "--env", "TMPDIR=/tmp",
25
+ "--bind", f"{engine}:/opt/sim:ro", "--bind", f"{stack}:/ws:ro", "--bind", f"{out}:/out",
26
+ "--bind", f"{ep}:/batch.json:ro", sif, "bash", "-lc", RUN]
27
+
28
+
29
+ def parse_smi(text):
30
+ """nvidia-smi 'utilization.gpu, memory.used' csv rows to per-GPU lists."""
31
+ rows = [[int(v) for v in ln.split(",")] for ln in text.strip().splitlines() if ln.strip()]
32
+ return {"gpu_util": [r[0] for r in rows], "gpu_mem_mib": [r[1] for r in rows]}
33
+
34
+
35
+ def _solver(logdir):
36
+ """pathfinder's 'MPC solver: ...' and CUDA fallback lines from the episode's ROS logs."""
37
+ lines = []
38
+ for dp, _, fns in os.walk(logdir):
39
+ for fn in fns:
40
+ try:
41
+ with open(os.path.join(dp, fn), errors="replace") as f:
42
+ lines += [ln.strip() for ln in f if "MPC solver:" in ln or "CUDA MPC unavailable" in ln]
43
+ except OSError:
44
+ pass
45
+ return "\n".join(dict.fromkeys(lines))
46
+
47
+
48
+ def main(argv=None):
49
+ p = argparse.ArgumentParser()
50
+ for a in ("episodes", "out", "sif", "engine", "stack", "work", "timeline", "done"):
51
+ p.add_argument("--" + a, required=True)
52
+ p.add_argument("--workers", type=int, required=True)
53
+ p.add_argument("--gpus", type=int, default=0)
54
+ a = p.parse_args(argv)
55
+ with open(a.episodes) as f:
56
+ q = queue.Queue()
57
+ for e in json.load(f): # the host already ordered them, longest first
58
+ q.put(e)
59
+ os.makedirs(a.out, exist_ok=True)
60
+ lock, t0 = threading.Lock(), time.time()
61
+ 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)]
62
+
63
+ def log(**ev):
64
+ with lock, open(a.timeline, "a") as f:
65
+ f.write(json.dumps(dict(ev, t=round(time.time() - t0, 3))) + "\n")
66
+
67
+ def worker(i):
68
+ time.sleep(i * STAGGER_S)
69
+ while True:
70
+ try:
71
+ e = q.get_nowait()
72
+ except queue.Empty:
73
+ return
74
+ key, work = e["key"], os.path.join(a.work, e["key"])
75
+ stage, ep = os.path.join(work, "stage"), os.path.join(work, "ep.json")
76
+ os.makedirs(stage)
77
+ with open(ep, "w") as f:
78
+ json.dump([e], f)
79
+ log(ev="start", key=key, worker=i)
80
+ gpu = devs[i % len(devs)] if devs and e["resolved"].get("recipe", {}).get("sim", {}).get("cuda") else None
81
+ limit = EPISODE_TIMEOUT_S * max(1, e["resolved"]["scenario"].get("laps", 1)) # per lap: 5-lap episodes run 5x longer
82
+ try:
83
+ rc = subprocess.run(worker_cmd(i, work, stage, ep, a.sif, a.engine, a.stack, gpu), stdout=subprocess.DEVNULL,
84
+ stderr=subprocess.DEVNULL, timeout=limit).returncode
85
+ except subprocess.TimeoutExpired:
86
+ rc = "timeout"
87
+ solver = _solver(os.path.join(work, "tmp", "ros", "log"))
88
+ if solver and os.path.isdir(os.path.join(stage, key)):
89
+ with open(os.path.join(stage, key, "solver.txt"), "w") as f:
90
+ f.write(solver + "\n")
91
+ if os.path.exists(os.path.join(stage, key, "outcome.json")):
92
+ tmp, dst = os.path.join(a.out, ".tmp-" + key), os.path.join(a.out, key)
93
+ shutil.rmtree(tmp, ignore_errors=True)
94
+ shutil.copytree(os.path.join(stage, key), tmp)
95
+ shutil.rmtree(dst, ignore_errors=True)
96
+ os.rename(tmp, dst) # the host's rsync sees a key only once its directory is complete
97
+ with lock, open(a.done, "a") as f:
98
+ f.write(key + "\n")
99
+ shutil.rmtree(work, ignore_errors=True)
100
+ log(ev="end", key=key, worker=i, rc=rc, gpu=gpu,
101
+ solver=solver.split("MPC solver: ")[-1] if "MPC solver: " in solver else solver or None)
102
+
103
+ def sampler(stop):
104
+ """Job CPU use from its cgroup, as busy cores, every SAMPLE_S."""
105
+ try:
106
+ with open("/proc/self/cgroup") as f:
107
+ path = "/sys/fs/cgroup" + f.read().strip().split(":")[-1] + "/cpu.stat"
108
+ prev = None
109
+ while not stop.wait(SAMPLE_S if prev else 0):
110
+ with open(path) as f:
111
+ use = next(int(ln.split()[1]) for ln in f if ln.startswith("usage_usec"))
112
+ now = time.time()
113
+ if prev:
114
+ log(ev="cpu", busy_cores=round((use - prev[0]) / 1e6 / (now - prev[1]), 2))
115
+ prev = (use, now)
116
+ except (OSError, StopIteration, ValueError):
117
+ pass
118
+
119
+ def gpu_sampler(stop):
120
+ """GPU utilisation and memory of the job's GPUs, every SAMPLE_S."""
121
+ while not stop.wait(SAMPLE_S):
122
+ try:
123
+ p = subprocess.Popen(["nvidia-smi", "--query-gpu=utilization.gpu,memory.used", "--format=csv,noheader,nounits"],
124
+ stdout=subprocess.PIPE, stderr=subprocess.DEVNULL, text=True)
125
+ log(ev="gpu", **parse_smi(p.communicate(timeout=30)[0]))
126
+ except Exception: # no driver or a hung query: skip this sample
127
+ pass
128
+
129
+ cores = len(os.sched_getaffinity(0)) if hasattr(os, "sched_getaffinity") else os.cpu_count()
130
+ log(ev="launch", workers=a.workers, cores=cores)
131
+ stop = threading.Event()
132
+ threads = [threading.Thread(target=worker, args=(i,)) for i in range(a.workers)]
133
+ samplers = [sampler] + ([gpu_sampler] if a.gpus else [])
134
+ for t in threads + [threading.Thread(target=f, args=(stop,), daemon=True) for f in samplers]:
135
+ t.start()
136
+ for t in threads:
137
+ t.join()
138
+ stop.set()
139
+ log(ev="done")
140
+
141
+
142
+ if __name__ == "__main__":
143
+ main()
results/jobs/20261008-135505-best-stack/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 517 -J AutoSim-large-best-stack-1 --comment 20261008-135505-best-stack -o AutoSim/jobs/20261008-135505-best-stack/0/slurm-%j.out
3
+ W=/dev/shm/AutoSim-$SLURM_JOB_ID
4
+ trap 'rm -rf "$W"' EXIT
5
+ python3 $HOME/AutoSim/jobs/20261008-135505-best-stack/0/gautschi_launch.py --episodes $HOME/AutoSim/jobs/20261008-135505-best-stack/0/episodes.json --out /scratch/gautschi/manors/AutoSim/out/20261008-135505-best-stack --sif $HOME/AutoSim/images/AutoSim-99d206f40cb1.sif --engine $HOME/AutoSim/engine/9468b6d2e43b440756c4f5e2ee7b6fcd221e3f1b7d9724496e70de28f1d0cde3 --stack $HOME/AutoSim/stacks/961dd8ca8ac6ba265501f0806e8c4afcf0f719c2f1a57eddccaa419ebbc53017 --workers 96 --work $W --timeline $HOME/AutoSim/jobs/20261008-135505-best-stack/0/timeline.jsonl --done $HOME/AutoSim/jobs/20261008-135505-best-stack/0/done.txt
results/jobs/20261008-135505-best-stack/gautschi/1/done.txt ADDED
The diff for this file is too large to render. See raw diff
 
results/jobs/20261008-135505-best-stack/gautschi/1/episodes.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0104adcc4d115ab284e3f4f752fed548074a662cbcfbaea91658b77ea4b22493
3
+ size 12317732
results/jobs/20261008-135505-best-stack/gautschi/1/gautschi_launch.py ADDED
@@ -0,0 +1,143 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ return ["apptainer", "exec", *cuda, "--contain", "--cleanenv", "--ipc", "--pid", "--net", "--network", "none", "--workdir", work,
24
+ "--env", f"ROS_DOMAIN_ID={i + 1}", "--env", "ROS_HOME=/tmp/ros", "--env", "TMPDIR=/tmp",
25
+ "--bind", f"{engine}:/opt/sim:ro", "--bind", f"{stack}:/ws:ro", "--bind", f"{out}:/out",
26
+ "--bind", f"{ep}:/batch.json:ro", sif, "bash", "-lc", RUN]
27
+
28
+
29
+ def parse_smi(text):
30
+ """nvidia-smi 'utilization.gpu, memory.used' csv rows to per-GPU lists."""
31
+ rows = [[int(v) for v in ln.split(",")] for ln in text.strip().splitlines() if ln.strip()]
32
+ return {"gpu_util": [r[0] for r in rows], "gpu_mem_mib": [r[1] for r in rows]}
33
+
34
+
35
+ def _solver(logdir):
36
+ """pathfinder's 'MPC solver: ...' and CUDA fallback lines from the episode's ROS logs."""
37
+ lines = []
38
+ for dp, _, fns in os.walk(logdir):
39
+ for fn in fns:
40
+ try:
41
+ with open(os.path.join(dp, fn), errors="replace") as f:
42
+ lines += [ln.strip() for ln in f if "MPC solver:" in ln or "CUDA MPC unavailable" in ln]
43
+ except OSError:
44
+ pass
45
+ return "\n".join(dict.fromkeys(lines))
46
+
47
+
48
+ def main(argv=None):
49
+ p = argparse.ArgumentParser()
50
+ for a in ("episodes", "out", "sif", "engine", "stack", "work", "timeline", "done"):
51
+ p.add_argument("--" + a, required=True)
52
+ p.add_argument("--workers", type=int, required=True)
53
+ p.add_argument("--gpus", type=int, default=0)
54
+ a = p.parse_args(argv)
55
+ with open(a.episodes) as f:
56
+ q = queue.Queue()
57
+ for e in json.load(f): # the host already ordered them, longest first
58
+ q.put(e)
59
+ os.makedirs(a.out, exist_ok=True)
60
+ lock, t0 = threading.Lock(), time.time()
61
+ 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)]
62
+
63
+ def log(**ev):
64
+ with lock, open(a.timeline, "a") as f:
65
+ f.write(json.dumps(dict(ev, t=round(time.time() - t0, 3))) + "\n")
66
+
67
+ def worker(i):
68
+ time.sleep(i * STAGGER_S)
69
+ while True:
70
+ try:
71
+ e = q.get_nowait()
72
+ except queue.Empty:
73
+ return
74
+ key, work = e["key"], os.path.join(a.work, e["key"])
75
+ stage, ep = os.path.join(work, "stage"), os.path.join(work, "ep.json")
76
+ os.makedirs(stage)
77
+ with open(ep, "w") as f:
78
+ json.dump([e], f)
79
+ log(ev="start", key=key, worker=i)
80
+ gpu = devs[i % len(devs)] if devs and e["resolved"].get("recipe", {}).get("sim", {}).get("cuda") else None
81
+ limit = EPISODE_TIMEOUT_S * max(1, e["resolved"]["scenario"].get("laps", 1)) # per lap: 5-lap episodes run 5x longer
82
+ try:
83
+ rc = subprocess.run(worker_cmd(i, work, stage, ep, a.sif, a.engine, a.stack, gpu), stdout=subprocess.DEVNULL,
84
+ stderr=subprocess.DEVNULL, timeout=limit).returncode
85
+ except subprocess.TimeoutExpired:
86
+ rc = "timeout"
87
+ solver = _solver(os.path.join(work, "tmp", "ros", "log"))
88
+ if solver and os.path.isdir(os.path.join(stage, key)):
89
+ with open(os.path.join(stage, key, "solver.txt"), "w") as f:
90
+ f.write(solver + "\n")
91
+ if os.path.exists(os.path.join(stage, key, "outcome.json")):
92
+ tmp, dst = os.path.join(a.out, ".tmp-" + key), os.path.join(a.out, key)
93
+ shutil.rmtree(tmp, ignore_errors=True)
94
+ shutil.copytree(os.path.join(stage, key), tmp)
95
+ shutil.rmtree(dst, ignore_errors=True)
96
+ os.rename(tmp, dst) # the host's rsync sees a key only once its directory is complete
97
+ with lock, open(a.done, "a") as f:
98
+ f.write(key + "\n")
99
+ shutil.rmtree(work, ignore_errors=True)
100
+ log(ev="end", key=key, worker=i, rc=rc, gpu=gpu,
101
+ solver=solver.split("MPC solver: ")[-1] if "MPC solver: " in solver else solver or None)
102
+
103
+ def sampler(stop):
104
+ """Job CPU use from its cgroup, as busy cores, every SAMPLE_S."""
105
+ try:
106
+ with open("/proc/self/cgroup") as f:
107
+ path = "/sys/fs/cgroup" + f.read().strip().split(":")[-1] + "/cpu.stat"
108
+ prev = None
109
+ while not stop.wait(SAMPLE_S if prev else 0):
110
+ with open(path) as f:
111
+ use = next(int(ln.split()[1]) for ln in f if ln.startswith("usage_usec"))
112
+ now = time.time()
113
+ if prev:
114
+ log(ev="cpu", busy_cores=round((use - prev[0]) / 1e6 / (now - prev[1]), 2))
115
+ prev = (use, now)
116
+ except (OSError, StopIteration, ValueError):
117
+ pass
118
+
119
+ def gpu_sampler(stop):
120
+ """GPU utilisation and memory of the job's GPUs, every SAMPLE_S."""
121
+ while not stop.wait(SAMPLE_S):
122
+ try:
123
+ p = subprocess.Popen(["nvidia-smi", "--query-gpu=utilization.gpu,memory.used", "--format=csv,noheader,nounits"],
124
+ stdout=subprocess.PIPE, stderr=subprocess.DEVNULL, text=True)
125
+ log(ev="gpu", **parse_smi(p.communicate(timeout=30)[0]))
126
+ except Exception: # no driver or a hung query: skip this sample
127
+ pass
128
+
129
+ cores = len(os.sched_getaffinity(0)) if hasattr(os, "sched_getaffinity") else os.cpu_count()
130
+ log(ev="launch", workers=a.workers, cores=cores)
131
+ stop = threading.Event()
132
+ threads = [threading.Thread(target=worker, args=(i,)) for i in range(a.workers)]
133
+ samplers = [sampler] + ([gpu_sampler] if a.gpus else [])
134
+ for t in threads + [threading.Thread(target=f, args=(stop,), daemon=True) for f in samplers]:
135
+ t.start()
136
+ for t in threads:
137
+ t.join()
138
+ stop.set()
139
+ log(ev="done")
140
+
141
+
142
+ if __name__ == "__main__":
143
+ main()
results/jobs/20261008-135505-best-stack/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 516 -J AutoSim-large-best-stack-2 --comment 20261008-135505-best-stack -o AutoSim/jobs/20261008-135505-best-stack/1/slurm-%j.out
3
+ W=/dev/shm/AutoSim-$SLURM_JOB_ID
4
+ trap 'rm -rf "$W"' EXIT
5
+ python3 $HOME/AutoSim/jobs/20261008-135505-best-stack/1/gautschi_launch.py --episodes $HOME/AutoSim/jobs/20261008-135505-best-stack/1/episodes.json --out /scratch/gautschi/manors/AutoSim/out/20261008-135505-best-stack --sif $HOME/AutoSim/images/AutoSim-99d206f40cb1.sif --engine $HOME/AutoSim/engine/9468b6d2e43b440756c4f5e2ee7b6fcd221e3f1b7d9724496e70de28f1d0cde3 --stack $HOME/AutoSim/stacks/961dd8ca8ac6ba265501f0806e8c4afcf0f719c2f1a57eddccaa419ebbc53017 --workers 96 --work $W --timeline $HOME/AutoSim/jobs/20261008-135505-best-stack/1/timeline.jsonl --done $HOME/AutoSim/jobs/20261008-135505-best-stack/1/done.txt
results/jobs/20261008-135505-best-stack/job.json ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "id": "20261008-135505-best-stack",
3
+ "tier": "large",
4
+ "tier_version": 2,
5
+ "recipe": {
6
+ "name": "best-stack",
7
+ "source": {
8
+ "repo": "AutonomousKart",
9
+ "ref": "worktree:understeer"
10
+ },
11
+ "params": {
12
+ "pathfinder_node": {
13
+ "mpc.num_samples": 4096
14
+ }
15
+ },
16
+ "sim": {},
17
+ "notes": "Best stack from the 2026-10-07/08 idea study (dev 491/557 vs baseline 378): stack main + sim-support with (1) speed profile: friction-limited forward-backward speed profile from line curvature and the existing a_lat/a_max/a_min limits, command ramps from measured speed at handover; (2) adaptive steering: online RLS of the steering-to-yaw gain from IMU yaw rate, fed to the MPC steer map; (3) understeer: online understeer gradient K_us, rollout uses wheel/(1+K_us v^2/L); (4) traction control: slip-ratio cap of the speed command (11.5% knee, friction-ellipse budget) and wheel-speed gating in the EKF; (5) slip-aware EKF: [x,y,yaw,v,beta] with IMU lateral accel, VTG course modelled as antenna velocity direction. Sampling MPC at 4096 samples on numpy (highmem, no GPU)."
18
+ },
19
+ "user": "shay",
20
+ "notes": "Best stack (speed profile + adaptive steering + understeer + traction control + slip-aware EKF), numpy MPPI 4096, large tier",
21
+ "where": "gautschi",
22
+ "status": "done",
23
+ "submitted_at": "2026-10-08T17:55:05.819+00:00",
24
+ "started_at": "2026-10-08T17:55:05.819+00:00",
25
+ "finished_at": "2026-10-08T23:38:44.632+00:00",
26
+ "total": 10692,
27
+ "done": 10692,
28
+ "errors": 19,
29
+ "build_log": null,
30
+ "workers": 96,
31
+ "slurm_id": "16907983",
32
+ "slurm_ids": [
33
+ "16907983",
34
+ "16907984"
35
+ ],
36
+ "engine_version": "9468b6d2e43b440756c4f5e2ee7b6fcd221e3f1b7d9724496e70de28f1d0cde3"
37
+ }
results/jobs/20261008-135505-best-stack/logs/shard-0000.jsonl.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:767615a8d8a6edb9c5ab8a1c7a2203a14df595584f3e849215a763f6a990251b
3
+ size 51808272
results/jobs/20261008-135505-best-stack/logs/shard-0001.jsonl.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d8040abd19f0d6cf79f08e97b8ef98acdf70bfb408417225e1792b82076a0c51
3
+ size 151670633
results/jobs/20261008-135505-best-stack/logs/shard-0002.jsonl.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d54ac4dddc72f2488751014de7d1294af58c474983b808a99fdf7f4bc73fc264
3
+ size 188087049
results/jobs/20261008-135505-best-stack/logs/shard-0003.jsonl.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3c4533208e0e73ecd80d60f4d60fe0a3c320d3497b74d3f4d89a260cd064c6d1
3
+ size 159418325
results/jobs/20261008-135505-best-stack/logs/shard-0004.jsonl.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2ce243c066f3b16b044dcb91396e742aaade62283c2a56352fd3cd7e1796cc1c
3
+ size 94552092
results/jobs/20261008-135505-best-stack/logs/shard-0005.jsonl.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5d66ed0e44ab02363db7f0c3daf7ba3456dee2d0b1fca891a9053271fd0a99f2
3
+ size 177891322
results/jobs/20261008-135505-best-stack/logs/shard-0006.jsonl.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cf3009005e0f37b6cf4cbed81f8310195425dc2e0891f710a145e94338a29b39
3
+ size 117598434
results/jobs/20261008-135505-best-stack/logs/shard-0007.jsonl.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:09eb51358f7f99a8e660b5735f666acca140c92450d7e97277cd1c682ce67dd2
3
+ size 190514255
results/jobs/20261008-135505-best-stack/logs/shard-0008.jsonl.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a4c5752d084e690792e575be2bb4bd4dae4d3f39627a2f7113ca11444f51700f
3
+ size 251585736
results/jobs/20261008-135505-best-stack/logs/shard-0009.jsonl.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:08e434ee5ae1252b30791455eeaa0750edb6e36bfb560647ff5e3b72f1a62b74
3
+ size 171920311
results/jobs/20261008-135505-best-stack/logs/shard-0010.jsonl.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9d0507cc34f930658098116a73d4984fa79722e58cbe3cb5ebfbe9bffeddecae
3
+ size 89528381
results/jobs/20261008-135505-best-stack/logs/shard-0011.jsonl.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:83e0f9889bcd86e6314cc1c4121fab90131a47e2b00a338324c6c10f1d1cf0f7
3
+ size 37115082
results/jobs/20261008-135505-best-stack/logs/shard-0012.jsonl.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:82efe894a7cb7d604dad8627247c6dbe72c4698ce12f749d2f9b1c53117e29c7
3
+ size 53549950
results/jobs/20261008-135505-best-stack/logs/shard-0013.jsonl.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:089a0ee6b6b8d5d5aad0d7932ad32001a1cb008d9015fd1bd032955977e46521
3
+ size 42592914
results/jobs/20261008-135505-best-stack/logs/shard-0014.jsonl.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c39a2f96f306d6a680da67bde4bec6b3b486818776506ce1de717df7fb52113d
3
+ size 57526725
results/jobs/20261008-135505-best-stack/logs/shard-0015.jsonl.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:59951ce1805fb04bd5243e6b60c27002258269ecca25a9ca3415792e315bdff3
3
+ size 30292995
results/jobs/20261008-135505-best-stack/logs/shard-0016.jsonl.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:53316ad27dd32ce3db0eb19c24f04871abfba3868358577be4ce4aa6abc3d30e
3
+ size 30701647
results/jobs/20261008-135505-best-stack/logs/shard-0017.jsonl.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8ac7b67ead71054bc90d55ba727e6dacf9a835adc2e33218ec00fbe642349072
3
+ size 46354304
results/jobs/20261008-135505-best-stack/logs/shard-0018.jsonl.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7e7a863ce8f19674b4c51566d39b011e481de224d6a43bff8e3686e013a9a03a
3
+ size 43947329
results/jobs/20261008-135505-best-stack/logs/shard-0019.jsonl.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:45f9879a5501dc54cae0b9e8917919dda8314e44b099c2fffa82a6773bc6fa1a
3
+ size 80732189
results/jobs/20261008-135505-best-stack/logs/shard-0020.jsonl.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6dd18d5ad84452010b6243125f46c98163e2d106ef52956d282d7727040bc95f
3
+ size 66384017
results/jobs/20261008-135505-best-stack/logs/shard-0021.jsonl.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fc30b5e38b4c73a88860002dda42d98e75c3441d50aee04a2273e9d8f1eb1d5e
3
+ size 44347879
results/jobs/20261008-135505-best-stack/logs/shard-0022.jsonl.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fd2f04efaa8bb24cd11803307036687dfc98423b214f04c23178730ab5e386f0
3
+ size 83276188
results/jobs/20261008-135505-best-stack/logs/shard-0023.jsonl.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6a768ca5478120251258222b71bb6f379431316711655437d120669d8dc57e56
3
+ size 65642712
results/jobs/20261008-135505-best-stack/logs/shard-0024.jsonl.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:63fbd4e529755348c0d3c0409caa98e6e88828dc3bbc7dcbace1c8537ed533ad
3
+ size 123356314
results/jobs/20261008-135505-best-stack/logs/shard-0025.jsonl.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:27a4286d4f4940a828b7c167fc54a72f139817bc7a896a7aacaa95c6ec379395
3
+ size 218719707
results/jobs/20261008-135505-best-stack/logs/shard-0026.jsonl.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:11bcc25823bb70d1e60d843125b0f55a0ce52b74217f739fcf8572180a4fba7e
3
+ size 163305989
results/jobs/20261008-135505-best-stack/logs/shard-0027.jsonl.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fc716bcb2ee0b604df9785fac775c0cadc39103b4b3b6c7ad4a5a91b3bf4628a
3
+ size 39714727
results/jobs/20261008-135505-best-stack/logs/shard-0028.jsonl.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:eee158730c10b59455272b7a2e938c44f549f6ccf722f910c0547c1fcd067b01
3
+ size 78051601
results/jobs/20261008-135505-best-stack/logs/shard-0029.jsonl.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5ca3964b2c8e716e368b883ccabfb5663983924b21983fe056e5273e185ef4d2
3
+ size 22158632
results/jobs/20261008-135505-best-stack/logs/shard-0030.jsonl.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f7647703d2ea03757566a695ca1535bffdcc4803a9a002764c0eacff4745fadf
3
+ size 43009375
results/jobs/20261008-135505-best-stack/logs/shard-0031.jsonl.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a69a65106381918f7ce86101242e159c40d351b3723dae0af2724e7c5efe6b3d
3
+ size 23548871
results/jobs/20261008-135505-best-stack/logs/shard-0032.jsonl.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ed78e6ac52f6f0f38884608fa9982971feeaf5793d7642972c343fc78ed99cbe
3
+ size 20404890
results/jobs/20261008-135505-best-stack/logs/shard-0033.jsonl.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:eed37eebadedc2842c1b0c93c3849364edb3e2fcdf1e957157a4c95e59015653
3
+ size 41944333
results/jobs/20261008-135505-best-stack/logs/shard-0034.jsonl.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:56c67aa2549e8cf2286d5c86714a6fb9706ef6910019d6762c029fcd3b9db7ed
3
+ size 27424826
results/jobs/20261008-135505-best-stack/logs/shard-0035.jsonl.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cc569247398a92123947355afb20421c8fc8705824ef4d27d06d93a00d8e7b77
3
+ size 27627700
results/jobs/20261008-135505-best-stack/logs/shard-0036.jsonl.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:060407732f72d8470daf5f07aa805c37b8499458485f1eaf57c17b424dfa2156
3
+ size 25643150