Rebuild agent on original pooled runner

This commit is contained in:
CoolBoy
2026-07-10 02:02:08 +08:00
parent 3a2fa86e1e
commit c06169d906
12 changed files with 459 additions and 535 deletions

View File

@@ -6,7 +6,7 @@ It currently supports:
- one-shot submission planning via `main.py`
- daily batch execution via `run_daily.sh`
- continuous queue refill via `run_poll.sh`
- a single ModelHub token read from environment variables or `KEY.md`
- multiple ModelHub tokens read from `KEY.md` and `KEYS.md`
- automatic task/framework/template selection across the supported GPU catalog
## Layout
@@ -15,8 +15,8 @@ It currently supports:
- `daily_runner.py`: daily wave orchestration
- `poll_runner.py`: long-running queue refiller
- `runner_common.py`: shared token / key file loading
- `modelscope_discovery.py`: ModelScope model discovery and inspection
- `modelhub_client.py`: ModelHub API client
- `hf_discovery.py`: ModelScope model discovery and inspection (keeps the legacy module name)
- `modelhub_client.py`: ModelHub API client and token-pool routing
- `history_stats.py`: online history aggregation, ranking, and warnings
- `template_selector.py`: template lookup and GPU normalization
- `task_registry.py`: task-type and framework selection rules
@@ -24,11 +24,12 @@ It currently supports:
## Key Files
- `KEY.md`: optional local ModelScope and ModelHub tokens
- `KEY.md`: primary ModelScope and ModelHub tokens
- `KEYS.md`: optional supplemental ModelHub tokens
- `templates/public_submit/adapt_task_templates.jsonl`: public submit templates
The agent platform deployment should use environment variables instead of key
files. Set `MODELHUB_XC_TOKEN` or `XC_TOKEN` for the single submitting account.
The runner reads both files automatically. Add more accounts by appending
`XC_TOKEN3`, `XC_TOKEN4`, and so on to `KEYS.md`.
Template lookup is also relative. The selector searches from the current working
directory and the module directory. The primary project layout is:
@@ -72,7 +73,7 @@ bash run_poll.sh --dry-run
- The runner auto-discovers all safe GPU/template combinations from the public submit catalog.
- Each model can be submitted at most once per GPU.
- One ModelHub account is used per deployed agent instance.
- Multiple ModelHub tokens are pooled and used to route submissions to the account with available async capacity.
- History stats are online-only. The local ledger is used for local accounting, but platform history is only used after the local ledger reaches the configured threshold.
- The default history threshold is `500` records.
@@ -83,7 +84,7 @@ Common flags:
- `--daily-target`: total target submissions for the day; `0` means unlimited
- `--min-downloads`: ModelScope download floor
- `--history-stats-threshold`: local ledger threshold before using online history stats
- `--max-scan-models`: hard cap on scanned ModelScope models for a run (0 = auto)
- `--max-scan-models`: hard cap on scanned HF models for a run (0 = auto)
- `--scan-multiplier`: multiplier used for auto scan cap derivation from quota/queue capacity
- `--read-concurrency`: concurrent HTTP reads while scanning model candidates (default 4)
- `--max-submits-per-run`: max tasks to submit per run cycle (0 = unlimited)
@@ -95,9 +96,9 @@ Common flags:
`run_poll.sh` adds:
- `--poll-interval-seconds`: sleep when the account has no available slots
- `--poll-interval-seconds`: sleep when all accounts are saturated
- `--idle-interval-seconds`: sleep when a cycle submits nothing
- `--max-scan-models`: hard cap on scanned ModelScope models for this cycle (0 = auto)
- `--max-scan-models`: hard cap on scanned HF models for this cycle (0 = auto)
- `--scan-multiplier`: multiplier used for auto scan cap derivation from quota/queue capacity
- `--max-submits-per-run`: max tasks to submit per poll cycle (0 = unlimited)
- `--skip-outcome-sync`: skip outcome sync before scanning