Skip to content

Commit

Permalink
Revert "Support for model reshape in protopipe (#27398)" (#27797)
Browse files Browse the repository at this point in the history
This reverts commit b4b3953.

### Details:
 - *item1*
 - *...*

### Tickets:
 - *ticket-id*
  • Loading branch information
dmatveev authored Nov 28, 2024
1 parent a1aaa08 commit 7b3fd79
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 23 deletions.
1 change: 0 additions & 1 deletion src/plugins/intel_npu/tools/protopipe/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ log_level: INFO
- `ol` - **Optional**. Output layer layout.
- `iml` - **Optional**. Input model layout.
- `oml` - **Optional**. Output model layout.
- `reshape` - **Optional**. Set shape for input layers. For example, "input1: [1,3,224,224], input2: [1,4]" or "[1,3,224,224]" in case of one input layer.

Examples:
```
Expand Down
4 changes: 0 additions & 4 deletions src/plugins/intel_npu/tools/protopipe/src/parser/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -345,10 +345,6 @@ struct convert<OpenVINOParams> {
params.output_model_layout = node["oml"].as<LayerVariantAttr<std::string>>();
}

if (node["reshape"]) {
params.reshape = node["reshape"].as<LayerVariantAttr<std::vector<size_t>>> ();
}

if (node["config"]) {
params.config = node["config"].as<std::map<std::string, std::string>>();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ struct OpenVINOParams {
LayerVariantAttr<std::string> output_layout;
LayerVariantAttr<std::string> input_model_layout;
LayerVariantAttr<std::string> output_model_layout;
LayerVariantAttr<std::vector<size_t>> reshape;
std::map<std::string, std::string> config;
size_t nireq = 1u;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,15 +128,6 @@ static void cfgOutputPostproc(ov::preprocess::PrePostProcessor& ppp, const std::
}
}

static void cfgReshape(const std::shared_ptr<ov::Model>& model,
const AttrMap<std::vector<size_t>> reshape_map) {
std::map<std::string, ov::PartialShape> partial_shapes;
for (const auto& [layer_name, shape] : reshape_map) {
partial_shapes.emplace(layer_name, shape);
}
model->reshape(partial_shapes);
}

static std::vector<std::string> extractLayerNames(const std::vector<ov::Output<ov::Node>>& nodes) {
std::vector<std::string> names;
std::transform(nodes.begin(), nodes.end(), std::back_inserter(names), [](const auto& node) {
Expand All @@ -157,9 +148,6 @@ InOutLayers OpenVINOLayersReader::Impl::readFromModel(const std::string& model_p
const auto iml_map = unpackLayerAttr(params.input_model_layout, input_names, "input model layout");
cfgInputPreproc(ppp, model, ip_map, il_map, iml_map);

const auto reshape_map = unpackLayerAttr(params.reshape, input_names, "reshape");
cfgReshape(model, reshape_map);

const auto& output_names = extractLayerNames(model->outputs());
const auto op_map = unpackLayerAttr(params.output_precision, output_names, "output precision");
const auto ol_map = unpackLayerAttr(params.output_layout, output_names, "output layout");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,6 @@ static cv::gapi::GNetPackage getNetPackage(const std::string& tag, const OpenVIN
const auto& blob_path = std::get<OpenVINOParams::BlobPath>(params.path);
network = std::make_unique<P>(tag, blob_path.blob, params.device);
}
if (std::holds_alternative<AttrMap<std::vector<size_t>>>(params.reshape)) {
network->cfgReshape(std::get<AttrMap<std::vector<size_t>>>(params.reshape));
} else {
network->cfgReshape(std::get<std::vector<size_t>>(params.reshape));
}

network->cfgPluginConfig(params.config);
network->cfgNumRequests(params.nireq);
Expand Down

0 comments on commit 7b3fd79

Please sign in to comment.