forked from apache/tvm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change Call with TIRCallAttrs to call_lowered op (apache#9312)
* Introduce call_lowered op Add op vm.call_tir Change from checking if CallNode has CallTIRAttrs to checking if the Op is vm.call_tir Change device_domains to use vm.call_tir op more explicitly Fixed issue in type checker, now have seg fault :( Fix typo -- most of VM tests pass now Interpreter now deals with call_tir properly Fix typo in te_compiler Use InvokeTVMOp and CallTIR Add some checks to graph_plan_memory.cc Make GetToken skip function types C++ TESTS PASS WOOHOO Remove prints formatting vm.call_tir -> call_tir and more comment removals call_tir -> call_lowered fix lint clang format Remove compute from non computational vm ops missed some semicolons in prev commit Fix warning Move call_lowered to relay/op/call/call.cc and rename util func Add helper fn that returns lowered_call op fix import order clang format Add constraint to call_lowered type rel clean up empty token vector comment Move CallTIRAttrs to include/tvm/relay/attrs/call.h Rename TIRCallAttrs as CallLoweredAttrs lint Add helper for extracting func and args from call_lowered Change graph_executor_codegen to use helper function Update interpreter to use helper Fix device_domains.cc -- could still use cleanup, also I am not sure why there are still direct calls to primfns in DomainforCallee Clean up DeviceCopyProps and lint lint return CallLoweredAttrs with the extern func comment note in comment Progress & notes. Realized that I am not handling externs correctly not sure why this ever worked before? Clean up CreateFuncCall signature, notes comments Fix extern function handling extern_function -> extern_func fix DeviceAwareVisitExpr_ -- now it handles both lowered and normal calls yay passes AOT tests! formatting and comment removal cleanup Introduce call_lowered op * lint * Fix AOT to deal with externs * add const auto& * Fix aot crt test
- Loading branch information
1 parent
8e17273
commit 1075677
Showing
14 changed files
with
603 additions
and
265 deletions.
There are no files selected for viewing
This file contains 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 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,48 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
/*! | ||
* \file tvm/relay/attrs/call.h | ||
* \brief Attribute for call_lowered operator. | ||
*/ | ||
#ifndef TVM_RELAY_ATTRS_CALL_H_ | ||
#define TVM_RELAY_ATTRS_CALL_H_ | ||
|
||
#include <tvm/ir/attrs.h> | ||
|
||
#include <string> | ||
|
||
namespace tvm { | ||
namespace relay { | ||
|
||
/*! | ||
* \brief Metadata for calls to TIR functions, useful for program analysis crossing Relay and TIR. | ||
*/ | ||
struct CallLoweredAttrs : public tvm::AttrsNode<CallLoweredAttrs> { | ||
/*! \brief The metadata attached to the call node. */ | ||
Map<String, ObjectRef> metadata; | ||
|
||
TVM_DECLARE_ATTRS(CallLoweredAttrs, "relay.attrs.CallLoweredAttrs") { | ||
TVM_ATTR_FIELD(metadata).describe("Metadata attached to the lowered function call."); | ||
} | ||
}; | ||
|
||
} // namespace relay | ||
} // namespace tvm | ||
#endif // TVM_RELAY_ATTRS_CALL_H_ |
This file contains 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 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 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.