Spaces:
Running
Running
r1cksync commited on
Commit Β·
c1e7f70
1
Parent(s): 4eede85
fix(collector): persist task cursor across PPO updates - was resetting to 0 each update so only first IC_ROLLOUTS tasks were ever trained on; now round-robins full shard (3 rollouts x 60 updates = 180 visits over 127-task shard = full coverage); also log first/last 5 task ids at startup so coverage is visible
Browse files- colab/train_lib.py +7 -1
- scripts/run_training.py +2 -0
colab/train_lib.py
CHANGED
|
@@ -535,6 +535,11 @@ class IncidentRolloutCollector:
|
|
| 535 |
critic: LLMCritic
|
| 536 |
tasks: list[str]
|
| 537 |
max_steps_per_ep: int = 16
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 538 |
|
| 539 |
def collect(self, n_episodes: int,
|
| 540 |
progress_cb=None) -> list[Transition]:
|
|
@@ -547,7 +552,8 @@ class IncidentRolloutCollector:
|
|
| 547 |
env = IncidentCommanderEnv(use_mock=True)
|
| 548 |
transitions: list[Transition] = []
|
| 549 |
for ep in range(n_episodes):
|
| 550 |
-
tid = self.tasks[
|
|
|
|
| 551 |
obs_struct = env.reset(tid)
|
| 552 |
obs_text = self._obs_to_text(env, obs_struct)
|
| 553 |
for t in range(self.max_steps_per_ep):
|
|
|
|
| 535 |
critic: LLMCritic
|
| 536 |
tasks: list[str]
|
| 537 |
max_steps_per_ep: int = 16
|
| 538 |
+
# Persistent cursor β advances ACROSS update calls so we round-robin the
|
| 539 |
+
# whole task list instead of always picking tasks[0..n_episodes-1] at
|
| 540 |
+
# every PPO update. Without this, IC_ROLLOUTS=3 with 127 shard tasks would
|
| 541 |
+
# train on only the first 3 forever.
|
| 542 |
+
_cursor: int = 0
|
| 543 |
|
| 544 |
def collect(self, n_episodes: int,
|
| 545 |
progress_cb=None) -> list[Transition]:
|
|
|
|
| 552 |
env = IncidentCommanderEnv(use_mock=True)
|
| 553 |
transitions: list[Transition] = []
|
| 554 |
for ep in range(n_episodes):
|
| 555 |
+
tid = self.tasks[self._cursor % len(self.tasks)]
|
| 556 |
+
self._cursor += 1
|
| 557 |
obs_struct = env.reset(tid)
|
| 558 |
obs_text = self._obs_to_text(env, obs_struct)
|
| 559 |
for t in range(self.max_steps_per_ep):
|
scripts/run_training.py
CHANGED
|
@@ -110,6 +110,8 @@ if _n_shards > 1:
|
|
| 110 |
print(f"[hfjob] sharded {_shard}/{_n_shards} β {len(tasks)} tasks")
|
| 111 |
|
| 112 |
print(f"[hfjob] task_mode={TASK_MODE} count={len(tasks)}")
|
|
|
|
|
|
|
| 113 |
|
| 114 |
# ββ Optional warm-start from a prior phase's HF model repo βββββββββββββ
|
| 115 |
init_repo = os.environ.get("IC_INIT_ADAPTER_REPO", "").strip()
|
|
|
|
| 110 |
print(f"[hfjob] sharded {_shard}/{_n_shards} β {len(tasks)} tasks")
|
| 111 |
|
| 112 |
print(f"[hfjob] task_mode={TASK_MODE} count={len(tasks)}")
|
| 113 |
+
print(f"[hfjob] first 5 task ids: {tasks[:5]}")
|
| 114 |
+
print(f"[hfjob] last 5 task ids: {tasks[-5:]}")
|
| 115 |
|
| 116 |
# ββ Optional warm-start from a prior phase's HF model repo βββββββββββββ
|
| 117 |
init_repo = os.environ.get("IC_INIT_ADAPTER_REPO", "").strip()
|