File tree Expand file tree Collapse file tree 11 files changed +198
-195
lines changed Expand file tree Collapse file tree 11 files changed +198
-195
lines changed Load Diff Large diffs are not rendered by default.
Original file line number Diff line number Diff line change 38
38
torch .ops .load_library (
39
39
"//deeplearning/fbgemm/fbgemm_gpu:merge_pooled_embeddings_cpu"
40
40
)
41
- except OSError :
42
- pass
41
+ except ( OSError , RuntimeError ) :
42
+ from fbgemm_gpu import sparse_ops # noqa: F401, E402
43
43
44
44
# OSS
45
45
try :
Original file line number Diff line number Diff line change 105
105
try :
106
106
torch .ops .load_library ("//deeplearning/fbgemm/fbgemm_gpu:sparse_ops" )
107
107
torch .ops .load_library ("//deeplearning/fbgemm/fbgemm_gpu:sparse_ops_cpu" )
108
- except OSError :
109
- pass
108
+ except ( OSError , RuntimeError ) :
109
+ from fbgemm_gpu import sparse_ops # noqa: F401, E402
110
110
111
111
112
112
logger : logging .Logger = logging .getLogger (__name__ )
Original file line number Diff line number Diff line change 113
113
torch .ops .load_library ("//deeplearning/fbgemm/fbgemm_gpu:sparse_ops" )
114
114
torch .ops .load_library ("//deeplearning/fbgemm/fbgemm_gpu:sparse_ops_cpu" )
115
115
torch .ops .load_library ("//deeplearning/fbgemm/fbgemm_gpu/codegen:index_select_ops" )
116
- except OSError :
117
- pass
116
+ except ( OSError , RuntimeError ) :
117
+ from fbgemm_gpu import sparse_ops # noqa: F401, E402
118
118
119
119
120
120
def _pin_and_move (tensor : torch .Tensor , device : torch .device ) -> torch .Tensor :
Original file line number Diff line number Diff line change 58
58
try :
59
59
torch .ops .load_library ("//deeplearning/fbgemm/fbgemm_gpu:sparse_ops" )
60
60
torch .ops .load_library ("//deeplearning/fbgemm/fbgemm_gpu:sparse_ops_cpu" )
61
- except OSError :
62
- pass
61
+ except ( OSError , RuntimeError ) :
62
+ from fbgemm_gpu import sparse_ops # noqa: F401, E402
63
63
64
64
65
65
_DDP_STATE_DICT_PREFIX = "module."
Original file line number Diff line number Diff line change 100
100
try :
101
101
torch .ops .load_library ("//deeplearning/fbgemm/fbgemm_gpu:sparse_ops" )
102
102
torch .ops .load_library ("//deeplearning/fbgemm/fbgemm_gpu:sparse_ops_cpu" )
103
- except OSError :
104
- pass
103
+ except ( OSError , RuntimeError ) :
104
+ from fbgemm_gpu import sparse_ops # noqa: F401, E402
105
105
106
106
107
107
logger : logging .Logger = logging .getLogger (__name__ )
Original file line number Diff line number Diff line change 13
13
14
14
import torch
15
15
16
- if not torch ._running_with_deploy ():
17
- from torch .distributed ._composable .fsdp .fully_shard import FSDPModule as FSDP2
18
- else :
19
16
20
- class FSDP2 :
21
- pass
17
+ class FSDP2 :
18
+ pass
22
19
23
20
24
21
from torch .distributed .fsdp import FullyShardedDataParallel as FSDP
Original file line number Diff line number Diff line change 80
80
except ImportError :
81
81
logger .warning ("torchrec_use_sync_collectives is not available" )
82
82
83
- if not torch ._running_with_deploy ():
84
- torch .ops .import_module ("fbgemm_gpu.sparse_ops" )
83
+ torch .ops .import_module ("fbgemm_gpu.sparse_ops" )
85
84
86
85
87
86
# Note: doesn't make much sense but better than throwing.
Original file line number Diff line number Diff line change 29
29
torch .ops .load_library (
30
30
"//deeplearning/fbgemm/fbgemm_gpu:intraining_embedding_pruning_gpu"
31
31
)
32
- except OSError :
32
+ except ( OSError , RuntimeError ) :
33
33
pass
34
34
35
35
logger : logging .Logger = logging .getLogger (__name__ )
Original file line number Diff line number Diff line change 79
79
try :
80
80
torch .ops .load_library ("//deeplearning/fbgemm/fbgemm_gpu:sparse_ops" )
81
81
torch .ops .load_library ("//deeplearning/fbgemm/fbgemm_gpu:sparse_ops_cpu" )
82
- except OSError :
83
- pass
82
+ except ( OSError , RuntimeError ) :
83
+ from fbgemm_gpu import sparse_ops # noqa: F401, E402
84
84
85
85
# OSS
86
86
try :
You can’t perform that action at this time.
0 commit comments