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

[Runtime][ThreadPool]Refactor affinity function and support CPU affinity list setting. #9802

Merged
merged 11 commits into from
Mar 1, 2022

Commits on Jan 7, 2022

  1. [Runtime][ThreadPool] Refactor affinity function and support CPU affi…

    …nity list setting.
    
    Issue:
    1. There are multiple affinity function using "LINUX" and "ANDROID" macro
    check and the multiple check make the logic maintain and change become
    complex.
    
    2. Current logic of tvm [Runtime][ThreadPool] assume all of the cpu resources are available for
    a single backend runtime to do the data flow computation. But such assumption may not
    true when user running multiple task on the system and not want tvm task
    exhaust all of the cpu resource, or when user going to run multiple backend
    runtime of tvm on the system, each backend runtime of tvm should use different cpu
    affinity settings to achieve best performance.
    
    Solution:
    1.Refactor the affinity functions to move the "LINUX" and "ANDROID" check
    into one function.
    
    2.In this solution, we introduce a new "CPU AffinityMode type" named "kSpecify", by using
    "kSpecify" and the function named "tvm::runtime::threading ::Configure" user can specify
    the cpu list for the cpu affinity of a backend runtime.
    
    This solution reused the existing per thread thread pool logic of [Runtime][Threadpool] that
    created a worker thread pool for current thread which can running a particular runtime. for a multiple
    runtime use case, user can first launch multiple threads, then call "tvm::runtime::threading ::Configure"
    with cpu list to create tvm data flow worker thread pool, after doing this the execution of the multiple
    runtime on the multiple threads will use different cpu resource list.
    huajsj authored and hua jiang committed Jan 7, 2022
    Configuration menu
    Copy the full SHA
    a01df59 View commit details
    Browse the repository at this point in the history
  2. fix windows build issue.

    hua jiang committed Jan 7, 2022
    Configuration menu
    Copy the full SHA
    1b457e9 View commit details
    Browse the repository at this point in the history
  3. fix build issue.

    hua jiang committed Jan 7, 2022
    Configuration menu
    Copy the full SHA
    0c8d189 View commit details
    Browse the repository at this point in the history
  4. fix build issue.

    hua jiang committed Jan 7, 2022
    Configuration menu
    Copy the full SHA
    d8ec871 View commit details
    Browse the repository at this point in the history
  5. fix windows build issue.

    hua jiang committed Jan 7, 2022
    Configuration menu
    Copy the full SHA
    7922d6e View commit details
    Browse the repository at this point in the history
  6. fix plint issue

    hua jiang committed Jan 7, 2022
    Configuration menu
    Copy the full SHA
    b3cdd2a View commit details
    Browse the repository at this point in the history

Commits on Feb 1, 2022

  1. polish comments.

    huajsj committed Feb 1, 2022
    Configuration menu
    Copy the full SHA
    937aa77 View commit details
    Browse the repository at this point in the history

Commits on Feb 17, 2022

  1. address review comments.

    huajsj committed Feb 17, 2022
    Configuration menu
    Copy the full SHA
    ada242c View commit details
    Browse the repository at this point in the history

Commits on Feb 24, 2022

  1. address reivew comments.

    huajsj committed Feb 24, 2022
    Configuration menu
    Copy the full SHA
    13fe147 View commit details
    Browse the repository at this point in the history

Commits on Feb 25, 2022

  1. address review comments.

    huajsj committed Feb 25, 2022
    Configuration menu
    Copy the full SHA
    770fc92 View commit details
    Browse the repository at this point in the history
  2. address review comments.

    huajsj committed Feb 25, 2022
    Configuration menu
    Copy the full SHA
    7ea0c2e View commit details
    Browse the repository at this point in the history