Skip to content

Fixing some issues with the master branch #1033

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

Merged
merged 5 commits into from
May 8, 2022
Merged

Fixing some issues with the master branch #1033

merged 5 commits into from
May 8, 2022

Conversation

narendasan
Copy link
Collaborator

Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Fixes # (issue)

Type of change

Please delete options that are not relevant and/or add your own.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist:

  • My code follows the style guidelines of this project (You can use the linters)
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas and hacks
  • I have made corresponding changes to the documentation
  • I have added tests to verify my fix or my feature
  • New and existing unit tests pass locally with my changes

narendasan added 4 commits May 7, 2022 19:53
Signed-off-by: Naren Dasan <[email protected]>
Signed-off-by: Naren Dasan <[email protected]>
Signed-off-by: Naren Dasan <[email protected]>
Signed-off-by: Naren Dasan <[email protected]>
Signed-off-by: Naren Dasan <[email protected]>
Signed-off-by: Naren Dasan <[email protected]>
@github-actions github-actions bot added component: conversion Issues re: Conversion stage component: core Issues re: The core compiler component: evaluators Issues re: Specific op evaluators component: lowering Issues re: The lowering / preprocessing passes component: tests Issues re: Tests labels May 8, 2022
Copy link

@github-actions github-actions bot left a 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

Copy link

@github-actions github-actions bot left a 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/workspace/core/conversion/evaluators/aten.cpp b/tmp/changes.txt
index 018b565..4632744 100644
--- a/workspace/core/conversion/evaluators/aten.cpp
+++ b/tmp/changes.txt
@@ -353,11 +353,9 @@ auto aten_registrations TORCHTRT_UNUSED =
                        return {};
                      }
                    },
-                    EvalOptions().validSchemas({
-                      "aten::add.int(int a, int b) -> (int)",
-                      "aten::add.float(float a, float b) -> (float)",
-                      "aten::add.str(str a, str b) -> (str)"
-                    })})
+                    EvalOptions().validSchemas({"aten::add.int(int a, int b) -> (int)",
+                                                "aten::add.float(float a, float b) -> (float)",
+                                                "aten::add.str(str a, str b) -> (str)"})})
        .evaluator({c10::Symbol::fromQualString("aten::add_"),
                    [](const torch::jit::Node* n, kwargs& args) -> c10::optional<torch::jit::IValue> {
                      if (args.at(n->input(0)).IValue()->isList()) {
diff --git a/workspace/core/partitioning/partitioning.cpp b/tmp/changes.txt
old mode 100755
new mode 100644
diff --git a/workspace/core/lowering/register_trt_placeholder_ops.cpp b/tmp/changes.txt
index 5ba8171..17d7d3f 100644
--- a/workspace/core/lowering/register_trt_placeholder_ops.cpp
+++ b/tmp/changes.txt
@@ -10,7 +10,10 @@ c10::AliasAnalysisKind aliasAnalysisFromSchema() {
RegisterOperators trt_placeholder_ops_reg({
    /// Op marks a Tensor to be conveted from an Torch Tensor
    /// to a TRT constant Tensor
-    Operator("trt::const(Tensor val) -> Tensor", [](Stack& stack) { /*noop*/ }, aliasAnalysisFromSchema()),
+    Operator(
+        "trt::const(Tensor val) -> Tensor",
+        [](Stack& stack) { /*noop*/ },
+        aliasAnalysisFromSchema()),
});

} // namespace jit
diff --git a/workspace/core/lowering/passes/exception_elimination.cpp b/tmp/changes.txt
index 77aec78..abed644 100644
--- a/workspace/core/lowering/passes/exception_elimination.cpp
+++ b/tmp/changes.txt
@@ -44,9 +44,9 @@ struct ExceptionOrPassPatternElimination {
    bool arm1_starts_with_exception = (*arm1_start)->kind() == prim::RaiseException;
    bool arm2_starts_with_exception = (*arm2_start)->kind() == prim::RaiseException;

-    //if (!arm1_starts_with_exception && !arm2_starts_with_exception) {
-      // Neither arm matches the pattern
-   //   return false;
+    // if (!arm1_starts_with_exception && !arm2_starts_with_exception) {
+    // Neither arm matches the pattern
+    //   return false;
    //}

    /// Check if this Node hosts a pattern like so:
diff --git a/workspace/tests/core/lowering/test_exception_elimination_pass.cpp b/tmp/changes.txt
index 5a0931e..b7e4ac0 100644
--- a/workspace/tests/core/lowering/test_exception_elimination_pass.cpp
+++ b/tmp/changes.txt
@@ -44,7 +44,7 @@ TEST(LoweringPasses, EliminateExceptionOrPassPattern_Block0) {
  auto if_block0 = if_node->addBlock();
  auto exception_node = g->create(torch::jit::prim::RaiseException, {except_val, none_const_val}, 0);
  if_block0->appendNode(exception_node);
-  /*auto if_block1 =*/ if_node->addBlock();
+  /*auto if_block1 =*/if_node->addBlock();
  g->insertNode(if_node);
  auto cat_node = g->create(torch::jit::aten::cat, {list_node->output(), zero_const_val});
  g->insertNode(cat_node);
@@ -97,7 +97,7 @@ TEST(LoweringPasses, EliminateExceptionOrPassPattern_Block1) {
  bool_node->output()->setType(torch::jit::BoolType::get());
  g->insertNode(bool_node);
  auto if_node = g->create(torch::jit::prim::If, {bool_node->output()}, 0);
-  /*auto if_block0 = */if_node->addBlock();
+  /*auto if_block0 = */ if_node->addBlock();
  auto if_block1 = if_node->addBlock();
  auto exception_node = g->create(torch::jit::prim::RaiseException, {except_val, none_const_val}, 0);
  if_block1->appendNode(exception_node);
@@ -154,7 +154,7 @@ TEST(LoweringPasses, EliminateExceptionOrPassPattern_Negative) {
  auto if_block0 = if_node->addBlock();
  auto append_node = g->create(torch::jit::aten::append, {list_node->output(), y});
  if_block0->appendNode(append_node);
-  /*auto if_block1 = */if_node->addBlock();
+  /*auto if_block1 = */ if_node->addBlock();
  g->insertNode(if_node);
  auto cat_node = g->create(torch::jit::aten::cat, {list_node->output(), zero_const_val});
  g->insertNode(cat_node);
ERROR: Some files do not conform to style guidelines

Signed-off-by: Naren Dasan <[email protected]>
Signed-off-by: Naren Dasan <[email protected]>
Copy link

@github-actions github-actions bot left a 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

Copy link

@github-actions github-actions bot left a 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/workspace/core/partitioning/partitioning.cpp b/tmp/changes.txt
old mode 100755
new mode 100644
ERROR: Some files do not conform to style guidelines

Copy link

@github-actions github-actions bot left a 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

Copy link

@github-actions github-actions bot left a 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

@narendasan narendasan merged commit d0ea834 into master May 8, 2022
@narendasan narendasan deleted the fixing_master branch May 8, 2022 04:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: conversion Issues re: Conversion stage component: core Issues re: The core compiler component: evaluators Issues re: Specific op evaluators component: lowering Issues re: The lowering / preprocessing passes component: partitioning component: tests Issues re: Tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant