-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
added some synchronicity #533
base: main
Are you sure you want to change the base?
Conversation
@@ -29,6 +29,32 @@ | |||
"scale": ("scale", None), | |||
} | |||
|
|||
async def set_param(param, name, i, n_local_experts, mp, state_dicts, dim): |
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.
moved code to functions to apply to asyncio.gather or asyncio.to_thread.
inference/convert.py
Outdated
shard_size = param.size(dim) // mp | ||
new_param = param.narrow(dim, i * shard_size, shard_size).contiguous() | ||
state_dicts[i][name] = new_param | ||
tensor_dir = glob(os.path.join(hf_ckpt_path, "*.safetensors")) |
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.
meant to group the variables (tensor_dir, token_dir) with other defined variables at the top before submittal.
- applied asyncio to more files - added Parser class - made small changes
applied further Parser class
Parser now can apply assert to self
I updated the inference/convert.py file to be synchronous.