mbaret commented on a change in pull request #9469: URL: https://github.com/apache/tvm/pull/9469#discussion_r772707432
########## File path: src/contrib/ethosu/cascader/graph.h ########## @@ -0,0 +1,321 @@ +/* + * 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 src/contrib/ethosu/cascader/graph.h + * \brief Graph objects (Tensor and Part) for the Ethos-U cascader + */ +#ifndef TVM_CONTRIB_ETHOSU_CASCADER_GRAPH_H_ +#define TVM_CONTRIB_ETHOSU_CASCADER_GRAPH_H_ + +#include <tvm/runtime/data_type.h> +#include <tvm/runtime/object.h> +#include <tvm/te/operation.h> +#include <tvm/te/tensor.h> + +#include <unordered_map> +#include <utility> +#include <vector> + +#include "propagator.h" + +namespace tvm { +namespace contrib { +namespace ethosu { +namespace cascader { + +class Tensor; +class Part; +class StripeConfig; + +/*! \brief A struct to hold a Tensor Expression subgraph */ +struct TESubgraph { + /*! \brief The input te::Tensors to the subgraph */ + std::vector<te::Tensor> input_tensors; + /*! \brief The output te::Tensor of the subgraph */ + te::Tensor output_tensor; +}; + +/*! \brief Node to hold performance information for a Part */ +class PerformanceInfoNode : public Object { + public: + void VisitAttrs(AttrVisitor* v); + + /*! \brief The cycles to compute a block */ + size_t compute_cycles; + /*! \brief The number of bytes read per input tensor */ + std::vector<size_t> read_bytes; + /*! \brief The number of bytes written to the output tensor */ + size_t write_bytes; + + static constexpr const char* _type_key = "contrib.ethosu.cascader.PerformanceInfo"; + TVM_DECLARE_FINAL_OBJECT_INFO(PerformanceInfoNode, Object); +}; + +/*! + * \brief An class to hold the performance information for a Part. Review comment: Again, could take this as an addendum to the next PR. -- 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]
