Skip to content

Fix typo and formatting in bettertransformer_tutorial.rst #2183

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

Merged
merged 1 commit into from
Jan 27, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion beginner_source/bettertransformer_tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ been updated to use the core library modules to benefit from fastpath accelerati

Better Transformer offers two types of acceleration:

* Native multihead attention implementation for CPU and GPU to improvee overall execution efficiency.
* Native multihead attention (MHA) implementation for CPU and GPU to improve overall execution efficiency.
* Exploiting sparsity in NLP inference. Because of variable input lengths, input
tokens may contain a large number of padding tokens for which processing may be
skipped, delivering significant speedups.
Expand Down Expand Up @@ -124,6 +124,7 @@ Finally, we set the benchmark iteration count:
2.1 Run and benchmark inference on CPU with and without BT fastpath (native MHA only)

We run the model on CPU, and collect profile information:

* The first run uses traditional ("slow path") execution.
* The second run enables BT fastpath execution by putting the model in inference mode using `model.eval()` and disables gradient collection with `torch.no_grad()`.

Expand Down Expand Up @@ -167,6 +168,7 @@ We disable the BT sparsity:


We run the model on DEVICE, and collect profile information for native MHA execution on DEVICE:

* The first run uses traditional ("slow path") execution.
* The second run enables BT fastpath execution by putting the model in inference mode using `model.eval()`
and disables gradient collection with `torch.no_grad()`.
Expand Down