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

added some synchronicity #533

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

CodingParadigm1
Copy link

I updated the inference/convert.py file to be synchronous.

added parallel file processing, add faster tensor ops
This reverts commit 3f5a2eb.
removed dir calls from for loops
removed unnecessary variable
@@ -29,6 +29,32 @@
"scale": ("scale", None),
}

async def set_param(param, name, i, n_local_experts, mp, state_dicts, dim):
Copy link
Author

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.

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"))
Copy link
Author

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
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.

1 participant