Skip to content

etLLM: add options to apply embedding or output. #8653

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

Merged
merged 1 commit into from
Feb 25, 2025
Merged

etLLM: add options to apply embedding or output. #8653

merged 1 commit into from
Feb 25, 2025

Conversation

iseeyuan
Copy link
Contributor

Summary

Add options to apply embedding or output in llama_transformer.

Currently the transformer's forward is applying embedding based on inputs (tokens is not None and h is None). However, if embedding is not applied, the embedding matrix should not be initialized to take extra memory. So add this option to control it.

It's useful for models without embeddings, or the embeddings need to be done outside of transformer, or the embedding need to be done differently than the one inside transformer.

Similar option is added to the output layer.

Test plan

[PLEASE REMOVE] How did you test this PR? Please write down any manual commands you used and note down tests that you have written if applicable.

@iseeyuan iseeyuan requested a review from lucylq as a code owner February 24, 2025 22:30
Copy link

pytorch-bot bot commented Feb 24, 2025

🔗 Helpful Links

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

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

⏳ No Failures, 2 Pending

As of commit 8ca715c with merge base 9c51e58 (image):
💚 Looks good so far! There are no failures yet. 💚

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 24, 2025
Copy link
Contributor

@madhu-fb madhu-fb left a comment

Choose a reason for hiding this comment

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

LGTM!

@iseeyuan
Copy link
Contributor Author

@pytorchbot label "topic: not user facing"

@iseeyuan iseeyuan merged commit 77589c6 into main Feb 25, 2025
48 checks passed
@iseeyuan iseeyuan deleted the emb branch February 25, 2025 02:12
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. topic: not user facing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants