| 432 | extra_link_args=self.strip_empty_entries(self.extra_ldflags())) |
| 433 | |
| 434 | def load(self, verbose=True): |
| 435 | from deepspeed.git_version_info import installed_ops, torch_info |
| 436 | if installed_ops[self.name]: |
| 437 | # Ensure the op we're about to load was compiled with the same |
| 438 | # torch/cuda versions we are currently using at runtime. |
| 439 | self.validate_torch_version(torch_info) |
| 440 | if torch.cuda.is_available() and isinstance(self, CUDAOpBuilder): |
| 441 | self.validate_torch_op_version(torch_info) |
| 442 | |
| 443 | return importlib.import_module(self.absolute_name()) |
| 444 | else: |
| 445 | return self.jit_load(verbose) |
| 446 | |
| 447 | def jit_load(self, verbose=True): |
| 448 | if not self.is_compatible(verbose): |