-
Notifications
You must be signed in to change notification settings - Fork 65
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
[python] Adds built-in DeepSpeed handler #292
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest we look back on DeepSpeed config to make it more generic. This solution may only applies to small and simple model. For large model requires CPU memory load saving, DeepSpeed checkpoint loading may not work
model = deepspeed.init_inference(model, | ||
mp_size=mp_size, | ||
dtype=model.dtype, | ||
replace_method='auto', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line is not always used. Sometimes loading checkpoint will need to remove this line
option.entryPoint=djl_python.deepspeed | ||
option.parallel_loading=true | ||
option.tensor_parallel_degree=2 | ||
option.model_loading_timeout=600 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This time is too short?
model = AutoModelForCausalLM.from_pretrained(model_id) | ||
tokenizer = AutoTokenizer.from_pretrained(model_id) | ||
if data_type == "fp16": | ||
model.half() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It may be more efficient to allow HuggingFace do the FP16 conversion during loading
Description
Brief description of what this PR is about