From 14801f17460f48d93d036b5fc4d3f6681fafa11a Mon Sep 17 00:00:00 2001 From: wyoung1 Date: Wed, 25 Sep 2024 23:58:07 +0800 Subject: [PATCH] delete test Signed-off-by: wyoung1 <1569907421@qq.com> --- .../imagenet/multiedge_inference_bench/README.md | 2 +- .../testalgorithms/automatic/test.py | 15 --------------- 2 files changed, 1 insertion(+), 16 deletions(-) delete mode 100644 examples/imagenet/multiedge_inference_bench/testalgorithms/automatic/test.py diff --git a/examples/imagenet/multiedge_inference_bench/README.md b/examples/imagenet/multiedge_inference_bench/README.md index e2bcb698..ae0fd01e 100644 --- a/examples/imagenet/multiedge_inference_bench/README.md +++ b/examples/imagenet/multiedge_inference_bench/README.md @@ -62,7 +62,7 @@ You can view the graphical representation of relevant metrics in /ianvs/multiedg To compare the running conditions of the model with and without parallelism in the multiedge inference scenario, you can modify the value of --devices_info in base_model.py to devices_one.yaml to view the relevant metrics when the model runs on a single device. ## Step 5. Run Benchmarking Job - Automatic -We offer a profiling-based plus memory matching segmentation algorithm to compare with the method of manually specifying partitioning points. This method prioritizes the memory matching between the computational subgraph and the device. First, we profile the initial model on the CPU to collect memory usage, the number of parameters, computational cost, and the input and output data shapes for each layer, as well as the total number of layers and their names in the entire model. To facilitate subsequent integration, we have implemented profiling for three types of transformer models: vit, bert, and deit. Secondly, based on the results of the profiling and the device information provided in devices.yaml, we can identify the partitioning point that matches the device memory through a single traversal and perform model partitioning. +We offer a profiling-based and memory matching partition algorithm to compare with the method of manually specifying partitioning points. This method prioritizes the memory matching between the computational subgraph and the device. First, we profile the initial model on the CPU to collect memory usage, the number of parameters, computational cost, and the input and output data shapes for each layer, as well as the total number of layers and their names in the entire model. To facilitate subsequent integration, we have implemented profiling for three types of transformer models: vit, bert, and deit. Secondly, based on the results of the profiling and the device information provided in devices.yaml, we can identify the partitioning point that matches the device memory through a single traversal and perform model partitioning. You should first run the following command to generate a profiling result: ```shell diff --git a/examples/imagenet/multiedge_inference_bench/testalgorithms/automatic/test.py b/examples/imagenet/multiedge_inference_bench/testalgorithms/automatic/test.py deleted file mode 100644 index 2c3e83f2..00000000 --- a/examples/imagenet/multiedge_inference_bench/testalgorithms/automatic/test.py +++ /dev/null @@ -1,15 +0,0 @@ -import model_cfg -import torch -from pathlib import Path - -initial_model = "/Users/wuyang/Desktop/秋招/项目/ianvs/ianvs/initial_model/ViT-B_16-224.npz" -model = model_cfg.module_shard_factory("google/vit-base-patch16-224", initial_model, 37, 48, 1) -dummy_input = torch.randn(1, *[197, 768]) -torch.onnx.export(model, - dummy_input, - str(Path(Path(initial_model).parent.resolve())) + "/sub_model_" + str(3) + ".onnx", - export_params=True, - opset_version=16, - do_constant_folding=True, - input_names=['input_' + str(37)], - output_names=['output_' + str(48)]) \ No newline at end of file