| 151 | |
| 152 | @staticmethod |
| 153 | def validate_torch_version(torch_info): |
| 154 | install_torch_version = torch_info['version'] |
| 155 | current_torch_version = ".".join(torch.__version__.split('.')[:2]) |
| 156 | if install_torch_version != current_torch_version: |
| 157 | raise RuntimeError("PyTorch version mismatch! DeepSpeed ops were compiled and installed " |
| 158 | "with a different version than what is being used at runtime. " |
| 159 | f"Please re-install DeepSpeed or switch torch versions. " |
| 160 | f"Install torch version={install_torch_version}, " |
| 161 | f"Runtime torch version={current_torch_version}") |
| 162 | |
| 163 | @staticmethod |
| 164 | def validate_torch_op_version(torch_info): |