Skip to content

If loop support #976

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 6 commits into from
Apr 19, 2022
Merged

If loop support #976

merged 6 commits into from
Apr 19, 2022

Conversation

narendasan
Copy link
Collaborator

Description

Fixes an issue with op support which causes partitioning to think If and Loop are not supported

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)

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 narendasan requested a review from andi4191 April 14, 2022 03:08
@github-actions github-actions bot added component: conversion Issues re: Conversion stage component: core Issues re: The core compiler labels Apr 14, 2022
which are handled by conversion and not a converter

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]>
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 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/conversion.cpp b/tmp/changes.txt
index 32d74b4..c8e1020 100644
--- a/workspace/core/conversion/conversion.cpp
+++ b/tmp/changes.txt
@@ -20,10 +20,8 @@ namespace conversion {
bool isNodeConversionIgnored(const torch::jit::Node* n);

bool OpSupported(const torch::jit::Node* n) {
-  return evaluators::shouldEvalAtConversionTime(n)
-    || converters::node_is_convertable(n)
-    || n->kind() == torch::jit::prim::Loop
-    || n->kind() == torch::jit::prim::If;
+  return evaluators::shouldEvalAtConversionTime(n) || converters::node_is_convertable(n) ||
+      n->kind() == torch::jit::prim::Loop || n->kind() == torch::jit::prim::If;
}

c10::optional<torch::jit::IValue> EvaluateNode(ConversionCtx* ctx, const torch::jit::Node* n, int level, int limit) {
diff --git a/workspace/core/conversion/evaluators/eval_util.cpp b/tmp/changes.txt
old mode 100755
new mode 100644
diff --git a/workspace/core/conversion/evaluators/prim.cpp b/tmp/changes.txt
old mode 100755
new mode 100644
diff --git a/workspace/core/conversion/evaluators/eval_util.h 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.

There are some changes that do not conform to C++ style guidelines:

diff --git a/workspace/core/conversion/conversion.cpp b/tmp/changes.txt
index 32d74b4..c8e1020 100644
--- a/workspace/core/conversion/conversion.cpp
+++ b/tmp/changes.txt
@@ -20,10 +20,8 @@ namespace conversion {
bool isNodeConversionIgnored(const torch::jit::Node* n);

bool OpSupported(const torch::jit::Node* n) {
-  return evaluators::shouldEvalAtConversionTime(n)
-    || converters::node_is_convertable(n)
-    || n->kind() == torch::jit::prim::Loop
-    || n->kind() == torch::jit::prim::If;
+  return evaluators::shouldEvalAtConversionTime(n) || converters::node_is_convertable(n) ||
+      n->kind() == torch::jit::prim::Loop || n->kind() == torch::jit::prim::If;
}

c10::optional<torch::jit::IValue> EvaluateNode(ConversionCtx* ctx, const torch::jit::Node* n, int level, int limit) {
diff --git a/workspace/core/conversion/evaluators/eval_util.cpp b/tmp/changes.txt
old mode 100755
new mode 100644
diff --git a/workspace/core/conversion/evaluators/prim.cpp b/tmp/changes.txt
old mode 100755
new mode 100644
diff --git a/workspace/core/conversion/evaluators/eval_util.h b/tmp/changes.txt
old mode 100755
new mode 100644
ERROR: Some files do not conform to style guidelines

Signed-off-by: Naren Dasan <[email protected]>
Signed-off-by: Naren Dasan <[email protected]>
@github-actions github-actions bot added the component: api [Python] Issues re: Python API label Apr 14, 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.

There are some changes that do not conform to C++ style guidelines:

diff --git a/workspace/core/conversion/evaluators/eval_util.cpp b/tmp/changes.txt
old mode 100755
new mode 100644
diff --git a/workspace/core/conversion/evaluators/prim.cpp b/tmp/changes.txt
old mode 100755
new mode 100644
diff --git a/workspace/core/conversion/evaluators/eval_util.h b/tmp/changes.txt
old mode 100755
new mode 100644
diff --git a/workspace/tests/core/lowering/test_reduce_to_pass.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 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/eval_util.cpp b/tmp/changes.txt
old mode 100755
new mode 100644
diff --git a/workspace/core/conversion/evaluators/prim.cpp b/tmp/changes.txt
old mode 100755
new mode 100644
diff --git a/workspace/core/conversion/evaluators/eval_util.h b/tmp/changes.txt
old mode 100755
new mode 100644
diff --git a/workspace/tests/core/lowering/test_reduce_to_pass.cpp b/tmp/changes.txt
old mode 100755
new mode 100644
ERROR: Some files do not conform to style guidelines

Signed-off-by: Naren Dasan <[email protected]>
Signed-off-by: Naren Dasan <[email protected]>
@github-actions github-actions bot added component: evaluators Issues re: Specific op evaluators component: tests Issues re: Tests labels Apr 19, 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 C++ 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

@narendasan narendasan merged commit bf8af5a into master Apr 19, 2022
@narendasan narendasan deleted the if_loop_support branch April 19, 2022 00:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: api [Python] Issues re: Python API component: conversion Issues re: Conversion stage component: core Issues re: The core compiler component: evaluators Issues re: Specific op evaluators component: tests Issues re: Tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants