Skip to content

Conversation

@FindHao
Copy link
Member

@FindHao FindHao commented Feb 2, 2023

This PR adds the userbenchmark for PyTorch API coverage test

Command to run for a specific model:

python3 run_benchmark.py api-coverage --model resnet18  --device cuda --test train,eval

If you want to test all models, the --model should not be specified.

The testing results are stored in .userbenchmark/api-coverage/logs/. Each run will generate two log files, logs-${timestamp}.json and logs-${timestamp}.json-api_coverage.csv. The latter one is like the following format.

API coverage rate: 25/1332 = 1.88%
=====Used APIs=====
module_name,func_name
torch,flatten
torch._C._nn,linear
...
=====Missed APIs=====
module_name,func_name
,_TensorBase.acos
...

All Used and missed APIs will be listed in the csv file.

@FindHao FindHao changed the title [WIP] add API coverage test add API coverage test Feb 2, 2023
@FindHao FindHao force-pushed the findhao/add-api-coverage-test branch from c2b48a6 to 6c002f5 Compare February 15, 2023 21:26
@FindHao FindHao requested a review from xuzhao9 February 15, 2023 21:28
@xuzhao9
Copy link
Contributor

xuzhao9 commented Mar 2, 2023

@FindHao Can you update the PR body to the command of running the new userbenchmark and its example outputs?

@facebook-github-bot
Copy link
Contributor

@xuzhao9 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@FindHao
Copy link
Member Author

FindHao commented Mar 2, 2023

@FindHao Can you update the PR body to the command of running the new userbenchmark and its example outputs?

Done.

@FindHao
Copy link
Member Author

FindHao commented Mar 6, 2023

ping @xuzhao9

@facebook-github-bot
Copy link
Contributor

@FindHao has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@FindHao merged this pull request in 09de70c.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants