-
Notifications
You must be signed in to change notification settings - Fork 275
implement incbench
command for ease-of-use benchmark
#1884
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
Changes from all commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
9054793
move prettytable into inc.common
xin3he fd510db
add benchmark
xin3he 29f974c
support windows
xin3he dabe436
fix bug
xin3he 4f7cb7c
enable subprocess running
xin3he 4a3b6cd
fix bug in windows
xin3he 3cc3885
enhance log
xin3he b3c1091
add document
xin3he ca1f3b6
update platform status
xin3he 29ebf1a
add incbench dlrm example
xin3he 5960bb7
add more docstring
xin3he 4c15bda
add performance test for sq opt-125m
xin3he 60340f2
enhance pre-commit for max-line-length check
xin3he 5f02407
add Multiple Instance Benchmark Summary
xin3he cc014af
Dump Throughput and Latency Summary
xin3he c3de633
change log folder and add UTs
xin3he 9757779
add requirement
xin3he 6ca810f
Merge branch 'master' into xinhe/benchmark
xin3he 8549e92
improve UT coverage
xin3he 0f6e057
fix pylint
xin3he 7f3aff5
remove previous useless code
xin3he eeb56f6
fix bug
xin3he 24ec333
fix pylint
xin3he 18ca594
fix bug
xin3he b55b22b
Merge branch 'master' into xinhe/benchmark
chensuyue a524d9c
update summary format per suyue's request
xin3he 245c75a
fdsa
xin3he 81687bd
revert pre-commit change
xin3he d681fc7
Merge branch 'master' into xinhe/benchmark
xin3he 7e73d1a
update UT
xin3he File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
Benchmark | ||
--- | ||
|
||
1. [Introduction](#introduction) | ||
|
||
2. [Supported Matrix](#supported-matrix) | ||
|
||
3. [Usage](#usage) | ||
|
||
## Introduction | ||
|
||
Intel Neural Compressor provides a command `incbench` to launch the Intel CPU performance benchmark. | ||
|
||
To get the peak performance on Intel Xeon CPU, we should avoid crossing NUMA node in one instance. | ||
Therefore, by default, `incbench` will trigger 1 instance on the first NUMA node. | ||
|
||
## Supported Matrix | ||
|
||
| Platform | Status | | ||
|:---:|:---:| | ||
| Linux | ✔ | | ||
| Windows | ✔ | | ||
|
||
## Usage | ||
|
||
| Parameters | Default | comments | | ||
|:----------------------:|:------------------------:|:-------------------------------------:| | ||
| num_instances | 1 | Number of instances | | ||
| num_cores_per_instance | None | Number of cores in each instance | | ||
| C, cores | 0-${num_cores_on_NUMA-1} | decides the visible core range | | ||
| cross_memory | False | whether to allocate memory cross NUMA | | ||
|
||
> Note: cross_memory is set to True only when memory is insufficient. | ||
|
||
### General Use Cases | ||
|
||
1. `incbench main.py`: run 1 instance on NUMA:0. | ||
2. `incbench --num_i 2 main.py`: run 2 instances on NUMA:0. | ||
3. `incbench --num_c 2 main.py`: run multi-instances with 2 cores per instance on NUMA:0. | ||
4. `incbench -C 24-47 main.py`: run 1 instance on COREs:24-47. | ||
5. `incbench -C 24-47 --num_c 4 main.py`: run multi-instances with 4 COREs per instance on COREs:24-47. | ||
|
||
> Note: | ||
> - `num_i` works the same as `num_instances` | ||
> - `num_c` works the same as `num_cores_per_instance` | ||
|
||
### Dump Throughput and Latency Summary | ||
|
||
To merge benchmark results from multi-instances, "incbench" automatically checks log file messages for "throughput" and "latency" information matching the following patterns. | ||
|
||
```python | ||
throughput_pattern = r"[T,t]hroughput:\s*([0-9]*\.?[0-9]+)\s*([a-zA-Z/]*)" | ||
latency_pattern = r"[L,l]atency:\s*([0-9]*\.?[0-9]+)\s*([a-zA-Z/]*)" | ||
``` | ||
|
||
#### Demo usage | ||
|
||
```python | ||
print("Throughput: {:.3f} samples/sec".format(throughput)) | ||
print("Latency: {:.3f} ms".format(latency * 10**3)) | ||
``` |
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 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 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 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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.