File size: 3,122 Bytes
cdf4ae9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
"""Relaunch leftover campaign jobs. One CSV per process. No TimeFilter."""

from __future__ import annotations

import os
import subprocess
import sys
from pathlib import Path

ROOT = Path(__file__).resolve().parents[1]
PY = sys.executable
LOG = ROOT / "results" / "logs"
CITIES = "NYCBIKE,NYCTAXI,CHIBIKE,CHITAXI,BAYBIKE,BOSBIKE,TORBIKE"

JOBS = [
    {"name": "fast_4060", "args": [str(ROOT / "scripts" / "run_fast_4060.py")]},
    {"name": "fast_4090", "args": [str(ROOT / "scripts" / "run_fast_4090.py")]},
    {
        "name": "fill_pdformer_4090",
        "args": [
            "-u", "run.py", "--mode", "train", "--models", "PDFormer",
            "--datasets", CITIES, "--horizons", "1h,1d,3d",
            "--lookbacks", "1d", "--setting", "A", "--seed", "2026",
            "--device", "cuda:1", "--epochs", "0", "--out", "pdformer_A_2026",
        ],
    },
    {
        "name": "fill_unist_4090",
        "args": [
            "-u", "run.py", "--mode", "train", "--models", "UniST",
            "--datasets", CITIES, "--horizons", "1h,1d,3d",
            "--lookbacks", "1d", "--setting", "A", "--seed", "2026",
            "--device", "cuda:1", "--epochs", "0", "--out", "unist_A_2026",
        ],
    },
    {
        "name": "fill_timesfm_4090",
        "args": [
            "-u", "run.py", "--mode", "zero-shot", "--models", "TimesFM-3",
            "--datasets", CITIES, "--horizons", "1h,1d,3d",
            "--setting", "A", "--seed", "2026",
            "--device", "cuda:1", "--node-batch", "16",
            "--out", "timesfm3_A_2026",
        ],
    },
    {
        "name": "fill_patchtst_4060",
        "args": [
            "-u", "run.py", "--mode", "train", "--models", "PatchTST",
            "--datasets", CITIES, "--horizons", "1h,1d,3d",
            "--lookbacks", "256", "--setting", "A", "--seed", "2026",
            "--device", "cuda:0", "--epochs", "0", "--out", "patchtst_A_2026",
        ],
    },
    {
        "name": "fill_timesnet_4060",
        "args": [
            "-u", "run.py", "--mode", "train", "--models", "TimesNet",
            "--datasets", CITIES, "--horizons", "1h,1d,3d",
            "--lookbacks", "256", "--setting", "A", "--seed", "2026",
            "--device", "cuda:0", "--epochs", "0", "--out", "timesnet_A_2026",
        ],
    },
]


def main() -> None:
    os.chdir(ROOT)
    LOG.mkdir(parents=True, exist_ok=True)
    for stale in (ROOT / "results" / "stnn").glob("*.pid"):
        stale.unlink(missing_ok=True)
    env = os.environ.copy()
    env["PYTHONUNBUFFERED"] = "1"
    env.setdefault("HF_ENDPOINT", "https://hf-mirror.com")
    env["HF_HUB_ENABLE_HF_TRANSFER"] = "0"
    env["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID"
    for job in JOBS:
        log = LOG / f"{job['name']}.log"
        err = LOG / f"{job['name']}.err"
        cmd = [PY, *job["args"]]
        print("start", " ".join(cmd), flush=True)
        subprocess.Popen(
            cmd,
            cwd=str(ROOT),
            env=env,
            stdout=log.open("w", encoding="utf-8"),
            stderr=err.open("w", encoding="utf-8"),
        )


if __name__ == "__main__":
    main()