Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DeepSpeed] Fix datatype and allow checkpoint loading #366

Merged
merged 1 commit into from
Dec 8, 2022

Conversation

lanking520
Copy link
Member

Description

Add a few fixes on data type and checkpoint loading settings

@@ -95,11 +95,11 @@


def get_torch_dtype_from_str(dtype: str):
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we want to include something like this https://github.com/microsoft/DeepSpeed-MII/blob/main/mii/config.py#L7?

Or do we need to add documentation about what the supported dtype strings are in serving.properties?

@@ -140,11 +139,10 @@ def _parse_properties(self, properties):
self.model_dir = properties.get("model_dir")
self.model_id = properties.get("model_id")
self.task = properties.get("task")
self.data_type = get_torch_dtype_from_str(properties.get("data_type", "fp32"))
self.data_type = get_torch_dtype_from_str(properties.get("dtype", "fp16"))
Copy link
Contributor

Choose a reason for hiding this comment

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

Why use fp16 as default?

Copy link
Member Author

Choose a reason for hiding this comment

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

fp16 works better and better range of supported model on DeepSpeed. model like Bloom is not working on fp32

Copy link
Contributor

@frankfliu frankfliu Dec 7, 2022

Choose a reason for hiding this comment

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

I mean as a normal user, they will assume fp32 is default. They only override it to fp16 intentionally

Copy link
Member Author

Choose a reason for hiding this comment

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

most LLM saved on huggingface is under fp16

@lanking520 lanking520 merged commit 1746e4e into deepjavalibrary:master Dec 8, 2022
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.

None yet

3 participants