We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0333064 commit 51170b2Copy full SHA for 51170b2
configs/config.py
@@ -137,11 +137,11 @@ def use_insecure_load():
137
logging.warning("Using insecure weight loading for fairseq dictionary")
138
except AttributeError:
139
pass
140
-
+
141
@staticmethod
142
def get_default_batch_size() -> int:
143
if not torch.cuda.is_available():
144
- #TODO: add non-cuda multicards
+ # TODO: add non-cuda multicards
145
return 1
146
# 判断是否有能用来训练和加速推理的N卡
147
ngpu = torch.cuda.device_count()
@@ -155,7 +155,10 @@ def get_default_batch_size() -> int:
155
mem.append(
156
int(
157
torch.cuda.get_device_properties(i).total_memory
158
- / 1024 / 1024 / 1024 + 0.4
+ / 1024
159
160
161
+ + 0.4
162
)
163
164
if if_gpu_ok:
0 commit comments