-
Notifications
You must be signed in to change notification settings - Fork 350
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(//core/partitioning) : Dynamic shapes + fallback #1414
Conversation
Signed-off-by: Dheeraj Peri <peri.dheeraj@gmail.com>
Signed-off-by: Dheeraj Peri <peri.dheeraj@gmail.com>
Signed-off-by: Dheeraj Peri <peri.dheeraj@gmail.com>
Signed-off-by: Dheeraj Peri <peri.dheeraj@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code conforms to C++ style guidelines
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code conforms to Python style guidelines
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code conforms to C++ style guidelines
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code conforms to Python style guidelines
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code conforms to C++ style guidelines
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code conforms to Python style guidelines
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code conforms to C++ style guidelines
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code conforms to Python style guidelines
Signed-off-by: Dheeraj Peri <peri.dheeraj@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code conforms to Python style guidelines
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code conforms to C++ style guidelines
Signed-off-by: Dheeraj Peri <peri.dheeraj@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code conforms to Python style guidelines
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code conforms to C++ style guidelines
Signed-off-by: Dheeraj Peri <peri.dheeraj@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code conforms to C++ style guidelines
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code conforms to Python style guidelines
Signed-off-by: Dheeraj Peri <peri.dheeraj@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code conforms to C++ style guidelines
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code conforms to Python style guidelines
Make strings like min, opt, max as enums |
… map in a PartioningCtx object Signed-off-by: Dheeraj Peri <peri.dheeraj@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are some changes that do not conform to C++ style guidelines:
diff --git a/home/runner/work/TensorRT/TensorRT/core/compiler.cpp b/tmp/changes.txt
index d4c536a..58af1e6 100644
--- a/home/runner/work/TensorRT/TensorRT/core/compiler.cpp
+++ b/tmp/changes.txt
@@ -127,8 +127,6 @@ bool CheckMethodOperatorSupport(const torch::jit::script::Module& mod, std::stri
return conversion::VerifyConverterSupportForBlock(g->block());
}
-
-
partitioning::GraphAndMapping BuildHybridGraph(
torch::jit::script::Module& new_mod,
torch::jit::Block* block,
diff --git a/home/runner/work/TensorRT/TensorRT/core/partitioning/partitioning.cpp b/tmp/changes.txt
index 372489b..6e37afd 100644
--- a/home/runner/work/TensorRT/TensorRT/core/partitioning/partitioning.cpp
+++ b/tmp/changes.txt
@@ -450,17 +450,17 @@ bool isInputDynamic(PartitioningCtx* ctx) {
return input_is_dynamic;
}
-void populateInputIValues(PartitioningCtx* ctx){
+void populateInputIValues(PartitioningCtx* ctx) {
if (isInputDynamic(ctx)) {
- ctx->min_input_ivalues_map =
- partitioning::generateRandomInputs(ctx->settings.collection_input_spec_map, ctx->input_types_map, ir::ShapeMode::kMIN);
- ctx->opt_input_ivalues_map =
- partitioning::generateRandomInputs(ctx->settings.collection_input_spec_map, ctx->input_types_map, ir::ShapeMode::kOPT);
- ctx->max_input_ivalues_map =
- partitioning::generateRandomInputs(ctx->settings.collection_input_spec_map, ctx->input_types_map, ir::ShapeMode::kMAX);
+ ctx->min_input_ivalues_map = partitioning::generateRandomInputs(
+ ctx->settings.collection_input_spec_map, ctx->input_types_map, ir::ShapeMode::kMIN);
+ ctx->opt_input_ivalues_map = partitioning::generateRandomInputs(
+ ctx->settings.collection_input_spec_map, ctx->input_types_map, ir::ShapeMode::kOPT);
+ ctx->max_input_ivalues_map = partitioning::generateRandomInputs(
+ ctx->settings.collection_input_spec_map, ctx->input_types_map, ir::ShapeMode::kMAX);
} else {
- ctx->opt_input_ivalues_map =
- partitioning::generateRandomInputs(ctx->settings.collection_input_spec_map, ctx->input_types_map, ir::ShapeMode::kOPT);
+ ctx->opt_input_ivalues_map = partitioning::generateRandomInputs(
+ ctx->settings.collection_input_spec_map, ctx->input_types_map, ir::ShapeMode::kOPT);
}
}
diff --git a/home/runner/work/TensorRT/TensorRT/core/ir/ir.h b/tmp/changes.txt
index 91c2666..8e5e4cd 100644
--- a/home/runner/work/TensorRT/TensorRT/core/ir/ir.h
+++ b/tmp/changes.txt
@@ -12,9 +12,9 @@ namespace core {
namespace ir {
enum class ShapeMode {
- kMIN,
- kOPT,
- kMAX,
+ kMIN,
+ kOPT,
+ kMAX,
};
struct Input : torch::CustomClassHolder {
ERROR: Some files do not conform to style guidelines
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code conforms to Python style guidelines
Signed-off-by: Dheeraj Peri <peri.dheeraj@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code conforms to C++ style guidelines
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code conforms to Python style guidelines
Signed-off-by: Dheeraj Peri <peri.dheeraj@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code conforms to Python style guidelines
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code conforms to C++ style guidelines
Fixed merge conflicts with master due to recent merges. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, left some minor comments
Signed-off-by: Dheeraj Peri <peri.dheeraj@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code conforms to C++ style guidelines
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code conforms to Python style guidelines
Description
Dynamic shapes + fallback. This is a refactor of #1111 (credits to @Njuapp).
Type of change
Checklist: