|
@@ -11,7 +11,7 @@ from .layers import name_to_block
|
|
|
def make_dummy_server(host='0.0.0.0', port=None, num_experts=1, expert_cls='ffn', hidden_dim=1024, num_handlers=None,
|
|
|
expert_prefix='expert', expert_offset=0, max_batch_size=16384, device=None, no_optimizer=False,
|
|
|
no_network=False, initial_peers=(), network_port=None, root_port=None, verbose=True, start=False,
|
|
|
- **kwargs) -> tesseract.TesseractServer:
|
|
|
+ UID_DELIMETER=tesseract.TesseractNetwork.UID_DELIMETER, **kwargs) -> tesseract.TesseractServer:
|
|
|
""" A context manager that creates server in a background thread, awaits .ready on entry and shutdowns on exit """
|
|
|
if verbose and len(kwargs) != 0:
|
|
|
print("Ignored kwargs:", kwargs)
|
|
@@ -43,7 +43,7 @@ def make_dummy_server(host='0.0.0.0', port=None, num_experts=1, expert_cls='ffn'
|
|
|
for i in range(num_experts):
|
|
|
expert = torch.jit.script(name_to_block[expert_cls](hidden_dim))
|
|
|
opt = torch.optim.SGD(expert.parameters(), 0.0) if no_optimizer else torch.optim.Adam(expert.parameters())
|
|
|
- expert_uid = f'{expert_prefix}{tesseract.TesseractNetwork.UID_DELIMETER}{i + expert_offset}'
|
|
|
+ expert_uid = f'{expert_prefix}{UID_DELIMETER}{i + expert_offset}'
|
|
|
experts[expert_uid] = tesseract.ExpertBackend(name=expert_uid, expert=expert, opt=opt,
|
|
|
args_schema=(tesseract.BatchTensorProto(hidden_dim),),
|
|
|
outputs_schema=tesseract.BatchTensorProto(hidden_dim),
|