Skip to content

Conversation

metascroy
Copy link
Contributor

@metascroy metascroy commented Feb 26, 2025

This PR:

  • Moves SplitLinearModule to a separate utils.py and extends it to support splitting in_features. I did not find splitting in_features worked very well, at least in my initial experiments.
  • Updates readme with latest setting recommendations for Llama1B

Copy link

pytorch-bot bot commented Feb 26, 2025

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/8715

Note: Links to docs will display an error until the docs builds have been completed.

❌ 1 New Failure

As of commit b8b9d44 with merge base dfe11f0 (image):

NEW FAILURE - The following job has failed:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Feb 26, 2025
@metascroy metascroy requested review from YifanShenSZ and cccclai and removed request for cccclai February 26, 2025 01:27
Copy link

This PR needs a release notes: label

If your changes are user facing and intended to be a part of release notes, please use a label starting with release notes:.

If not, please add the topic: not user facing label.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "topic: not user facing"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

@metascroy metascroy requested a review from YIWENX14 February 27, 2025 21:13
@metascroy
Copy link
Contributor Author

@cccclai can I get a review on this?

import torch


class SplitLinearModule(torch.nn.Module):
Copy link
Contributor

Choose a reason for hiding this comment

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

I might miss some context - I thought you said splitting linear speeds up the perf in ANE?

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh, you said in features, in the description. What did you split to get better perf?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, so currently landed we have ability to split up out_features in linear modules and this speeds up perf by out 30%.

This diff adds the ability to split in_features in linear modules. It did not speed up perf in the few parameters I tried, but it's nice to have this ability it landed so people can experiment further.

@metascroy metascroy added the partner: apple For backend delegation, kernels, demo, etc. from the 3rd-party partner, Apple label Feb 27, 2025
Copy link
Contributor

@cccclai cccclai left a comment

Choose a reason for hiding this comment

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

Looks good, thank you!

@metascroy metascroy merged commit 38384a2 into main Feb 28, 2025
48 of 49 checks passed
@metascroy metascroy deleted the split-in-feat branch February 28, 2025 18:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. partner: apple For backend delegation, kernels, demo, etc. from the 3rd-party partner, Apple
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants