Add subgraph fuse support and anakin engine#16018
Merged
NHZlX merged 4 commits intoPaddlePaddle:feature/anakin-enginefrom Mar 6, 2019
Merged
Add subgraph fuse support and anakin engine#16018NHZlX merged 4 commits intoPaddlePaddle:feature/anakin-enginefrom
NHZlX merged 4 commits intoPaddlePaddle:feature/anakin-enginefrom
Conversation
Superjomn
reviewed
Mar 2, 2019
|
|
||
| if (pass_name == "anakin_subgraph_pass") { | ||
| pass->Set("program", | ||
| new framework::ProgramDesc *(&argument->main_program())); |
Contributor
There was a problem hiding this comment.
the main_program is the original program,
it is also stored in the graph passed to Graph.
| // Add new block for TensorRTEngineOP | ||
| const framework::BlockDesc &main_block = | ||
| program_desc->Block(framework::kRootBlockIndex); | ||
| // const framework::BlockDesc& main_block = program_desc->Block(0); |
| @@ -0,0 +1,152 @@ | |||
| /* Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved. | |||
|
|
|||
| Licensed under the Apache License, Version 2.0 (the "License"); | |||
| // "identity_scale_op_clean_pass", // | ||
| /* | ||
| "conv_affine_channel_fuse_pass", // | ||
| "conv_eltwiseadd_affine_channel_fuse_pass", // |
Contributor
There was a problem hiding this comment.
Need to add an API to switch these latter
| .ConvertBlock(block_desc, param_names_, scope, engine); | ||
| engine->Freeze(); | ||
| engine->Optimize(); | ||
| engine->Save("anakin.saved"); |
| auto &t = | ||
| inference::analysis::GetFromScope<framework::LoDTensor>(scope, x); | ||
| auto t_shape = framework::vectorize2int(t.dims()); | ||
| std::cout << "!!!!!!!!" << t_shape.size() << std::endl; |
Contributor
There was a problem hiding this comment.
remove these, or use VLOG
algin fc subgraph.
…le/paddle into anakin_subgraph_dev
fc500110
reviewed
Mar 6, 2019
| weight_tensor.Resize(y_t->dims()); | ||
| TensorCopySync((*y_t), platform::CPUPlace(), &weight_tensor); | ||
| auto *weight_data = weight_tensor.data<float>(); | ||
| PADDLE_ENFORCE(w_m * w_k == weight_tensor.numel()); |
Contributor
There was a problem hiding this comment.
weight_tensor.numel()返回类型是int64_t
NHZlX
added a commit
to NHZlX/Paddle
that referenced
this pull request
Mar 20, 2019
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.