{
  "id": "tensorflow/distributed-training-stale-parameter-server",
  "signature": "FailedPreconditionError: Parameter server at /job:ps/replica:0/task:0 is stale. Expected model version 5 but got 4. [Op:ApplyGradientDescent]",
  "signature_zh": "FailedPreconditionError: /job:ps/replica:0/task:0上的参数服务器已过时。期望模型版本5，但得到4。[Op:ApplyGradientDescent]",
  "regex": "FailedPreconditionError: Parameter server at .* is stale",
  "domain": "tensorflow",
  "category": "runtime_error",
  "subcategory": null,
  "root_cause": "In asynchronous distributed training, a parameter server has not updated to the latest model version due to network delays or worker crashes, causing a version mismatch during gradient application.",
  "root_cause_type": "generic",
  "root_cause_zh": "在异步分布式训练中，参数服务器由于网络延迟或工作节点崩溃未更新到最新模型版本，导致梯度应用时版本不匹配。",
  "versions": [
    {
      "version": "tensorflow==2.9.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "tensorflow==2.11.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "tensorflow==2.13.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Increasing the number of workers amplifies the synchronization issue because more workers compete for updates.",
      "fail_rate": 0.85,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Using a larger batch size does not address the version staleness; it only changes gradient accumulation.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Switch to synchronous training using `tf.distribute.MultiWorkerMirroredStrategy` to ensure all parameter servers are consistent before applying gradients.",
      "success_rate": 0.9,
      "how": "Switch to synchronous training using `tf.distribute.MultiWorkerMirroredStrategy` to ensure all parameter servers are consistent before applying gradients.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Reduce the staleness tolerance by setting `tf.config.optimizer.set_jit(True)` and increasing the timeout for parameter server updates in the cluster configuration.",
      "success_rate": 0.7,
      "how": "Reduce the staleness tolerance by setting `tf.config.optimizer.set_jit(True)` and increasing the timeout for parameter server updates in the cluster configuration.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Switch to synchronous training using `tf.distribute.MultiWorkerMirroredStrategy` to ensure all parameter servers are consistent before applying gradients.",
    "Reduce the staleness tolerance by setting `tf.config.optimizer.set_jit(True)` and increasing the timeout for parameter server updates in the cluster configuration."
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://www.tensorflow.org/guide/distributed_training",
  "official_doc_section": null,
  "error_code": "DPSV",
  "verification_tier": "ai_generated",
  "confidence": 0.83,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2023-05-12",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}