Skip to content
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

Improved CM commands #2013

Closed
wants to merge 31 commits into from
Closed
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
ae6025c
Update SDXL README.md, improved CM commands
sahilavaran Dec 23, 2024
6b567a7
Update README.md | Fix SDXL model download path
sahilavaran Dec 23, 2024
8ad2884
Update README.md | Added cm command for downloading coco2014 size.50
sahilavaran Dec 23, 2024
469a3bc
Update README.md | Fix SDXL calibration download command
sahilavaran Dec 23, 2024
41bded9
Update SDXL README.md
sahilavaran Dec 23, 2024
6df318e
Update README.md
sahilavaran Dec 23, 2024
1a2f391
Update README.md| Added outdirname for the bert
sahilavaran Dec 31, 2024
a313db7
Merge branch 'mlcommons:master' into master
sahilavaran Jan 5, 2025
5b9b622
Fixed X and Y axis in coco.py
sahilavaran Jan 5, 2025
5f5acec
Merge branch 'mlcommons:master' into master
sahilavaran Jan 10, 2025
5bd1f3e
Merge branch 'master' into master
arjunsuresh Jan 19, 2025
3d868ad
[Automated Commit] Format Codebase
github-actions[bot] Jan 19, 2025
3060b71
made changes
sahilavaran Jan 23, 2025
2a0fe9b
Merge branch 'master' of github.com:sahilavaran/inference
sahilavaran Jan 23, 2025
9cb4e92
made changes in the coco.py
sahilavaran Jan 23, 2025
9076e4f
[Automated Commit] Format Codebase
github-actions[bot] Jan 23, 2025
ed02ab7
Update coco.py
sahilavaran Jan 23, 2025
c91f2e6
Update README.md
sahilavaran Jan 23, 2025
6bc50d8
Update README.md
sahilavaran Jan 23, 2025
e00758b
changed coco.py
sahilavaran Jan 23, 2025
a82a587
Resolved merge conflict
sahilavaran Jan 23, 2025
fdb343c
[Automated Commit] Format Codebase
github-actions[bot] Jan 23, 2025
d839f9f
Merge branch 'master' into master
sahilavaran Jan 23, 2025
d8a0cde
Update coco.py
sahilavaran Jan 23, 2025
e2061f7
[Automated Commit] Format Codebase
github-actions[bot] Jan 23, 2025
4c88038
merge conflict removed
sahilavaran Jan 23, 2025
4de7eed
Update coco.py
sahilavaran Jan 23, 2025
686c8a3
[Automated Commit] Format Codebase
github-actions[bot] Jan 23, 2025
225f81f
fixed
sahilavaran Jan 23, 2025
cb95879
resolved the conflicts
sahilavaran Jan 23, 2025
3ffb5df
[Automated Commit] Format Codebase
github-actions[bot] Jan 23, 2025
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
22 changes: 11 additions & 11 deletions language/bert/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,16 @@ Please see the [new docs site](https://docs.mlcommons.org/inference/benchmarks/l

## Supported Models

| model | framework | accuracy | dataset | model link | model source | precision | notes |
| ----- | --------- | -------- | ------- | ---------- | ------------ | --------- | ----- |
| BERT-Large | TensorFlow | f1_score=90.874% | SQuAD v1.1 validation set | [from zenodo](https://zenodo.org/record/3733868) [from zenodo](https://zenodo.org/record/3939747) | [BERT-Large](https://github.com/google-research/bert), trained with [NVIDIA DeepLearningExamples](https://github.com/NVIDIA/DeepLearningExamples/tree/master/TensorFlow/LanguageModeling/BERT) | fp32 | |
| BERT-Large | PyTorch | f1_score=90.874% | SQuAD v1.1 validation set | [from zenodo](https://zenodo.org/record/3733896) | [BERT-Large](https://github.com/google-research/bert), trained with [NVIDIA DeepLearningExamples](https://github.com/NVIDIA/DeepLearningExamples/tree/master/TensorFlow/LanguageModeling/BERT), converted with [bert_tf_to_pytorch.py](bert_tf_to_pytorch.py) | fp32 | |
| BERT-Large | ONNX | f1_score=90.874% | SQuAD v1.1 validation set | [from zenodo](https://zenodo.org/record/3733910) | [BERT-Large](https://github.com/google-research/bert), trained with [NVIDIA DeepLearningExamples](https://github.com/NVIDIA/DeepLearningExamples/tree/master/TensorFlow/LanguageModeling/BERT), converted with [bert_tf_to_pytorch.py](bert_tf_to_pytorch.py) | fp32 | |
| BERT-Large | ONNX | f1_score=90.067% | SQuAD v1.1 validation set | [from zenodo](https://zenodo.org/record/3750364) | Fine-tuned based on the PyTorch model and converted with [bert_tf_to_pytorch.py](bert_tf_to_pytorch.py) | int8, symetrically per-tensor quantized without bias | See [MLPerf INT8 BERT Finetuning.pdf](MLPerf INT8 BERT Finetuning.pdf) for details about the fine-tuning process |
| BERT-Large | PyTorch | f1_score=90.633% | SQuAD v1.1 validation set | [from zenodo](https://zenodo.org/record/4792496) | Fine-tuned based on [Huggingface bert-large-uncased pretrained model](https://huggingface.co/bert-large-uncased) | int8, symetrically per-tensor quantized without bias | See README.md at Zenodo link for details about the fine-tuning process |
| model | framework | accuracy | dataset | model link | model source | precision | notes |
| ---------- | ---------- | ---------------- | ------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- |
| BERT-Large | TensorFlow | f1_score=90.874% | SQuAD v1.1 validation set | [from zenodo](https://zenodo.org/record/3733868) [from zenodo](https://zenodo.org/record/3939747) | [BERT-Large](https://github.com/google-research/bert), trained with [NVIDIA DeepLearningExamples](https://github.com/NVIDIA/DeepLearningExamples/tree/master/TensorFlow/LanguageModeling/BERT) | fp32 | |
| BERT-Large | PyTorch | f1_score=90.874% | SQuAD v1.1 validation set | [from zenodo](https://zenodo.org/record/3733896) | [BERT-Large](https://github.com/google-research/bert), trained with [NVIDIA DeepLearningExamples](https://github.com/NVIDIA/DeepLearningExamples/tree/master/TensorFlow/LanguageModeling/BERT), converted with [bert_tf_to_pytorch.py](bert_tf_to_pytorch.py) | fp32 | |
| BERT-Large | ONNX | f1_score=90.874% | SQuAD v1.1 validation set | [from zenodo](https://zenodo.org/record/3733910) | [BERT-Large](https://github.com/google-research/bert), trained with [NVIDIA DeepLearningExamples](https://github.com/NVIDIA/DeepLearningExamples/tree/master/TensorFlow/LanguageModeling/BERT), converted with [bert_tf_to_pytorch.py](bert_tf_to_pytorch.py) | fp32 | |
| BERT-Large | ONNX | f1_score=90.067% | SQuAD v1.1 validation set | [from zenodo](https://zenodo.org/record/3750364) | Fine-tuned based on the PyTorch model and converted with [bert_tf_to_pytorch.py](bert_tf_to_pytorch.py) | int8, symetrically per-tensor quantized without bias | See [MLPerf INT8 BERT Finetuning.pdf](MLPerf INT8 BERT Finetuning.pdf) for details about the fine-tuning process |
| BERT-Large | PyTorch | f1_score=90.633% | SQuAD v1.1 validation set | [from zenodo](https://zenodo.org/record/4792496) | Fine-tuned based on [Huggingface bert-large-uncased pretrained model](https://huggingface.co/bert-large-uncased) | int8, symetrically per-tensor quantized without bias | See README.md at Zenodo link for details about the fine-tuning process |

## Disclaimer

This benchmark app is a reference implementation that is not meant to be the fastest implementation possible.

## Commands
Expand All @@ -45,7 +46,7 @@ Please run the following commands:
- The script [tf_freeze_bert.py] freezes the TensorFlow model into pb file.
- The script [bert_tf_to_pytorch.py] converts the TensorFlow model into the PyTorch `BertForQuestionAnswering` module in [HuggingFace Transformers](https://github.com/huggingface/transformers) and also exports the model to [ONNX](https://github.com/onnx/onnx) format.

## Loadgen over the Network
## Loadgen over the Network

```
pip install cm4mlops
Expand All @@ -58,8 +59,7 @@ cm run script --tags=generate-run-cmds,inference --model=bert-99 --backend=pytor
--mode=performance --device=cuda --quiet --test_query_count=1000 --network=sut
```

Once the SUT server is launched, the below command can be run on the loadgen node to do issue queries to the SUT nodes. In this command `-sut_servers` has just the localhost address - it can be changed to a comma-separated list of any hostname/IP in the network.

Once the SUT server is launched, the below command can be run on the loadgen node to do issue queries to the SUT nodes. In this command `-sut_servers` has just the localhost address - it can be changed to a comma-separated list of any hostname/IP in the network.

```
cm run script --tags=generate-run-cmds,inference --model=bert-99 --backend=pytorch --rerun \
Expand All @@ -68,7 +68,7 @@ cm run script --tags=generate-run-cmds,inference --model=bert-99 --backend=pytor
```

If you are not using CM, just add `--network=lon` along with your normal run command on the SUT side.
On the loadgen node, add `--network=lon` option and `--sut_server <IP1> <IP2>` to the normal command to connect to SUT nodes at IP addresses IP1, IP2 etc.
On the loadgen node, add `--network=lon` option and `--sut_server <IP1> <IP2>` to the normal command to connect to SUT nodes at IP addresses IP1, IP2 etc.

Loadgen over the network works for `onnxruntime` and `pytorch` backends.

Expand Down
13 changes: 8 additions & 5 deletions loadgen/test_settings_internal.cc
Original file line number Diff line number Diff line change
Expand Up @@ -515,11 +515,14 @@ void TestSettingsInternal::LogSummary(AsyncSummary &summary) const {
summary("performance_issue_same : ", performance_issue_same);
summary("performance_issue_same_index : ", performance_issue_same_index);
summary("performance_sample_count : ", performance_sample_count);
if (sample_concatenate_permutation){
summary("WARNING: sample_concatenate_permutation was set to true. \n"
"Generated samples per query might be different as the one in the setting.\n"
"Check the generated_samples_per_query line in the detailed log for the real\n"
"samples_per_query value");
if (sample_concatenate_permutation) {
summary(
"WARNING: sample_concatenate_permutation was set to true. \n"
"Generated samples per query might be different as the one in the "
"setting.\n"
"Check the generated_samples_per_query line in the detailed log for "
"the real\n"
"samples_per_query value");
}
}

Expand Down
Binary file added plot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions tools/upscale_coco/coco.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,17 @@ def showAnns(self, anns):
v = kp[2::3]
for sk in sks:
if np.all(v[sk] > 0):


<< << << < HEAD
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Came while resolving merge conflict?

plt.plot(x[sk], y[sk], linewidth=3, color=c)
== == == =
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here?

plt.plot(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @sahilavaran , is there a particular reason we need to duplicate line 320 and 321?

x[sk],
y[sk],
linewidth=3,
color=c)
>>>>>> > 6bc50d8f7c0ee1c553aabe2d40c9534e7529b620
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here?

plt.plot(
x[v > 0],
y[v > 0],
Expand All @@ -336,6 +346,7 @@ def showAnns(self, anns):
markeredgecolor=c,
markeredgewidth=2,
)

p = PatchCollection(
polygons,
facecolor=color,
Expand Down