Skip to content

Commit cbaacc7

Browse files
Fix ModuleNotFoundError: swarm_agents at eval import time
The CT2038 CPU smoke test runs `python records/.../train_gpt.py` from the repo root, which leaves the submission directory off sys.path and causes `from swarm_agents import BackoffNgramMixer` to fail. The sibling swarm_agents.py is already shipped in the submission folder; this patch just prepends the script's own directory to sys.path so it resolves regardless of eval-harness CWD. Verified: py_compile OK on Python 3.10.11, runtime import succeeds when executed from repo root. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
1 parent 0befb07 commit cbaacc7

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

  • records/track_10min_16mb/2026-03-29_SwarmDesigned_CausalBackoffNgramMixer_0.4027

‎records/track_10min_16mb/2026-03-29_SwarmDesigned_CausalBackoffNgramMixer_0.4027/train_gpt.py‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@
2525
from torch import Tensor, nn
2626
from torch.nn.parallel import DistributedDataParallel as DDP
2727
from flash_attn_interface import flash_attn_func as flash_attn_3_func
28+
# Make the submission self-contained regardless of eval-harness CWD: the
29+
# sibling `swarm_agents.py` lives next to this file but isn't on sys.path
30+
# when the harness runs `python records/.../train_gpt.py` from repo root.
31+
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
2832
from swarm_agents import BackoffNgramMixer
2933
INT8_CLIP_Q = 0.9999984
3034
INT8_PER_ROW_SCALE_DTYPE = torch.float16

0 commit comments

Comments
 (0)