{
  "id": "cuda/cudnn-batch-norm-bad-param",
  "signature": "RuntimeError: cuDNN error: CUDNN_STATUS_BAD_PARAM when calling cudnnBatchNormalizationForwardTraining",
  "signature_zh": "运行时错误：cuDNN 错误：调用 cudnnBatchNormalizationForwardTraining 时出现 CUDNN_STATUS_BAD_PARAM",
  "regex": "CUDNN_STATUS_BAD_PARAM",
  "domain": "cuda",
  "category": "runtime_error",
  "subcategory": null,
  "root_cause": "An invalid parameter was passed to cuDNN batch normalization, such as a zero epsilon value, negative momentum, or mismatched tensor shapes between input, scale, and bias.",
  "root_cause_type": "generic",
  "root_cause_zh": "向 cuDNN 批归一化传递了无效参数，例如 epsilon 为零、动量为负值，或输入、缩放和偏置张量的形状不匹配。",
  "versions": [
    {
      "version": "cuDNN 8.9.5",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "CUDA 12.1",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "PyTorch 2.2.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "TensorFlow 2.15",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Batch size does not affect parameter validation; the bad parameter error occurs regardless of batch size.",
      "fail_rate": 0.95,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Deterministic mode only affects algorithm selection, not parameter checking; the bad parameter is still detected.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "import torch; bn = torch.nn.BatchNorm2d(64, eps=1e-5, momentum=0.1)",
      "success_rate": 0.85,
      "how": "import torch; bn = torch.nn.BatchNorm2d(64, eps=1e-5, momentum=0.1)",
      "condition": "",
      "sources": []
    },
    {
      "action": "torch.backends.cudnn.enabled = False",
      "success_rate": 0.75,
      "how": "torch.backends.cudnn.enabled = False",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "import torch; bn = torch.nn.BatchNorm2d(64, eps=1e-5, momentum=0.1)",
    "torch.backends.cudnn.enabled = False"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://docs.nvidia.com/deeplearning/cudnn/api/index.html#cudnnBatchNormalizationForwardTraining",
  "official_doc_section": null,
  "error_code": "CUDNN_STATUS_BAD_PARAM",
  "verification_tier": "ai_generated",
  "confidence": 0.83,
  "fix_success_rate": 0.78,
  "resolvable": "true",
  "first_seen": "2024-01-18",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}