{"record":{"id":"622aedd1754873cd","repo":"Lightning-AI/pytorch-lightning","slug":"pytorch-2-6-requires-deepspeed-0-16-0-detec-622aed","errorCode":null,"errorMessage":"PyTorch >= 2.6 requires DeepSpeed >= 0.16.0. Detected DeepSpeed version: {deepspeed_version}. Please upgrade by running `pip install -U 'deepspeed>=0.16.0'`.","messagePattern":"PyTorch >= 2\\.6 requires DeepSpeed >= 0\\.16\\.0\\. Detected DeepSpeed version: (.+?)\\. Please upgrade by running `pip install -U 'deepspeed>=0\\.16\\.0'`\\.","errorType":"exception","errorClass":"ImportError","httpStatus":null,"severity":"critical","filePath":"src/lightning/pytorch/strategies/deepspeed.py","lineNumber":274,"sourceCode":"                per worker.\n\n            exclude_frozen_parameters: Exclude frozen parameters when saving checkpoints.\n\n        \"\"\"\n        if not _DEEPSPEED_AVAILABLE:\n            raise MisconfigurationException(\n                \"To use the `DeepSpeedStrategy`, you must have DeepSpeed installed.\"\n                \" Install it by running `pip install -U deepspeed`.\"\n            )\n\n        if _TORCH_GREATER_EQUAL_2_6 and not _DEEPSPEED_GREATER_EQUAL_0_16:\n            # Starting with PyTorch 2.6, `torch.load` defaults to `weights_only=True` when loading full checkpoints.\n            # DeepSpeed added support for this behavior in version 0.16.0.\n            import deepspeed\n\n            deepspeed_version = deepspeed.__version__\n\n            raise ImportError(\n                f\"PyTorch >= 2.6 requires DeepSpeed >= 0.16.0. \"\n                f\"Detected DeepSpeed version: {deepspeed_version}. \"\n                \"Please upgrade by running `pip install -U 'deepspeed>=0.16.0'`.\"\n            )\n\n        super().__init__(\n            accelerator=accelerator,\n            parallel_devices=parallel_devices,\n            cluster_environment=cluster_environment,\n            precision_plugin=precision_plugin,\n            process_group_backend=process_group_backend,\n        )\n        self._timeout: Optional[timedelta] = timeout\n\n        self.config = self._load_config(config)\n        if self.config is None:\n            # User has not overridden config, set defaults\n            self.config = self._create_default_config(","sourceCodeStart":256,"sourceCodeEnd":292,"githubUrl":"https://github.com/Lightning-AI/pytorch-lightning/blob/9fed5c27d2a62ff0efd6c3573599921d6ff67c14/src/lightning/pytorch/strategies/deepspeed.py#L256-L292","documentation":"With PyTorch >= 2.6, `torch.load` defaults to `weights_only=True`, which breaks loading full DeepSpeed checkpoints unless DeepSpeed supports it. DeepSpeed added that support in 0.16.0, so Lightning raises ImportError when it detects torch>=2.6 paired with deepspeed<0.16.0, printing the detected version.","triggerScenarios":"Constructing `DeepSpeedStrategy` while `torch.__version__ >= 2.6` and `deepspeed.__version__ < 0.16.0` (the code path is guarded by `_TORCH_GREATER_EQUAL_2_6 and not _DEEPSPEED_GREATER_EQUAL_0_16`).","commonSituations":"Upgrading PyTorch to 2.6+ while keeping an older pinned deepspeed; environments with a requirements file pinning `deepspeed==0.12.x`; CI images with stale deepspeed wheels.","solutions":["Upgrade DeepSpeed: `pip install -U 'deepspeed>=0.16.0'`","Alternatively downgrade PyTorch below 2.6 if DeepSpeed cannot be upgraded","Pin compatible versions in requirements: `torch>=2.6` together with `deepspeed>=0.16.0`"],"exampleFix":"# before\ntorch==2.6.0\ndeepspeed==0.12.6\n\n# after\ntorch==2.6.0\ndeepspeed>=0.16.0","handlingStrategy":"validation","validationCode":"import torch, deepspeed\nfrom packaging.version import Version\nif Version(torch.__version__) >= Version(\"2.6\") and Version(deepspeed.__version__) < Version(\"0.16.0\"):\n    raise SystemExit(\"Upgrade: pip install -U 'deepspeed>=0.16.0'\")","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pin compatible version pairs (torch>=2.6 with deepspeed>=0.16.0) in requirements","Add a smoke test that constructs DeepSpeedStrategy in CI to catch version drift"],"tags":["deepspeed","version-mismatch","pytorch-2-6","compatibility"],"backgroundTag":"dependency-version-conflict","analyzedSha":"9fed5c27d2a62ff0efd6c3573599921d6ff67c14","analyzedAt":"2026-08-28T11:52:41.083Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}