You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tvm.apache.org by Christoph Gerum via Apache TVM Discuss <no...@discuss.tvm.ai> on 2020/11/11 17:16:59 UTC
[Apache TVM Discuss] [Development/RFC] [Guideline] Relay AOT
Not sure whether it makes sense to revive such an old RFC, but has there been any progress on a relay AOT? IMHO this would be very much needed, especially for microcontrollers.
---
[Visit Topic](https://discuss.tvm.apache.org/t/guideline-relay-aot/5977/2) to respond.
You are receiving this because you enabled mailing list mode.
To unsubscribe from these emails, [click here](https://discuss.tvm.apache.org/email/unsubscribe/07c605a5d43e783e67c6ab6b84b51262311a6aa6f98659971e4b8a36ba18e32f).
[Apache TVM Discuss] [Development/RFC] [Guideline] Relay AOT
Posted by aca88 via Apache TVM Discuss <no...@discuss.tvm.ai>.
Hey Andrew,
Thanks for sharing your progress.
Sadly I can't get your branch to build
```
[ 77%] Building CXX object CMakeFiles/tvm_objs.dir/src/relay/backend/param_dict.cc.o
/home/areusch_tvm/src/relay/backend/graph_runtime_codegen.cc: In member function ‘void tvm::relay::backend::AotCodegen::FinishFunctionDecl(int, tvm::runtime::Array<tvm::Integer>)’:
/home/areusch_tvm/src/relay/backend/graph_runtime_codegen.cc:243:31: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (int i = nargs + 1; i < storage_token_sizes.size(); ++i) {
~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/areusch_tvm/src/relay/backend/graph_runtime_codegen.cc:247:31: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (int i = nargs + 1; i < storage_token_sizes.size(); ++i) {
~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/areusch_tvm/src/relay/backend/graph_runtime_codegen.cc: In member function ‘void tvm::relay::backend::AotCodegen::WriteDLTensor(std::ostream&, std::__cxx11::string, std::__cxx11::string, size_t, std::vector<long int>, std::__cxx11::string)’:
/home/areusch_tvm/src/relay/backend/graph_runtime_codegen.cc:257:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (int i = 0; i < ndim; ++i) {
~~^~~~~~
/home/areusch_tvm/src/relay/backend/graph_runtime_codegen.cc: In member function ‘void tvm::relay::backend::AotCodegen::_SidToArg(int, const tvm::runtime::Array<tvm::runtime::Array<tvm::Integer> >&, tvm::relay::Expr, std::vector<std::__cxx11::basic_string<char> >*, std::vector<std::__cxx11::basic_string<char> >*)’:
/home/areusch_tvm/src/relay/backend/graph_runtime_codegen.cc:301:30: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if (uint64_t(sids[0][0]) == return_sid_) {
~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
/home/areusch_tvm/src/relay/backend/graph_runtime_codegen.cc:303:92: error: ‘class std::basic_ostream<char>’ has no member named ‘str’; did you mean ‘setf’?
values->emplace_back((std::stringstream() << "values[" << return_value_index << "]").str());
^~~
setf
/home/areusch_tvm/src/relay/backend/graph_runtime_codegen.cc:304:92: error: ‘class std::basic_ostream<char>’ has no member named ‘str’; did you mean ‘setf’?
tcodes->emplace_back((std::stringstream() << "tcodes[" << return_value_index << "]").str());
^~~
setf
[ 77%] Building CXX object CMakeFiles/tvm_objs.dir/src/relay/backend/vm/compiler.cc.o
/home/areusch_tvm/src/relay/backend/graph_runtime_codegen.cc:311:74: error: ‘std::ostream {aka class std::basic_ostream<char>}’ has no member named ‘str’; did you mean ‘setf’?
std::string sid_name = (std::stringstream() << "sid_" << sids[0][0]).str();
^~~
setf
/home/areusch_tvm/src/relay/backend/graph_runtime_codegen.cc: In member function ‘void tvm::relay::backend::AotCodegen::AddFunctionCall(std::__cxx11::string, const tvm::relay::CallNode*, std::__cxx11::string, const tvm::Map<tvm::RelayExpr, tvm::runtime::Array<tvm::runtime::Array<tvm::Integer> > >&)’:
/home/areusch_tvm/src/relay/backend/graph_runtime_codegen.cc:323:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (int i = 0; i < nargs; ++i) {
~~^~~~~~~
/home/areusch_tvm/src/relay/backend/graph_runtime_codegen.cc:328:80: error: ‘class std::basic_ostream<char>’ has no member named ‘str’; did you mean ‘setf’?
values.emplace_back((std::stringstream() << "values[" << index << "]").str());
^~~
setf
/home/areusch_tvm/src/relay/backend/graph_runtime_codegen.cc:329:80: error: ‘class std::basic_ostream<char>’ has no member named ‘str’; did you mean ‘setf’?
tcodes.emplace_back((std::stringstream() << "tcodes[" << index << "]").str());
^~~
setf
/home/areusch_tvm/src/relay/backend/graph_runtime_codegen.cc:332:85: error: ‘class std::basic_ostream<char>’ has no member named ‘str’; did you mean ‘setf’?
values.emplace_back((std::stringstream() << "&" << value.first << "_param").str());
^~~
setf
/home/areusch_tvm/src/relay/backend/graph_runtime_codegen.cc:348:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (int i = 0; i < values.size(); i++) {
~~^~~~~~~~~~~~~~~
/home/areusch_tvm/src/relay/backend/graph_runtime_codegen.cc:349:48: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
ss_ << " " << values[i] << (i < (values.size() - 1) ? ", " : "") << std::endl;
~~^~~~~~~~~~~~~~~~~~~~~
/home/areusch_tvm/src/relay/backend/graph_runtime_codegen.cc:353:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (int i = 0; i < tcodes.size(); ++i) {
~~^~~~~~~~~~~~~~~
/home/areusch_tvm/src/relay/backend/graph_runtime_codegen.cc:354:48: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
ss_ << " " << tcodes[i] << (i < (tcodes.size() - 1) ? ", " : "") << std::endl;
~~^~~~~~~~~~~~~~~~~~~~~
[ 77%] Building CXX object CMakeFiles/tvm_objs.dir/src/relay/backend/vm/inline_primitives.cc.o
````
Also looking at the example output provided, I see [sid_2 being allocated](https://github.com/areusch/incubator-tvm/blob/aot-experiment/sample-output.txt#L125) but never being used.
I have a question about the return values of the function calls.
More specifically, the output of [`fused_layout_transform_2`](https://github.com/areusch/incubator-tvm/blob/aot-experiment/sample-output.txt#L139). Is the return tensor [`values[1]`](https://github.com/areusch/incubator-tvm/blob/aot-experiment/sample-output.txt#L130) or is it [`subcall_ret_value`](https://github.com/areusch/incubator-tvm/blob/aot-experiment/sample-output.txt#L136)?
* seeing line [156](https://github.com/areusch/incubator-tvm/blob/aot-experiment/sample-output.txt#L156), I would say its in `values[1]`, but then what is `subcall_ret_value`?
Again thanks for showing some of the progress :)
---
[Visit Topic](https://discuss.tvm.apache.org/t/guideline-relay-aot/5977/4) to respond.
You are receiving this because you enabled mailing list mode.
To unsubscribe from these emails, [click here](https://discuss.tvm.apache.org/email/unsubscribe/0d952371fc43813318e4cec77ac90f8de7e9728f61d2aceb0257e7d56ccc5cbc).
[Apache TVM Discuss] [Development/RFC] [Guideline] Relay AOT
Posted by Andrew Reusch via Apache TVM Discuss <no...@discuss.tvm.ai>.
hi @cgerum, I have a prototype of P0 [here](https://github.com/areusch/incubator-tvm/tree/aot-experiment). it's not ready to merge and I think we should move to the P1 approach before we do. Feel free to take a look at it if you like.
Andrew
---
[Visit Topic](https://discuss.tvm.apache.org/t/guideline-relay-aot/5977/3) to respond.
You are receiving this because you enabled mailing list mode.
To unsubscribe from these emails, [click here](https://discuss.tvm.apache.org/email/unsubscribe/5d50da301e1e70043966fb0dfe359bbe608c90f78a5085ae2339df0d4de7c2fa).