-
Notifications
You must be signed in to change notification settings - Fork 72
Migrate onnxrewriter #1346
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
Migrate onnxrewriter #1346
Conversation
Squashed of the following steps: - #1328 - #1329 - #1330 - #1331 - #1332 - #1333 - #1343 - #1345 Co-authored-by: Shubham Bhokare <[email protected]> Co-authored-by: Justin Chu <[email protected]> Co-authored-by: Xavier Dupré <[email protected]> Co-authored-by: "G. Ramalingam" <[email protected]> Co-authored-by: kunal-vaishnavi <[email protected]> Co-authored-by: Ti-Tai Wang <[email protected]> [ghstack-poisoned]
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.
lintrunner found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.
Test Results 24 files ± 0 24 suites ±0 17m 48s ⏱️ - 1h 30m 16s Results for commit 667ab08. ± Comparison against base commit e29b43a. ♻️ This comment has been updated with latest results. |
Squashed of the following steps: - #1328 - #1329 - #1330 - #1331 - #1332 - #1333 - #1343 - #1345 Co-authored-by: Shubham Bhokare <32080845+shubhambhokare1users.noreply.github.com> Co-authored-by: Justin Chu <justinchubyusers.noreply.github.com> Co-authored-by: Xavier Dupré <xadupreusers.noreply.github.com> Co-authored-by: "G. Ramalingam" <gramamicrosoft.com> Co-authored-by: kunal-vaishnavi <115581922+kunal-vaishnaviusers.noreply.github.com> Co-authored-by: Ti-Tai Wang <titaiwangmicrosoft.com> [ghstack-poisoned]
# for name, init in pattern.initializers.items(): | ||
# # We add them to the graph, they will be removed if unused. | ||
# new_name = g.make_initializer(name, init) | ||
# replacements[new_name] = name |
Check notice
Code scanning / CodeQL
Commented-out code
# def exit_scope(self, graph: onnx.GraphProto) -> SubScope: | ||
# # Also sync updated ir values back to value_info in graph. | ||
# sub_scope = super().exit_scope(graph) |
Check notice
Code scanning / CodeQL
Commented-out code
This is a placeholder, subject to simplification when a proper IR is defined. | ||
""" | ||
|
||
def get_input(self, node: onnx.NodeProto, index: int) -> ir.Value | None: ... |
Check notice
Code scanning / CodeQL
Statement has no effect
|
||
def get_input(self, node: onnx.NodeProto, index: int) -> ir.Value | None: ... | ||
|
||
def get_output(self, node: onnx.NodeProto, index: int) -> ir.Value | None: ... |
Check notice
Code scanning / CodeQL
Statement has no effect
|
||
def get_output(self, node: onnx.NodeProto, index: int) -> ir.Value | None: ... | ||
|
||
def input_const_value(self, node: onnx.NodeProto, index: int) -> ir.ConcreteValue: ... |
Check notice
Code scanning / CodeQL
Statement has no effect
|
||
def lookup_version(self, domain: str) -> int: ... | ||
|
||
def convert_attributes(self, attributes: Sequence[onnx.AttributeProto]) -> dict: ... |
Check notice
Code scanning / CodeQL
Statement has no effect
|
||
def convert_attributes(self, attributes: Sequence[onnx.AttributeProto]) -> dict: ... | ||
|
||
def new_constant(self, name: str, value: Any) -> Sequence[onnx.NodeProto] | None: ... |
Check notice
Code scanning / CodeQL
Statement has no effect
logger = logging.getLogger(__name__) | ||
|
||
|
||
class FunctionRewriteError(RuntimeError): ... |
Check notice
Code scanning / CodeQL
Statement has no effect
# The rule is easy to create. | ||
|
||
|
||
rule = org.make_pattern_rule( |
Check warning
Code scanning / CodeQL
Variable defined multiple times
|
||
# Currently, the replacement graph function is the same as the pattern function. | ||
# This may change in the future. | ||
_handle_replacement_return_value = _handle_pattern_return_value |
Check notice
Code scanning / CodeQL
Unused global variable
Squashed of the following steps: - #1328 - #1329 - #1330 - #1331 - #1332 - #1333 - #1343 - #1345 Co-authored-by: Shubham Bhokare <32080845+shubhambhokare1users.noreply.github.com> Co-authored-by: Justin Chu <justinchubyusers.noreply.github.com> Co-authored-by: Xavier Dupré <xadupreusers.noreply.github.com> Co-authored-by: "G. Ramalingam" <gramamicrosoft.com> Co-authored-by: kunal-vaishnavi <115581922+kunal-vaishnaviusers.noreply.github.com> Co-authored-by: Ti-Tai Wang <titaiwangmicrosoft.com> [ghstack-poisoned]
Stack from ghstack (oldest at bottom):
Squashed of the following steps:
_legacy_ir
folder #1332Co-authored-by: Shubham Bhokare [email protected]
Co-authored-by: Justin Chu [email protected]
Co-authored-by: Xavier Dupré [email protected]
Co-authored-by: "G. Ramalingam" [email protected]
Co-authored-by: kunal-vaishnavi [email protected]
Co-authored-by: Ti-Tai Wang [email protected]