-
Notifications
You must be signed in to change notification settings - Fork 364
Centralizing Partitioning State #1263
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
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
d00240e
feat(aten::hardsigmoid): Unpack hardsigmoid
narendasan c9e504d
chore: reorg in prep for state centralizing
narendasan 85f8cc3
refactor(//core/partitioning): Centralizing partitioning state
narendasan 1a4084b
chore: update usage in py api
narendasan ffb20e4
Merge branch 'master' into partitioning_ctx
narendasan 4cc3143
fix: Update new info name
narendasan c3082f5
refactor: refactor the NodeExecutor logic
bowang007 a165811
fix: fix typo
bowang007 ff22707
refactor: extract stitching phase out of compiler.cpp
bowang007 77f4c09
fix: fix bugs found when running tests
bowang007 34366b3
fix: change the shouldNodeRunInTorch logic
bowang007 6db9ffb
chore: Rebase with master
peri044 d053b4d
chore: address review comments
peri044 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#include "torch/csrc/jit/passes/subgraph_rewrite.h" | ||
|
||
#include "core/util/prelude.h" | ||
|
||
namespace torch_tensorrt { | ||
namespace core { | ||
namespace lowering { | ||
namespace passes { | ||
|
||
void UnpackHardSigmoid(std::shared_ptr<torch::jit::Graph>& graph) { | ||
std::string hardsigmoid_pattern = R"IR( | ||
graph(%input): | ||
%result = aten::hardsigmoid(%input) | ||
return (%result))IR"; | ||
|
||
std::string hardsigmoid_pattern_inplace = R"IR( | ||
graph(%input): | ||
%result = aten::hardsigmoid_(%input) | ||
return (%result))IR"; | ||
|
||
std::string new_pattern = R"IR( | ||
graph(%x.1): | ||
%22 : float = prim::Constant[value=0.5]() | ||
%3 : int = prim::Constant[value=6]() | ||
%5 : int = prim::Constant[value=1]() | ||
%10 : int = prim::Constant[value=0]() | ||
%4 : Tensor = aten::div(%x.1, %3) | ||
%9 : Tensor = aten::add(%4, %22, %5) | ||
%21 : Tensor = aten::clamp(%9, %10, %5) | ||
return (%21))IR"; | ||
|
||
torch::jit::SubgraphRewriter rewriter; | ||
rewriter.RegisterRewritePattern(hardsigmoid_pattern, new_pattern); | ||
rewriter.RegisterRewritePattern(hardsigmoid_pattern_inplace, new_pattern); | ||
rewriter.runOnGraph(graph); | ||
|
||
LOG_GRAPH("Post unpack hardsigmoid: " << *graph); | ||
} | ||
|
||
} // namespace passes | ||
} // namespace lowering | ||
} // namespace core | ||
} // namespace torch_tensorrt |
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.