Skip to content

Commit

Permalink
update readme for v0.1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
yokosyun committed Jan 26, 2024
1 parent 1513cbe commit 196f05b
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 19 deletions.
22 changes: 4 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
# torchtops(Pytorch TOPS)
[![Pypi version](https://img.shields.io/pypi/v/torchtops.svg)](https://pypi.org/project/torchtops/)

This toolkit evaluate layer level TOPS(Terra Operations Per Second)

these items will be retuned by profile
- layer_name_list (List[str]) - List of layer names
- latency_list (List[float]) - List of latency in miliseconds
- tops_list (List[float]) - List of tops
- modules (List[nn.Module]) - List of nn.Module
- total_flops (int) - total flops of the model

## Quickstart

Expand All @@ -26,11 +18,11 @@ res = profile(model, img)

res = filter_modules(res, target_modules=["Conv2d"]) # filter nn.Module you want to get

tops_list, layer_name_list, modules = zip(
tops_list, layer_name_list, module_list = zip(
*sorted(zip(res["tops_list"], res["layer_name_list"], res["module_list"]))
)

for tops, layer_name, module in zip(tops_list, layer_name_list, modules):
for tops, layer_name, module in zip(tops_list, layer_name_list, module_list):
print(f"{tops:.3f} => {layer_name} : {module}")
```

Expand Down Expand Up @@ -64,11 +56,5 @@ this results depend on your hardware
python3.8 tools/example.py
```

### ResNet152
<img src="resources/resnet152.jpg" width="600">

### Vit_b_16
<img src="resources/vit_b_16.jpg" width="600">

### Swin_v2_b
<img src="resources/swin_v2_b.jpg" width="600">
### ResNet50
<img src="resources/resnet50.jpg" width="600">
Binary file removed resources/resnet152.jpg
Binary file not shown.
Binary file removed resources/swin_v2_b.jpg
Binary file not shown.
Binary file removed resources/vit_b_16.jpg
Binary file not shown.
2 changes: 1 addition & 1 deletion torchtops/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .layer_profiler import profile
from .utils import filter_modules

__version__ = "0.1.1"
__version__ = "0.1.2"

0 comments on commit 196f05b

Please sign in to comment.