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