benchmark
f2d615b7 - torchbench is now a library (#1933)

Commit
2 years ago
torchbench is now a library (#1933) Summary: ```python import torchbenchmark.models.densenet121 model, example_inputs = torchbenchmark.models.densenet121.Model(test="eval", device="cuda", batch_size=1).get_module() model(*example_inputs) ``` So making the above example work with `import torchbenchmark` alone is a bit trickier there's a lot of relative imports that need to be fixed in pretty much every single file I also added a simple `test_imports.py` file to make sure this doesn't break anything, I can setup a standalone github action or plug into an existing one (would rather do the latter to avoid another job that needs to run `install.py` again This also solves voznesenskym favorite design pattern from https://github.com/pytorch/pytorch/blob/main/benchmarks/dynamo/torchbench.py ```python for torchbench_dir in ( "./torchbenchmark", "../torchbenchmark", "../torchbench", "../benchmark", "../../torchbenchmark", "../../torchbench", "../../benchmark", ): ``` Pull Request resolved: https://github.com/pytorch/benchmark/pull/1933 Reviewed By: xuzhao9 Differential Revision: D49608012 Pulled By: msaroufim fbshipit-source-id: 382a31f2c5a464608faa730ae15148f59a3e7484
Author
Parents
Loading