pansn1995 opened a new pull request #9718: URL: https://github.com/apache/tvm/pull/9718
In the process of using autotvm to tune dense_pack (python/tvm/topi/x86/dense.py:242) did not enter in_tuning, that is, autotvm.GLOBALSCOPE.in_tuning = False, but in the tuner.tune function (python/ tvm/autotvm/tuner/tuner.py:123) has been set to True. Log in some key positions and get: 1. The main process (python/tvm/autotvm/tuner/tuner.py) Function tune GLOBAL_SCOPE = <tvm.autotvm.env.AutotvmGlobalScope object at 0x7f3dc62da0b8> Function tune GLOBAL_SCOPE.in_tuning = True 2. Child process reset(python/tvm/autotvm/env.py) Function reset_global_scope old GLOBAL_SCOPE = <tvm.autotvm.env.AutotvmGlobalScope object at 0x7f8e361c2128> Function reset_global_scope old GLOBAL_SCOPE.in_tuning = False Function reset_global_scope new GLOBAL_SCOPE = <tvm.autotvm.env.AutotvmGlobalScope object at 0x7f8d488ff9b0> Function reset_global_scope new GLOBAL_SCOPE.in_tuning = True 3. Child process dense_pack(python/tvm/topi/x86/dense.py) Function dense_pack autotvm.GLOBAL_SCOPE = <tvm.autotvm.env.AutotvmGlobalScope object at 0x7f8e361c2128> Function dense_pack autotvm.GLOBAL_SCOPE.in_tuning = False Function dense_pack autotvm.GLOBAL_SCOPE.current = <tvm.autotvm.env.AutotvmGlobalScope object at 0x7f8d488ff9b0> Function dense_pack autotvm.GLOBAL_SCOPE.current.in_tuning = True The main process passes the current value of GLOBAL_SCOPE to the child process, and the child process resets its own GLOBAL_SCOPE and changes current at the same time. However, the address of autotvm.GLOBALSCOPE in dense_pack has not changed, and it is still the old GLOBALSCOPE. At this time, current is changed. I think the reason for this bug is that the reset_global_scope function is a shallow copy of GLOBAL_SCOPE, and the problem is solved after replacing it with a deep copy. Thanks for contributing to TVM! Please refer to guideline https://tvm.apache.org/docs/contribute/ for useful information and tips. After the pull request is submitted, please request code reviews from [Reviewers](https://github.com/apache/incubator-tvm/blob/master/CONTRIBUTORS.md#reviewers) by @ them in the pull request thread. -- 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. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
