Skip to content

[Bug] PassContext should be inherited in tuning  #11656

Description

@AndrewZhaoLuo

Perhaps this is best described as feature request, regardless it is a little bit unintuitive.

For both autoscheduler and autotvm, POpenPool is used extensively in building and measuring. Unfortunately, these spawn new processes so some state is lost in translation.

Of particular note are PassContexts which can control how things are lowered and have instrumentation to grab useful information along the lowering process. This also makes it impossible to change the pass settings for tuning easily I believe.

Expected behavior

PassContext's should be respected for tuning. As we deal with processes, PassContexts and all their children need to be serialized. Documentation should also be improved to specify the behavior in these cases.

PassInstrumentation might be a little difficult to handle all use cases as these can be used to pass and modify state which might be difficult across process boundaries in an intuitive way.

Actual behavior

PassContext's configuration information is ignored for tuning.

Environment

This is a problem with TVM itself, the below script should do things.

Steps to reproduce

In this script we have simple pass instrumentation which prints out a bunch of '*' after a pass is called. During tuning nothing is printed because the instrument is ignored, during building the final module however it is applied.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions