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

Refactor LLMEdgeManager's to_dtype #9542

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Refactor LLMEdgeManager's to_dtype #9542

wants to merge 1 commit into from

Conversation

iseeyuan
Copy link
Contributor

Summary

Small refactor to aggregate dtype override in to_dtype method.

Test plan

CI

Copy link

pytorch-bot bot commented Mar 24, 2025

🔗 Helpful Links

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

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

❌ 2 New Failures

As of commit 9192d58 with merge base 012f120 (image):

NEW FAILURES - The following jobs have 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 Mar 24, 2025
@facebook-github-bot
Copy link
Contributor

@iseeyuan has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@iseeyuan
Copy link
Contributor Author

@pytorchbot label "topic: not user facing"

@@ -588,25 +588,9 @@ def _prepare_for_llama_export(args) -> LLMEdgeManager:
)

# At this point, the model is loaded in the default fp32.

# Checkpoint dtype should be lower or equal precision to the dtype override.
# override dtype
checkpoint_dtype = edge_manager.model.checkpoint_dtype
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure why we need to keep this original checkpoint_dtype, since it would be overriden in the line below. Just to keep the behavior of the existing code. @jackzhxng and @kimishpatel , what's the reason behind this, for weight quantization?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yep it's for quantization

@facebook-github-bot
Copy link
Contributor

@iseeyuan has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@swolchok swolchok removed their request for review March 24, 2025 16:27
@facebook-github-bot
Copy link
Contributor

@iseeyuan has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@iseeyuan has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

Copy link
Contributor

@jackzhxng jackzhxng left a comment

Choose a reason for hiding this comment

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

Should be okay

@@ -588,25 +588,9 @@ def _prepare_for_llama_export(args) -> LLMEdgeManager:
)

# At this point, the model is loaded in the default fp32.

# Checkpoint dtype should be lower or equal precision to the dtype override.
# override dtype
checkpoint_dtype = edge_manager.model.checkpoint_dtype
Copy link
Contributor

Choose a reason for hiding this comment

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

Yep it's for quantization

@facebook-github-bot
Copy link
Contributor

@iseeyuan has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

Summary:
Small refactor to aggregate dtype override in to_dtype method.


Test Plan: CI

Reviewed By: billmguo

Differential Revision: D71736608

Pulled By: iseeyuan
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D71736608

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. fb-exported topic: not user facing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants