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 4 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

@angelayi angelayi requested a review from Jack-Khuu September 17, 2024 22:30
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 75908b8 with merge base de2507b (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_metadata branch from 34259d4 to 23f96d4 Compare September 17, 2024 22:37
@angelayi angelayi force-pushed the angelayi/aoti_python branch from f285434 to 2c8b7b5 Compare September 17, 2024 22:53
@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 force-pushed the angelayi/aoti_metadata branch from 23f96d4 to b2b93c5 Compare November 5, 2024 01:07
@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
@angelayi angelayi force-pushed the angelayi/aoti_metadata branch from 7146029 to 7330b17 Compare November 5, 2024 16:34
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

@angelayi angelayi force-pushed the angelayi/aoti_metadata branch from 7330b17 to 247fd20 Compare November 6, 2024 00:33
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