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:32:21 UTC

[GitHub] [incubator-tvm] trevor-m opened a new pull request #6150: Fix -mfloat-abi=soft compilation for ARM with OpenCL target

trevor-m opened a new pull request #6150:
URL: https://github.com/apache/incubator-tvm/pull/6150


   Currently, any extra attributes of the llvm target are not being passed through to LLVMModule during `ModulePackImportsToLLVM`. This will cause compilation to fail with `error: /tmp/tmpctakbpk1/devc.o uses VFP register arguments, output does not` when the target is opencl and the target_host requires `-mfloat-abi=soft`.
   
   There are two reasons why:
   1. `python/tvm/runtime/module.py` uses "_get_target_triple" to get the target triple to use for `ModulePackImportsToLLVM`. However, the implementation of that function uses `tm_->getTargetTriple().str()` which will only have the standard `<arch><sub>-<vendor>-<sys>-<abi>` and is missing any extra flags or attributes such as `-mfloat-abi=soft`.
   2. Since the module was created by CodegenBlob, it doesn't store anything in the "tvm_target" module metadata and therefore `module_->getTargetTriple()` is called which again doesn't have the extra flags and attributes: https://github.com/apache/incubator-tvm/blob/master/src/target/llvm/llvm_module.cc#L254 
   
   
   This PR fixes those problems by:
   1. Adding important attributes back into  `_get_target_triple` (only mfloat-abi for now). This part doesn't seem ideal to me. Any thoughts on how to improve? Can we store the user's full target string earlier on?
   2. Saving full target triple string in "tvm_target" module metadata flag during `CodeGenBlob` so that `LLVMModuleNode::Init(std::unique_ptr<llvm::Module> module, std::shared_ptr<llvm::LLVMContext> ctx)` can retrieve it: https://github.com/apache/incubator-tvm/blob/master/src/target/llvm/llvm_module.cc#L247 This matches what `LLVMModuleNode::Init(const IRModule& mod, std::string target)` already does.
   
   
   
   Discuss post: https://discuss.tvm.ai/t/opencl-target-for-32-bit-arm-linux-android-broken-after-pr-4657/7252
   Fixes https://github.com/apache/incubator-tvm/issues/6019
   


----------------------------------------------------------------
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



[GitHub] [incubator-tvm] trevor-m commented on pull request #6150: Fix -mfloat-abi=soft compilation for ARM with OpenCL target

Posted by GitBox <gi...@apache.org>.
trevor-m commented on pull request #6150:
URL: https://github.com/apache/incubator-tvm/pull/6150#issuecomment-669295770


   @kevinthesun CI is passing now


----------------------------------------------------------------
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



[GitHub] [incubator-tvm] trevor-m commented on pull request #6150: Fix -mfloat-abi=soft compilation for ARM with OpenCL target

Posted by GitBox <gi...@apache.org>.
trevor-m commented on pull request #6150:
URL: https://github.com/apache/incubator-tvm/pull/6150#issuecomment-665233335


   Looks like some unrelated failures in ci? `tests/python/frontend/tensorflow/test_forward.py::test_forward_nms FAILED [ 50%]`
   
   ```
   E     let %x7: Tensor[(5), int32] = vm.reshape_tensor(%x5, meta[relay.Constant][6], meta[relay.attrs.ReshapeTensorAttrs][0]) an internal invariant was violated while typechecking your program [00:42:28] /workspace/src/relay/op/vm/vm.cc:195: Check failed: tt: input must be tensor type
   ```


----------------------------------------------------------------
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



[GitHub] [incubator-tvm] junrushao1994 commented on pull request #6150: Fix -mfloat-abi=soft compilation for ARM with OpenCL target

Posted by GitBox <gi...@apache.org>.
junrushao1994 commented on pull request #6150:
URL: https://github.com/apache/incubator-tvm/pull/6150#issuecomment-665236050


   Yes, looks like the CI failure is not related


----------------------------------------------------------------
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



[GitHub] [incubator-tvm] tqchen merged pull request #6150: Fix -mfloat-abi=soft compilation for ARM with OpenCL target

Posted by GitBox <gi...@apache.org>.
tqchen merged pull request #6150:
URL: https://github.com/apache/incubator-tvm/pull/6150


   


----------------------------------------------------------------
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