VeriSilicon / TIM-VX

VeriSilicon Tensor Interface Module
Other
216 stars 85 forks source link

What does the producer and consumer mean? #693

Closed engineer1109 closed 2 months ago

engineer1109 commented 2 months ago

I found the graph interface has producer and consumer two means. What mean?

And function:

UpdateTensorConsumersMap
RenewTensorConsumersMap
UpdateTensorProducerMap
GetConsumersOp
GetProducerOp

means what

chenfeiyue-cfy commented 2 months ago
  1. The Update*** functions are called when initializing the structure of the entire graph, meaning that every time UpdateMap is called, a new binding information between tensor and operation is added to the related map.
  2. RenewTensorConsumersMap is used to handle some const tensor that are not supported by the definitions of operations in lower-level software. We convert the initialized timvx tensor into a new tensor through data conversion and other means, hence we need to modify the map.
  3. The Get*** function returns the smart pointer of the Consumer/Producer Operation for the current tensor.
engineer1109 commented 2 months ago

Thanks for your answer