Skip to content

Conversation

@TosinSeg
Copy link
Contributor

No description provided.

mii/client.py Outdated
deployments = []
configs = mii.utils.import_score_file(deployment_tag).configs
for deployment in configs:
if not isinstance(configs[deployment], dict):
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When the data is written to the score file it stores the dictionaries of all the deployments, along with the load balancer, model_path, and deployment_tag. The 'deployment' on line 18 in the for loop looks at all of them. So I determine if it is a model by checking if it is a dictionary

Comment on lines 76 to 84
if not deployments and not all((model, task, deployment_name)):
assert deployment_tag is not None, "Deployment tag must be set when starting empty deployment"
create_score_file(deployment_tag=deployment_tag,
deployment_type=deployment_type,
deployments=None,
model_path=model_path,
port_map=None,
lb_config=None)
return None
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed it and made a new function, let me know if you think it is better

mii/config.py Outdated
mii_config: MIIConfig = MIIConfig.parse_obj({})
ds_config: dict = None
version: int = 1
deployed: bool = False
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed the deployed option or make it hidden _deployed(verify this is hidden)

model=name,
deployment_name=name + "_deployment",
GPU_index_map=gpu_index_map3,
mii_configs=mii.config.MIIConfig(**mii_configs1)))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we not able to pass just the dictionary here?

deployments, lb_config, model_path, port_map = _get_deployment_configs(deployment_tag)
mii_configs = None
if len(deployments) > 0:
mii_configs = getattr(next(iter(deployments.values())),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We really need to address this problem. MIIConfig class is required for each DeploymentConfig but the MIIConfig contains options that affect all models (e.g., restful API port). I believe we need to refactor the configs a bit to resolve this and have model-specific configs separate from deployment-specific configs.

mii/client.py Outdated
Comment on lines 90 to 91
assert len(self.deployments) == 1, "Must pass deployment_name to query when using multiple deployments"
deployment = next(iter(self.deployments.values()))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If self.deployments has len of 1, then why do we need to do next(iter()) on it?

mii/config.py Outdated


class DeploymentConfig(BaseModel):
deployment_name: str = Field(alias="DEPLOYMENT_NAME_KEY")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a little bit confused about these aliases. I know we discussed a change here last week, but I think there may have been some miscommunication.

mii/client.py Outdated
Comment on lines 174 to 184
task=None,
model=None,
deployment_name=None,
enable_deepspeed=True,
enable_zero=False,
ds_config=None,
mii_config={},
deployments=[],
deployment_type=DeploymentType.LOCAL,
model_path=None,
version=1):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is a new interface, we do not need to support both the old and new way of adding models. Let's just allow passing of deployments and not task, model, deployment_name

mii/client.py Outdated
async def add_models_async(self, proto_request):
await getattr(self.lb_stub, "AddDeployment")(proto_request)

def add_models(self,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a bit confused about the implementation of this method. It looks like we are re-generating the score file when we add models. And then we call init again? Does this not cause problems for models that are already running?

TosinSeg and others added 4 commits August 1, 2023 14:41
Co-authored-by: Michael Wyatt <mrwyattii@gmail.com>
Co-authored-by: Michael Wyatt <mrwyattii@gmail.com>
@mrwyattii mrwyattii mentioned this pull request Aug 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants