You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2020/07/29 07:27:25 UTC

[GitHub] [incubator-tvm] liangfu commented on a change in pull request #6145: [µTVM] Add --runtime=c, remove micro_dev target, enable LLVM backend

liangfu commented on a change in pull request #6145:
URL: https://github.com/apache/incubator-tvm/pull/6145#discussion_r462004252



##########
File path: apps/bundle_deploy/bundle_static.c
##########
@@ -86,5 +93,30 @@ TVM_DLL void tvm_runtime_get_output(void* runtime, int32_t index, DLTensor* tens
 
 void __attribute__((noreturn)) TVMPlatformAbort(int error_code) {
   fprintf(stderr, "TVMPlatformAbort: %d\n", error_code);
+  void* trace[200];
+  int nptrs = backtrace(trace, sizeof(trace) / sizeof(void*));
+  fprintf(stderr, "backtrace: %d\n", nptrs);
+  if (nptrs < 0) {
+    perror("backtracing");
+  } else {
+    backtrace_symbols_fd(trace, nptrs, STDOUT_FILENO);

Review comment:
       This is a great feature to have backtrace enabled, however, since these functions are not part of the standard c programming language, and it would have potential portability issue, can we add a macro to disable this feature for the platforms where backtracing is not supported?

##########
File path: tests/python/unittest/test_target_codegen_llvm.py
##########
@@ -784,26 +784,37 @@ def dotest(do_vectorize):
     dotest(True)
     dotest(False)
 
+def test_llvm_crt_static_lib():
+    A = te.placeholder((32, ), dtype='bfloat16')
+    B = te.placeholder((32, ), dtype='bfloat16')
+    d = te.compute((32, ), lambda x: A[x] + B[x])
+    sch = te.create_schedule(d.op)
+    module = tvm.build(sch, [A, B, d], target=tvm.target.create('llvm --system-lib --runtime=c'))
+    print(module.get_source())
+    module.save('test.o')
+
+
 if __name__ == "__main__":
-    test_multiple_func()
-    test_llvm_large_uintimm()
-    test_llvm_import()
-    test_alignment()
-    test_rank_zero()
-    test_rank_zero_bound_checkers()
-    test_llvm_bool()
-    test_llvm_persist_parallel()
-    test_llvm_condition()
-    test_llvm_vadd_pipeline()
-    test_llvm_add_pipeline()
-    test_llvm_intrin()
-    test_llvm_overloaded_intrin()
-    test_llvm_flip_pipeline()
-    test_llvm_madd_pipeline()
-    test_llvm_temp_space()
-    test_llvm_lookup_intrin()
-    test_llvm_div()
-    test_llvm_fp_math()
-    test_dwarf_debug_information()
-    test_llvm_shuffle()
-    test_llvm_bf16()
+    # test_multiple_func()

Review comment:
       did you disable these unintentionally?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org