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

[aoti] Remove need for -l in cmake call #1159

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

Conversation

angelayi
Copy link
Contributor

@angelayi angelayi commented Sep 17, 2024

Removes the need for the -l in the cmake call by storing the tokenizer type during export time in the PT2.
Stacked on top of #896

Copy link

pytorch-bot bot commented Sep 17, 2024

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/torchchat/1159

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

❌ 1 New Failure

As of commit 452dc72 with merge base e30aaa0 (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 Meta Open Source bot. label Sep 17, 2024
@angelayi angelayi force-pushed the angelayi/aoti_python branch 2 times, most recently from 937ab9a to f285434 Compare September 17, 2024 22:37
@angelayi angelayi force-pushed the angelayi/aoti_python branch 4 times, most recently from b9d6ef5 to eae63fe Compare October 2, 2024 18:14
@angelayi angelayi force-pushed the angelayi/aoti_python branch 2 times, most recently from 93e6727 to 5cd2862 Compare October 31, 2024 01:10
@Jack-Khuu
Copy link
Contributor

@angelayi The rebase on this looks like a rough, wanna recreate?

@angelayi angelayi changed the base branch from angelayi/aoti_python to main November 5, 2024 01:07
@@ -39,6 +39,7 @@ def export_for_server(
output_path: str = "model.pt2",
dynamic_shapes: bool = False,
package: bool = True,
metadata: Optional[Dict[str, str]] = None,
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
metadata: Optional[Dict[str, str]] = None,
metadata: Dict[str, str] = {},

We can delete metadata = metadata or {}

Comment on lines 452 to 454
tokenizer_type = "0"
if tokenizer_args is not None:
tokenizer_type = "2" if tokenizer_args.is_sentencepiece else "3"
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
tokenizer_type = "0"
if tokenizer_args is not None:
tokenizer_type = "2" if tokenizer_args.is_sentencepiece else "3"
if tokenizer_args is None:
tokenizer_type = "0"
elif tokenizer_args.is_sentencepiece:
tokenizer_type = "2" # Corresponding to llama2
else:
tokenizer_type = "3" # Corresponding to llama3

nit: easier to add more options

@angelayi angelayi marked this pull request as ready for review November 5, 2024 16:32
path = package_aoti(output_path, path)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sorry, somehow my editor added on a bunch of formatting changes here.. hope it's not too confusing otherwise I can try to remove them.

Copy link
Contributor

Choose a reason for hiding this comment

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

No worries, these are good lint fixes

Copy link
Contributor

@Jack-Khuu Jack-Khuu left a comment

Choose a reason for hiding this comment

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

Legit thanks for the updates

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 Meta Open Source bot.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants