-
Notifications
You must be signed in to change notification settings - Fork 454
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
[BT
] add decoder benchmark script
#857
Conversation
max_new_tokens=max_token, | ||
use_cache=False, |
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.
Why use_cache = False
? I'd rather benchmark with the cache enabled.
Also, can we rather set min_length=length, max_length=length
? So that we can generate a specific length.
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.
I think it's because max_length
is deprecated, yes we can add min_length
I think let me try
max_new_tokens=max_token, | ||
use_cache=False, | ||
) | ||
_ = hf_model.generate(input_ids, generation_config=gen_config) |
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.
the input_ids
are not defined no?
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.
Does it make sense to pass attention_mask
as well? Not sure
start_event = torch.cuda.Event(enable_timing=True) | ||
end_event = torch.cuda.Event(enable_timing=True) | ||
start_event.record() | ||
for _ in range(num_batches): | ||
_ = model(input_ids, masks) | ||
if is_decoder: | ||
_ = model.generate(input_ids, generation_config=generation_config) |
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.
the input_ids
is not defined no?
The documentation is not available anymore as the PR was closed or merged. |
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.
Feel free to merge once you think it's good. I think we should use use_cache=True
to benchmark.
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. |
What does this PR do?
This PR adds the benchmark script adapted for decoder-based models as well, to benchmark the speedup we obtain with
torch.sdpa
andtransformers
modelscc @fxmarty