File tree 3 files changed +7
-6
lines changed
3 files changed +7
-6
lines changed Original file line number Diff line number Diff line change 16
16
ref : " master"
17
17
- id : setup-venv
18
18
uses : ./.github/workflows/setup-venv
19
- - name : Install torch
20
- run : |
21
- pip install torch
22
19
- name : Get release version from tag
23
20
run : |
24
21
echo "RELEASE_VERSION=${GITHUB_REF#refs/*/v}" >> $GITHUB_ENV
Original file line number Diff line number Diff line change 5
5
6
6
import distutils .spawn
7
7
import subprocess
8
- import torch
9
8
10
9
from .builder import OpBuilder
11
10
@@ -33,6 +32,7 @@ def include_paths(self):
33
32
return ['csrc/aio/py_lib' , 'csrc/aio/common' ]
34
33
35
34
def cxx_args (self ):
35
+ import torch
36
36
# -O0 for improved debugging, since performance is bound by I/O
37
37
CPU_ARCH = self .cpu_arch ()
38
38
SIMD_WIDTH = self .simd_width ()
Original file line number Diff line number Diff line change 11
11
# is op_builder from deepspeed or a 3p version? this should only succeed if it's deepspeed
12
12
# if successful this also means we're doing a local install and not JIT compile path
13
13
from op_builder import __deepspeed__ # noqa: F401 # type: ignore
14
- from op_builder .builder import OpBuilder , TORCH_MAJOR , TORCH_MINOR
14
+ from op_builder .builder import OpBuilder
15
15
except ImportError :
16
- from deepspeed .ops .op_builder .builder import OpBuilder , TORCH_MAJOR , TORCH_MINOR
16
+ from deepspeed .ops .op_builder .builder import OpBuilder
17
17
18
18
19
19
class SYCLOpBuilder (OpBuilder ):
@@ -35,6 +35,10 @@ def builder(self):
35
35
return dpcpp_ext
36
36
37
37
def version_dependent_macros (self ):
38
+ try :
39
+ from op_builder .builder import TORCH_MAJOR , TORCH_MINOR
40
+ except ImportError :
41
+ from deepspeed .ops .op_builder .builder import TORCH_MAJOR , TORCH_MINOR
38
42
# Fix from apex that might be relevant for us as well, related to https://github.com/NVIDIA/apex/issues/456
39
43
version_ge_1_1 = []
40
44
if (TORCH_MAJOR > 1 ) or (TORCH_MAJOR == 1 and TORCH_MINOR > 0 ):
You can’t perform that action at this time.
0 commit comments