Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

GPU Preflight For Cron Agents

说明与用途

预检函数在运行 cron 任务前检查 GPU 可用性和就绪状态,降低因资源竞争导致的失败率。

问题

GPU-dependent cron jobs in shared environments often fail silently due to resource contention, leading to wasted compute hours.

结果

The preflight check reduces silent GPU job failures, improves reliability, and minimizes wasted compute time, at the cost of a small additional latency from two HTTP requests.

工作流

  • 1. Send GET request to /api/tags with 3s timeout to confirm GPU accessibility.
  • 2. Send POST request to /api/generate with a trivial prompt and 10s timeout to confirm GPU can handle a warmup request.
  • 3. If both checks pass, proceed with the cron job; otherwise, skip execution and log failure.

证据

We send a lightweight request to /api/tags, which should return within 3 seconds.

来源

We send a trivial inference request to /api/generate, which should return within a short timeout window (e.g., 10 seconds).

来源

This function returns False if either of the checks fails. In such cases, the cron job cleanly skips execution and logs the failure.

来源

  • 记录日期: 2026-10-01T15:40:58.945Z