-
Notifications
You must be signed in to change notification settings - Fork 280
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
Added Whisper from Huggingface. #1769
Conversation
task = SPEECH.RECOGNITION | ||
# https://cdn.openai.com/papers/whisper.pdf Says for large-v2 they trained on 1024 batch sizes, with 16 GPUs | ||
DEFAULT_EVAL_BSIZE = 64 | ||
DEFAULT_Train_BSIZE = 64 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If training is not implemented, please remove this line.
self.feature_size = 80 | ||
self.sequence_length = 3000 | ||
input_features = torch.randn(size=(self.batch_size, self.feature_size, self.sequence_length),device=self.device) | ||
self.example_inputs = {"input_features": input_features.to(self.device)} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we are wrapping the model in a different way, we need to implement customized get_module()
here, similar to the upstream code: https://github.com/MaanavD/benchmark/blob/116df9cb937b6921d16eba34fc504776bb40a6ee/torchbenchmark/util/framework/huggingface/model_factory.py#L110
The reason we need get_module()
is because this API is being used by our downstream benchmarking script: https://github.com/pytorch/pytorch/blob/main/benchmarks/dynamo/torchbench.py#L358
and it requires model(*example_input)
runs successfully.
@msaroufim has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
@msaroufim has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
@xuzhao9 this is confusing me example test is failing but running it standalone seems fine
|
This is because our downstream script, To solve this problem, we need to wrap it up like this: https://github.com/pytorch/benchmark/blob/main/torchbenchmark/util/framework/huggingface/model_factory.py#L42 |
@msaroufim has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
@msaroufim has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
@msaroufim merged this pull request in 770d5cf. |
Summary: Instead of making changes, using HF is easier / more maintainable. Pull Request resolved: #1769 Reviewed By: xuzhao9, cpuhrsch Differential Revision: D47766556 Pulled By: msaroufim fbshipit-source-id: 8393776222fc3508bda56c9c71e45d9812e69869
Instead of making changes, using HF is easier / more maintainable.