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

[FIX] Clear relay cache after every build & Clear warning message cache after autotvm task extraction #6131

Merged
merged 1 commit into from
Jul 31, 2020

Conversation

tkonolige
Copy link
Contributor

@tkonolige tkonolige commented Jul 23, 2020

Clear the compile cache between module builds so that schedule changes will have an effect. Also, clear the warning cache so that schedule changes properly list untuned ops.

Note: this makes CompileEngine a mutable global variable.

@merrymercy @jwfromm

@merrymercy merrymercy changed the title [FIX] Fixes #6096 [FIX] Clear relay cache after every build & Clear warning message cache after autotvm task extraction Jul 23, 2020
@@ -770,7 +770,7 @@ class CompileEngineImpl : public CompileEngineNode {
};

/*! \brief The global compile engine */
const CompileEngine& CompileEngine::Global() {
CompileEngine& CompileEngine::Global() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the reason for dropping the const here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clearing the cache mutates the CompileEngine, so in order to clear the cache after each build we need to modify the global state.

@jwfromm
Copy link
Contributor

jwfromm commented Jul 24, 2020

@tkonolige, looks like the CI got aborted, can you rebase and push to trigger a new run?

@tkonolige
Copy link
Contributor Author

CI is getting errors like this:


>           raise get_last_ffi_error()
E           tvm._ffi.base.TVMError: Traceback (most recent call last):
E             [bt] (6) /workspace/build/libtvm.so(TVMFuncCall+0x65) [0x7f57e94d4785]
E             [bt] (5) /workspace/build/libtvm.so(+0xcc2606) [0x7f57e9567606]
E             [bt] (4) /workspace/build/libtvm.so(+0xcc24c3) [0x7f57e95674c3]
E             [bt] (3) /workspace/build/libtvm.so(tvm::runtime::GraphRuntime::Init(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, tvm::runtime::Module, std::vector<DLContext, std::allocator<DLContext> > const&)+0x241) [0x7f57e9567141]
E             [bt] (2) /workspace/build/libtvm.so(tvm::runtime::GraphRuntime::SetupOpExecs()+0x591) [0x7f57e9566d01]
E             [bt] (1) /workspace/build/libtvm.so(tvm::runtime::GraphRuntime::CreateTVMOp(tvm::runtime::TVMOpParam const&, std::vector<DLTensor, std::allocator<DLTensor> > const&, unsigned long)+0x6e1) [0x7f57e9564dd1]
E             [bt] (0) /workspace/build/libtvm.so(+0xcbce12) [0x7f57e9561e12]
E             File "/workspace/src/runtime/graph/graph_runtime.cc", line 387
E           TVMError: Check failed: pf != nullptr: no such function in module: fused_add_subtract_concatenate

python/tvm/_ffi/_ctypes/packed_func.py:225: TVMError

I have no clue how this PR is triggering those errors.

@jwfromm
Copy link
Contributor

jwfromm commented Jul 27, 2020

@merrymercy, any idea why this change is triggering CI errors?

@merrymercy
Copy link
Member

merrymercy commented Jul 27, 2020

@tkonolige Can you reproduce the error locally? If so, I guess CompileEngine::Global()->Clear() might not clear everything correctly, resulting in missing functions in the built module.
cc @tqchen

@tkonolige
Copy link
Contributor Author

@tkonolige I can reproduce the errors locally. Will look into it.

@tkonolige
Copy link
Contributor Author

@tqchen @merrymercy I can't figure this error out. Could one of you take a look at it?

@tkonolige
Copy link
Contributor Author

One of the failing tests is tests/python/relay/test_external_runtime.py. You can play around with it to try and debug.

@jroesch
Copy link
Member

jroesch commented Jul 30, 2020

I pinged @zhiics since he is the owner afaik of this code, he said he would look at it tomorrow.

@zhiics
Copy link
Member

zhiics commented Jul 30, 2020

Yeah, one quick thing I can do is to retire the example runtime since we have a real json runtime now. This example is not really use any more. I can send a PR later. cc @comaniac

Clear the compile cache between module builds so that schedule changes
will have an effect. Also, clear the warning cache so that schedule
changes properly list untuned ops.
@tkonolige
Copy link
Contributor Author

@merrymercy @tqchen We can merge this now.

@tqchen tqchen merged commit ce7202c into apache:master Jul 31, 2020
trevor-m pushed a commit to trevor-m/tvm that referenced this pull request Aug 26, 2020
Clear the compile cache between module builds so that schedule changes
will have an effect. Also, clear the warning cache so that schedule
changes properly list untuned ops.
trevor-m pushed a commit to trevor-m/tvm that referenced this pull request Aug 26, 2020
Clear the compile cache between module builds so that schedule changes
will have an effect. Also, clear the warning cache so that schedule
changes properly list untuned ops.
trevor-m pushed a commit to trevor-m/tvm that referenced this pull request Aug 26, 2020
Clear the compile cache between module builds so that schedule changes
will have an effect. Also, clear the warning cache so that schedule
changes properly list untuned ops.
trevor-m pushed a commit to trevor-m/tvm that referenced this pull request Sep 2, 2020
Clear the compile cache between module builds so that schedule changes
will have an effect. Also, clear the warning cache so that schedule
changes properly list untuned ops.
trevor-m pushed a commit to neo-ai/tvm that referenced this pull request Sep 3, 2020
Clear the compile cache between module builds so that schedule changes
will have an effect. Also, clear the warning cache so that schedule
changes properly list untuned ops.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants