Skip to content
This repository was archived by the owner on Sep 10, 2025. It is now read-only.

Conversation

@desertfire
Copy link
Contributor

Summary: This improves best tokens/sec from 73 to 85.

@desertfire desertfire requested a review from Jack-Khuu August 7, 2024 13:35
@pytorch-bot
Copy link

pytorch-bot bot commented Aug 7, 2024

🔗 Helpful Links

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

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

✅ No Failures

As of commit 1be8432 with merge base ce41944 (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 Meta Open Source bot. label Aug 7, 2024
@desertfire desertfire removed the request for review from Jack-Khuu August 7, 2024 15:09
Summary: This improves best tokens/sec from 73 to 85.
@desertfire desertfire requested review from Jack-Khuu and byjlw August 7, 2024 17:45
byjlw
byjlw previously requested changes Aug 7, 2024
"--max-seq-length",
type=int,
default=None,
help="Set maximum length sequence when before calling torch.export",
Copy link
Contributor

Choose a reason for hiding this comment

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

set the default to 300 and update the help string so that it's clear what the default is (300)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That was my initial implementation. Then there was an issue when running eval.

When running eval, we use --dynamic-shapes which uses a larger max_seq_length, i.e. model.config.max_seq_length. But in theory, we should not stop user from calling eval with both options, something like --dynamic-shapes --max-seq-length 1000. When that happens, if args.max_seq_length has a default value, we will have no way to distinguish if args.max_seq_length is from a default value or from an intentional user overwriting.

and not builder_args.dynamic_shapes
):
print("Setting max_seq_length to 300 for DSO export.")
builder_args.max_seq_length = 300
Copy link
Contributor

Choose a reason for hiding this comment

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

you shouldn't need this if you set the default in the other file

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can add more details to the printout if that helps.

@desertfire desertfire requested a review from byjlw August 8, 2024 20:02
@Jack-Khuu Jack-Khuu dismissed byjlw’s stale review August 9, 2024 18:41

300 is used in specific cases, makes sense to not set it in argparse

@Jack-Khuu Jack-Khuu merged commit 5aed7ae into pytorch:main Aug 9, 2024
vmpuri pushed a commit that referenced this pull request Aug 12, 2024
Summary: This improves best tokens/sec from 73 to 85.

Co-authored-by: Jack-Khuu <jack.khuu.7@gmail.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

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.

4 participants