Skip to content
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

[RELAY] Filter PlaceholderOp from schedule. #2412

Merged
merged 4 commits into from
Jan 15, 2019

Conversation

srkreddy1238
Copy link
Contributor

Thanks for contributing to TVM! Please refer to guideline https://docs.tvm.ai/contribute/ for useful information and tips. After the pull request is submitted, please request code reviews from Reviewers.

@tqchen
Copy link
Member

tqchen commented Jan 10, 2019

What is the motivation on this? The compile engine should have included all the inputs including placeholder

@srkreddy1238
Copy link
Contributor Author

this is to handle a situation like below

--------------------------
fn (%p0: Tensor[(1, 10000), float32],
    %p1: Tensor[(1, 2, 1, 200), float32],
    %p2: Tensor[(1, 2, 1, 200), float32])
    -> Tuple[Tensor[(1, 10000), float32], Tensor[(2, 2, 1, 200), float32]] {
  %0 = (%p1, %p2)
  %1 = concatenate(%0) # ty=Tensor[(2, 2, 1, 200), float32]
  %2 = (%p0, %1)
  %2
}
--------------------------

where p0 is a bypass. Ref. #2216 (comment)

@tqchen
Copy link
Member

tqchen commented Jan 11, 2019

OK, this seems to be fine, can you please document the intent of the code as a comment block? Please also add a test case as per https://docs.tvm.ai/contribute/code_review.html#ensure-test-coverage

@icemelon icemelon added the status: need update need update based on feedbacks label Jan 11, 2019
@srkreddy1238
Copy link
Contributor Author

Test case added, but enabling fuse pass has another issue as given below.

Traceback (most recent call last):
  File "./tests/python/relay/test_backend_compile_engine.py", line 48, in <module>
    test_compile_placeholder_bypass()
  File "./tests/python/relay/test_backend_compile_engine.py", line 44, in test_compile_placeholder_bypass
    graph, lib, params = relay.build(func, 'llvm')
  File "/home/srk/.local/lib/python3.6/site-packages/tvm-0.5.dev0-py3.6-linux-x86_64.egg/tvm/relay/build_module.py", line 276, in build
    lowered_funcs, target=target, target_host=target_host)
  File "/home/srk/.local/lib/python3.6/site-packages/tvm-0.5.dev0-py3.6-linux-x86_64.egg/tvm/build_module.py", line 592, in build
    mhost = codegen.build_module(fhost_all, str(target_host))
  File "/home/srk/.local/lib/python3.6/site-packages/tvm-0.5.dev0-py3.6-linux-x86_64.egg/tvm/codegen.py", line 20, in build_module
    return _Build(lowered_func, target)
  File "/home/srk/.local/lib/python3.6/site-packages/tvm-0.5.dev0-py3.6-linux-x86_64.egg/tvm/_ffi/_ctypes/function.py", line 185, in __call__
    ctypes.byref(ret_val), ctypes.byref(ret_tcode)))
  File "/home/srk/.local/lib/python3.6/site-packages/tvm-0.5.dev0-py3.6-linux-x86_64.egg/tvm/_ffi/base.py", line 72, in check_call
    raise TVMError(py_str(_LIB.TVMGetLastError()))
tvm._ffi.base.TVMError: [11:53:12] /home/srk/work/DMLC/tvm/src/codegen/llvm/llvm_module.cc:173: LLVM module verification failed with the following errors: 
Invalid operand types for FCmp instruction
  %243 = fcmp oeq i8* %34, %242

I may need some help here.

@jroesch
Copy link
Member

jroesch commented Jan 15, 2019

This makes sense to me, we need someone with more TVM experience to explain the LLVM failure. It looks like the compiler is producing invalid IR.

src/relay/backend/compile_engine.cc Outdated Show resolved Hide resolved
@tqchen
Copy link
Member

tqchen commented Jan 15, 2019

@srkreddy1238 can you act on @jroesch 's comment, and we can merge this. The new error seems was due to wrong type info

@srkreddy1238
Copy link
Contributor Author

cc @tqchen

@tqchen tqchen merged commit 6ab0508 into apache:master Jan 15, 2019
@tqchen
Copy link
Member

tqchen commented Jan 15, 2019

Thanks to @srkreddy1238 @jroesch , this is now merged

@tqchen tqchen added status: accepted and removed status: need update need update based on feedbacks labels Jan 15, 2019
wweic pushed a commit to neo-ai/tvm that referenced this pull request Feb 20, 2019
wweic pushed a commit to neo-ai/tvm that referenced this pull request Feb 20, 2019
@srkreddy1238 srkreddy1238 deleted the fuse-pass branch January 24, 2020 04:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants