Breakmodel automation
The only changes are a small addition to the breakmodel section where GPU0 is automatically chosen if the CLI options are used without specifying breakmodel. Lineendings have been changed to Linux formatting for compatibility reasons.
This commit is contained in:
parent
8a916116e3
commit
1596a238f7
|
@ -225,6 +225,10 @@ def device_config(model):
|
||||||
elif(args.breakmodel_layers is not None):
|
elif(args.breakmodel_layers is not None):
|
||||||
breakmodel.gpu_blocks = [n_layers - max(0, min(n_layers, args.breakmodel_layers))]
|
breakmodel.gpu_blocks = [n_layers - max(0, min(n_layers, args.breakmodel_layers))]
|
||||||
n_layers -= sum(breakmodel.gpu_blocks)
|
n_layers -= sum(breakmodel.gpu_blocks)
|
||||||
|
elif(args.model is not None):
|
||||||
|
print("Breakmodel not specified, assuming GPU 0")
|
||||||
|
breakmodel.gpu_blocks = [n_layers]
|
||||||
|
n_layers = 0
|
||||||
else:
|
else:
|
||||||
device_count = torch.cuda.device_count()
|
device_count = torch.cuda.device_count()
|
||||||
if(device_count > 1):
|
if(device_count > 1):
|
||||||
|
|
Loading…
Reference in New Issue