junrushao1994 commented on a change in pull request #9053: URL: https://github.com/apache/tvm/pull/9053#discussion_r712574633
########## File path: python/tvm/meta_schedule/tune_context.py ########## @@ -0,0 +1,102 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +"""Meta Schedule tuning context.""" + +from typing import Optional + +from tvm import IRModule +from tvm.runtime import Object +from tvm.target import Target +from tvm.meta_schedule.utils import cpu_count +from tvm._ffi import register_object + +from . import _ffi_api + + +@register_object("meta_schedule.TuneContext") +class TuneContext(Object): + """ + The tune context class is designed to contain all resources for a tuning task. + + Different tuning tasks are separated in different TuneContext classes, but different classes in + the same task can interact with each other through tune context. Most classes have a function + to initialize with a tune context. + + Parameters + ---------- + mod : Optional[IRModule] = None + The workload to be optimized. + target : Optional[Target] = None + The target to be optimized for. + task_name : Optional[str] = None + The name of the tuning task. + rand_state : int = -1 + The random state. + Need to be in integer in [1, 2^31-1], -1 means using random number. + num_threads : int = -1 + The number of threads to be used, -1 means using the logical cpu count. + verbose : int = 0 + The verbosity level. + """ + + mod: Optional[IRModule] + target: Optional[Target] + task_name: Optional[str] + rand_state: int + num_threads: int + verbose: int + is_stopped: bool Review comment: Remove these 2 items given they are not used yet in the current mainline. Let's add them back when needed :-) -- 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]
