mirror of
https://github.com/deepspeedai/DeepSpeed.git
synced 2025-10-20 15:33:51 +08:00
move torch import (#4468)
This commit is contained in:
@ -5,7 +5,6 @@
|
||||
|
||||
import distutils.spawn
|
||||
import subprocess
|
||||
import torch
|
||||
|
||||
from .builder import OpBuilder
|
||||
|
||||
@ -36,6 +35,7 @@ class AsyncIOBuilder(OpBuilder):
|
||||
# -O0 for improved debugging, since performance is bound by I/O
|
||||
CPU_ARCH = self.cpu_arch()
|
||||
SIMD_WIDTH = self.simd_width()
|
||||
import torch # Keep this import here to avoid errors when building DeepSpeed wheel without torch installed
|
||||
TORCH_MAJOR, TORCH_MINOR = map(int, torch.__version__.split('.')[0:2])
|
||||
if TORCH_MAJOR >= 2 and TORCH_MINOR >= 1:
|
||||
CPP_STD = '-std=c++17'
|
||||
|
Reference in New Issue
Block a user