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

Flattening the tensors before unflattening #105

Merged
merged 1 commit into from
Jun 4, 2024
Merged

Conversation

eatpk
Copy link
Collaborator

@eatpk eatpk commented May 31, 2024

Summary

Flattening the tensor before unflattening to minimize the data cloning from numpy mmap to torch.Tensor.

Related Issues

N/A

Test Plan

performance tested, improvement by 50%.

@eatpk eatpk requested a review from sangkeun00 May 31, 2024 19:45
@sangkeun00
Copy link
Collaborator

Thanks! I will check the performance improvement on my GPT benchmark. If I notice more than 10-20% improvements, I will merge this PR.

@sangkeun00
Copy link
Collaborator

This PR gave me 5-15% improvement in my experiments. Still an improvement! You can merge this PR.

Copy link
Collaborator

@sangkeun00 sangkeun00 left a comment

Choose a reason for hiding this comment

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

LGTM

@sangkeun00 sangkeun00 merged commit 91329c0 into main Jun 4, 2024
3 checks passed
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.

2 participants