-
Notifications
You must be signed in to change notification settings - Fork 610
Improve VBE benchmark #3867
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
Closed
Closed
Improve VBE benchmark #3867
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This pull request was exported from Phabricator. Differential Revision: D71596622 |
✅ Deploy Preview for pytorch-fbgemm-docs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Summary: X-link: facebookresearch/FBGEMM#955 This Diff improves the VBE benchmark in FBGEMM-GPU as follows: 1. Make argument names consistent with other benchmarks 2. Add more arguments supported by other benchmarks 3. Nice usage/help with `--help` 4. Use a standard request creation mechanism 5. Support measurement on CPU. ## 1. Argument names I carelessly used "a plural form" for a comma-separated list of values, like `--batch-sizes` and `--embedding-dims`, but other benchmarks use "list" suffix, like ` --batch-size-list` and `--embedding-dim-list`. Since VBE is a newer benchmark, let's rename the arguments to make them consistent. ## 2. More arguments The current VBE benchmark does not support arguments other TBE benchmarks support. Let's add more arguments to make the benchmark configurable. ## 3. Nice usage/help with `--help`. Using new config loaders make the usage/help look much nicer (thanks Benson!) ``` TBEBenchmarkingConfigLoader.options EmbeddingOpsCommonConfigLoader.options ``` ## 4. Standard request creation mechanism Previously I created indices/offsets by myself, but seemingly `generate_requests()` works for VBE too. Let's use this. ## 5. Measurement on CPU Because the benchmark code uses `torch.cuda`, we couldn't run a benchmark on CPU. We changed the benchmarking logic to support CPU (using `time.time()`). Reviewed By: sryap Differential Revision: D71596622
669023e
to
a285a21
Compare
This pull request was exported from Phabricator. Differential Revision: D71596622 |
This pull request has been merged in b2312f7. |
q10
pushed a commit
to q10/FBGEMM
that referenced
this pull request
Apr 10, 2025
Summary: X-link: pytorch#3867 Pull Request resolved: facebookresearch/FBGEMM#955 This Diff improves the VBE benchmark in FBGEMM-GPU as follows: 1. Make argument names consistent with other benchmarks 2. Add more arguments supported by other benchmarks 3. Nice usage/help with `--help` 4. Use a standard request creation mechanism 5. Support measurement on CPU. ## 1. Argument names I carelessly used "a plural form" for a comma-separated list of values, like `--batch-sizes` and `--embedding-dims`, but other benchmarks use "list" suffix, like ` --batch-size-list` and `--embedding-dim-list`. Since VBE is a newer benchmark, let's rename the arguments to make them consistent. ## 2. More arguments The current VBE benchmark does not support arguments other TBE benchmarks support. Let's add more arguments to make the benchmark configurable. ## 3. Nice usage/help with `--help`. Using new config loaders make the usage/help look much nicer (thanks Benson!) ``` TBEBenchmarkingConfigLoader.options EmbeddingOpsCommonConfigLoader.options ``` ## 4. Standard request creation mechanism Previously I created indices/offsets by myself, but seemingly `generate_requests()` works for VBE too. Let's use this. ## 5. Measurement on CPU Because the benchmark code uses `torch.cuda`, we couldn't run a benchmark on CPU. We changed the benchmarking logic to support CPU (using `time.time()`). Reviewed By: sryap Differential Revision: D71596622 fbshipit-source-id: 38941010c43335d09dd44dc61626321e83c79285
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary:
This Diff improves the VBE benchmark in FBGEMM-GPU as follows:
--help
1. Argument names
I carelessly used "a plural form" for a comma-separated list of values, like
--batch-sizes
and--embedding-dims
, but other benchmarks use "list" suffix, like--batch-size-list
and--embedding-dim-list
. Since VBE is a newer benchmark, let's rename the arguments to make them consistent.2. More arguments
The current VBE benchmark does not support arguments other TBE benchmarks support. Let's add more arguments to make the benchmark configurable. This includes
--alpha-list
,--warmup-runs
,--stoc
,--pooling
,--bounds-check-mode
, and so on.3. Nice usage/help with
--help
../benchmark.py vbe --help
will show explanations per arguments, which looks nice.4. Standard request creation mechanism
Previously I created indices/offsets by myself, but seemingly
generate_requests()
works for VBE too. Let's use this.5. Measurement on CPU
Because the benchmark code uses
torch.cuda
, we couldn't run a benchmark on CPU. We changed the benchmarking logic to support CPU (usingtime.time()
).Differential Revision: D71596622