comaniac commented on a change in pull request #6103:
URL: https://github.com/apache/incubator-tvm/pull/6103#discussion_r458995260



##########
File path: include/tvm/auto_scheduler/compute_dag.h
##########
@@ -0,0 +1,242 @@
+/*r
+ * 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.
+ */
+
+/*!
+ * \file tvm/auto_scheduler/compute_dag.h
+ * \brief The auto-scheduler's computational graph and related program 
analyses.
+ *
+ * We convert a compute declaration described by `tvm.compute` (could be a 
single operator or a
+ * subgraph) to a ComputeDAG. It keeps the input/output tensors of the compute 
declaration,
+ * a list of all operations in the DAG as well as static analysis results for 
the DAG (e.g. the
+ * total float operation count, consumer/producer relations of each operation 
stage, whether an
+ * operation stage should be tiled/compute inlined ...). These analyses can 
help the search policy
+ * to make decisions during search process.
+ * ComputeDAG is also responsible for the interaction between TVM 
Auto-scheduler `LoopState` and
+ * TVM schedule (e.g. applying the `LoopState` transform steps to TVM 
schedule, providing
+ * `LoopState` with extra information got from TVM schedule ...).
+ */
+
+#ifndef TVM_AUTO_SCHEDULER_COMPUTE_DAG_H_
+#define TVM_AUTO_SCHEDULER_COMPUTE_DAG_H_
+
+#include <tvm/auto_scheduler/loop_state.h>
+#include <tvm/runtime/c_runtime_api.h>
+#include <tvm/te/schedule.h>
+
+#include <unordered_map>
+#include <unordered_set>
+#include <utility>
+#include <vector>
+
+namespace tvm {
+namespace auto_scheduler {
+
+/*! \brief Static analysis result for a ComputeDAG */
+class AccessAnalyzerNode : public Object {

Review comment:
       Agree. Maybe have an `analysis.h` to expect more analyzers in the 
future. On the other hand, another direction might be renaming AccessAnalyzer 
to ComputeDAGAnalyzer, because it provides some APIs for the ops in a compute 
DAG, such as `NeedMultiLevelTiling`, `IsOutput`, etc.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to