blob: 6dc6b583804b1660aac9ccf4c1954ba9baff7b0b [file] [log] [blame]
Fredrik Svedberg33c01e62023-02-13 11:32:12 +01001# SPDX-FileCopyrightText: Copyright 2020-2023 Arm Limited and/or its affiliates <open-source-office@arm.com>
Tim Hall79d07d22020-04-27 18:20:16 +01002#
3# SPDX-License-Identifier: Apache-2.0
4#
5# Licensed under the Apache License, Version 2.0 (the License); you may
6# not use this file except in compliance with the License.
7# You may obtain a copy of the License at
8#
9# www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an AS IS BASIS, WITHOUT
13# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
Rickard Bolinbc6ee582022-11-04 08:24:29 +000016#
Tim Hall79d07d22020-04-27 18:20:16 +010017# Description:
18# Neural network graph classes and enums.
19# Pass - A packed pass containing one or more Operations.
20# CascadedPass - A scheduled pass containing one or more Passes, as well as a scheduling strategy and block
21# configurations.
22# Subgraph - Holds a neural network subgraph, pointing at Tensors, Operations, Passes, and CascadedPasses.
23# Graph - A full neural network graph with one or more Subgraphs.
Tim Hall79d07d22020-04-27 18:20:16 +010024import enum
patrik.gustavssoneeb85152020-12-21 17:10:40 +000025from typing import List
Tim Hall79d07d22020-04-27 18:20:16 +010026
Louis Verhaardaee5d752020-09-30 09:01:52 +020027from .operation import Op
patrik.gustavssoneeb85152020-12-21 17:10:40 +000028from .shape4d import Shape4D
Louis Verhaardaee5d752020-09-30 09:01:52 +020029
Tim Hall79d07d22020-04-27 18:20:16 +010030
31class PassPlacement(enum.Enum):
32 Unknown = 0
33 Cpu = 1
34 Npu = 2
35 MemoryOnly = 3
36 StartupInit = 4
37
38
39class TensorAllocator(enum.Enum):
40 LinearAlloc = 1
41 Greedy = 2
Louis Verhaardd7002522021-01-20 17:23:54 +010042 HillClimb = 3
Tim Hall79d07d22020-04-27 18:20:16 +010043
44 def __str__(self):
45 return self.name
46
47
Patrik Gustavsson8f1f9aa2021-06-28 07:41:58 +020048class NetworkType(enum.Enum):
49 TFLite = 1
50 TOSA = 2
51
52
Tim Hall79d07d22020-04-27 18:20:16 +010053class Pass:
54 def __init__(self, name, placement, is_element_wise, npu_block_type):
55 self.inputs = []
56 self.intermediates = []
57 self.outputs = []
58 self.ops = []
59 self.primary_op = None
60 self.ifm_tensor = None
61 self.ifm2_tensor = None
62 self.ofm_tensor = None
63 self.weight_tensor = None
64 self.scale_tensor = None
Fredrik Svedberga0c36242020-06-03 15:43:31 +020065 self.lut_tensor = None
Tim Hall79d07d22020-04-27 18:20:16 +010066 self.name = name
67 self.cascade = None
68 self.placement = placement
patrik.gustavssoneeb85152020-12-21 17:10:40 +000069 self.ifm_shapes: List[Shape4D] = []
70 self.ofm_shapes: List[Shape4D] = []
Tim Hall79d07d22020-04-27 18:20:16 +010071
72 # TODO: rename is_element_wise because it is not the same as an ElementWise operator. It is used by the tensor
73 # allocation and requires that the OFM and IFM has the exact same address. Essentially complete overlap.
74 self.is_element_wise = is_element_wise
75 self.npu_block_type = npu_block_type
76 self.block_config = None # will be filled in by scheduler
77 self.shared_buffer = None # will be filled in by scheduler
Tim Halld8339a72021-05-27 18:49:40 +010078 self.scheduling_info = None # will be filled in by scheduler
Tim Hall79d07d22020-04-27 18:20:16 +010079
80 self.predecessors = []
81 self.successors = []
82
83 def __str__(self):
84 return "<nng.Pass '%s', %s, ops=%s>" % (self.name, self.placement, [op.type for op in self.ops])
85
86 __repr__ = __str__
87
88 def get_primary_op_ifm_weights(self):
89 if not self.primary_op:
90 return None, None
91 return self.primary_op.get_ifm_ifm2_weights_ofm()[::2]
92
93 def get_primary_op_ifm_ifm2_weights_ofm(self):
94 if not self.primary_op:
95 return None, None, None, None
96 return self.primary_op.get_ifm_ifm2_weights_ofm()
97
98 def get_primary_op_ifm_weights_biases_ofm(self):
99 if not self.primary_op:
100 return None, None, None, None
101 return self.primary_op.get_ifm_weights_biases_ofm()
102
Fredrik Svedberga0c36242020-06-03 15:43:31 +0200103 def get_primary_op_lut(self):
104 if not self.primary_op:
105 return None
106 return self.primary_op.activation_lut
107
Tim Hall79d07d22020-04-27 18:20:16 +0100108
109class SchedulingStrategy(enum.Enum):
110 Unknown = -1
111 IfmStream = 0
112 WeightStream = 1
113
114
115class SchedulerRewrite(enum.Enum):
116 Nop = 0
117 ChangeTensorSubPurpose = 1
118
119
120class CascadedPass:
121 def __init__(self, name, strat, inputs, intermediates, outputs, passes, placement, is_element_wise):
122 self.name = name
123 self.strategy = strat
124 self.inputs = inputs
125 self.intermediates = intermediates
126 self.outputs = outputs
127 self.passes = passes
128 self.placement = placement
129 self.is_element_wise = is_element_wise
130
131 self.predecessors = []
132 self.successors = []
Tim Halld8339a72021-05-27 18:49:40 +0100133 self.sram_used = 0
Jonas Ohlsson845e2322022-03-01 12:39:55 +0100134 self.time = 0
Tim Hall79d07d22020-04-27 18:20:16 +0100135
136 def __str__(self):
137 return "<nng.CascadedPass strategy=%s x %s '%s', passes=%s, block_configs=%s>" % (
138 self.strategy,
139 len(self.passes),
140 self.name,
141 [ps.name for ps in self.passes],
142 [ps.block_config for ps in self.passes],
143 )
144
145 __repr__ = __str__
146
147
148class Subgraph:
149 def __init__(self, name="<unnamed>", placement=PassPlacement.Cpu):
150 self.output_tensors = []
151 self.input_tensors = []
Johan Alfven9070f0f2023-02-07 13:01:03 +0100152 # Preserve the original input order
153 self.original_inputs = []
154 # Attach virtual outputs to resource variables op
155 # in order to be able to traverse the graph correctly
156 self.virtual_outputs = []
Tim Hall79d07d22020-04-27 18:20:16 +0100157 self.passes = []
158 self.cascaded_passes = []
159 self.name = name
160 self.high_level_command_stream = []
161 self.placement = placement
162 self.command_stream_tensor = None
163 self.flash_tensor = None
Louis Verhaard0b9c9a32020-09-15 14:05:38 +0200164 # Scratch information locally used in the scheduler
Tim Halld8339a72021-05-27 18:49:40 +0100165 self.schedule = None
166 self.sched_ops = []
167
erik.andersson@arm.comad45f792021-02-03 10:20:16 +0100168 self.generated_stream_id = None
Tim Hall79d07d22020-04-27 18:20:16 +0100169
170 self.memory_used = {}
Patrik Gustavssoneca2e952020-05-27 09:15:11 +0200171 self.memory_used_per_type = {}
Tim Hall79d07d22020-04-27 18:20:16 +0100172
173 def __str__(self):
174 return "<nng.Subgraph '%s', n_passes=%d, n_cascaded_passes=%d>" % (
175 self.name,
176 len(self.passes),
177 len(self.cascaded_passes),
178 )
179
180 __repr__ = __str__
181
182 def update_consumers(self):
183 visit_op_set = set()
184 visit_tensor_set = set()
185 self.input_tensors = []
186
187 print_visit = False
188
189 def visit_op(op):
190 if op in visit_op_set:
191 return
192
193 visit_op_set.add(op)
194 for inp in op.inputs:
Jacob Bohlin67e0d8f2020-08-20 10:53:02 +0200195 if not inp:
196 continue
Tim Hall79d07d22020-04-27 18:20:16 +0100197 if print_visit:
198 print(inp, "adding consumer", op)
199 visit_tensor(inp)
200 inp.consumer_list.append(op)
201
Michael McGeaghf3e3ad72020-12-02 12:39:03 +0000202 if op.type in (Op.Placeholder, Op.SubgraphInput):
Tim Hall79d07d22020-04-27 18:20:16 +0100203 assert len(op.outputs) == 1
Fredrik Svedberg33c01e62023-02-13 11:32:12 +0100204 if not op.outputs[0].is_variable:
205 self.input_tensors.append(op.outputs[0])
Tim Hall79d07d22020-04-27 18:20:16 +0100206
207 for out in op.outputs:
208 if out not in visit_tensor_set:
209 out.consumer_list = [] # reset unvisited output, just in case
210
211 def visit_tensor(tens):
212 if tens in visit_tensor_set:
213 return
214 visit_tensor_set.add(tens)
215 tens.consumer_list = []
216 for op in tens.ops:
217 visit_op(op)
218
219 for ps in self.passes:
220 for tens in ps.outputs + ps.inputs:
Jacob Bohlin67e0d8f2020-08-20 10:53:02 +0200221 if not tens:
222 continue
Tim Hall79d07d22020-04-27 18:20:16 +0100223 tens.consumer_list = [] # reset unvisited tensors to start with
224
225 for tens in self.output_tensors:
226 visit_tensor(tens)
227 tens.consumer_list.append(None) # special op to indicate that the graph consumes the result
228
229 print_visit = True
230 for ps in self.passes:
231 for op in ps.ops:
232 visit_op(op)
233 for tens in ps.inputs:
234 visit_tensor(tens)
235
236 def build_pass_links(self):
237 for idx, ps in enumerate(self.passes):
238 ps.time = 2 * idx
239 ps.predecessors = []
240 ps.successors = []
241
242 for ps in self.passes:
243 for tens in ps.inputs:
244 for op in tens.ops:
245 pred_pass = op.scheduled_pass
246 assert pred_pass.time < ps.time
247 if ps not in pred_pass.successors:
248 pred_pass.successors.append(ps)
249
250 if pred_pass not in ps.predecessors:
251 ps.predecessors.append(pred_pass)
252
253 assert tens in pred_pass.outputs
254
255 def build_pass_dag_predecessors(self):
256 for ps in self.passes:
257 ps.dag_predecessors = []
258
259 class State(enum.Enum):
260 NotVisited = 0
261 BeingVisited = 1
262 Visited = 2
263
264 pass_visit_dict = {}
265
266 def visit_pass(ps):
267 state = pass_visit_dict.get(ps, State.NotVisited)
268 if state == State.Visited:
269 return True
270 elif state == State.BeingVisited:
271 return False # this is a loop, need to remove this link
272 elif state == State.NotVisited:
273 pass_visit_dict[ps] = State.BeingVisited
274
275 ps.dag_predecessors = []
276 for pred in ps.predecessors:
277 if visit_pass(pred):
278 ps.dag_predecessors.append(pred)
279
280 pass_visit_dict[ps] = State.Visited
281 return True
282
283 for ps in self.passes:
284 if not ps.successors:
285 visit_pass(ps)
286
287 def build_cascaded_pass_links(self):
288 for cps in self.cascaded_passes:
289 cps.predecessors = []
290 cps.successors = []
291
292 for cps in self.cascaded_passes:
293 for tens in cps.inputs:
294 for op in tens.ops:
295 pred_cpass = op.scheduled_pass.cascade
296 if cps not in pred_cpass.successors:
297 pred_cpass.successors.append(cps)
298
299 if pred_cpass not in cps.predecessors:
300 cps.predecessors.append(pred_cpass)
301
302 assert tens in pred_cpass.outputs
303
304 def refresh_after_modification(self):
305 self.update_consumers()
306
307 def prune_startup_init_pass(self):
308 assert len(self.passes) >= 1
309 ps = self.passes[0]
310 assert ps.placement == PassPlacement.StartupInit
311
312 ps.outputs = [out_tens for out_tens in ps.outputs if len(out_tens.consumers()) > 0]
313 ps.ops = [op for op in ps.ops if op.outputs[0] in ps.outputs]
314
315 def get_all_ops(self):
316 all_ops = []
317 visit_op_set = set()
318 visit_tensor_set = set()
319
320 def visit_op(op):
321 if op in visit_op_set:
322 return
323 visit_op_set.add(op)
324 for inp in op.inputs:
325 visit_tensor(inp)
326
327 all_ops.append(op)
328
329 def visit_tensor(tens):
Andreas Nevalainene1cc3de2020-09-08 15:31:02 +0200330 if tens is None or tens in visit_tensor_set:
Tim Hall79d07d22020-04-27 18:20:16 +0100331 return
332 visit_tensor_set.add(tens)
333 for op in tens.ops:
334 visit_op(op)
335
336 for tens in self.output_tensors:
337 visit_tensor(tens)
338
339 return all_ops
340
Tim Hallcd035042023-08-08 14:10:17 +0100341 def print_operators(self, ignore_placeholder_const=True, show_attributes=True):
342 print(f"Operators of Subgraph {self.name}")
Tim Hall79d07d22020-04-27 18:20:16 +0100343
Tim Hallcd035042023-08-08 14:10:17 +0100344 ignore_ops = (Op.Const, Op.Identity, Op.Placeholder) if ignore_placeholder_const else ()
345 all_ops = [op for op in self.get_all_ops() if op.type not in ignore_ops]
346
347 if len(all_ops) > 0:
348 max_op_type_len = max([len(op.type.name) for op in all_ops])
349
350 for idx, op in enumerate(all_ops):
351 attrs_str = f" - {op.attrs}" if show_attributes else ""
352 print(f"{idx:3}: {op.type:{max_op_type_len}}{attrs_str} - {op.name}")
353
354 else:
355 print("No Operators")
Tim Hall79d07d22020-04-27 18:20:16 +0100356
Fredrik Svedbergc875aa62021-05-06 09:53:31 +0200357 def print_graph(self, label=None):
358 if label:
359 print(f"\n[ {label} ]")
Michael McGeagh775e3962020-07-28 11:44:22 +0100360 print("print_graph()", self.name)
Tim Hall79d07d22020-04-27 18:20:16 +0100361 all_ops = self.get_all_ops()
362 for idx, op in enumerate(all_ops):
363 print(idx, op.type, op.name)
364
365 def print_graph_with_tensors(self):
Michael McGeagh775e3962020-07-28 11:44:22 +0100366 print("print_graph_with_tensors()", self.name)
Tim Hall79d07d22020-04-27 18:20:16 +0100367 all_ops = self.get_all_ops()
368 for idx, op in enumerate(all_ops):
369 print(idx, op.type, op.name)
370 for idx, tens in enumerate(op.inputs):
Fredrik Svedbergb3d941e2021-10-13 14:06:03 +0200371 if tens:
372 print(
373 f" Input {idx:02d}"
374 f" {tens.purpose.name:>20} {tens.mem_area.name:>20} {tens.mem_type.name:>20} {tens}"
375 )
376 else:
377 print(f" Input {idx:02d} {'-':>20} {'-':>20} {'-':>20} {tens}")
Tim Hall79d07d22020-04-27 18:20:16 +0100378 for idx, tens in enumerate(op.outputs):
Patrik Gustavssoneca2e952020-05-27 09:15:11 +0200379 print(
Fredrik Svedbergb3d941e2021-10-13 14:06:03 +0200380 f" Output {idx:02d}"
381 f" {tens.purpose.name:>20} {tens.mem_area.name:>20} {tens.mem_type.name:>20} {tens}"
Patrik Gustavssoneca2e952020-05-27 09:15:11 +0200382 )
Tim Hall79d07d22020-04-27 18:20:16 +0100383 print()
384
385 def print_graph_with_tensor_quantization(self):
Michael McGeagh775e3962020-07-28 11:44:22 +0100386 print("print_graph_with_tensor_quantization()", self.name)
Tim Hall79d07d22020-04-27 18:20:16 +0100387 all_ops = self.get_all_ops()
388 for idx, op in enumerate(all_ops):
389 print(idx, op.type, op.name)
390 for idx, tens in enumerate(op.inputs):
Fredrik Svedbergb3d941e2021-10-13 14:06:03 +0200391 if tens:
392 q = tens.quantization
393 if q is None:
394 print(f" Input {idx:02d} {tens.dtype!s:>10} NO QUANTIZATION INFO {tens.name}")
395 else:
396 print(
397 f" Input {idx:02d} {tens.dtype!s:>10}"
398 f" min={q.min} max={q.max} scale={q.scale_f32!s} zero_point={q.zero_point} {tens.name}"
399 )
Tim Hall79d07d22020-04-27 18:20:16 +0100400 else:
Fredrik Svedbergb3d941e2021-10-13 14:06:03 +0200401 print(f" Input {idx:02d} {'-':>10} {tens}")
Tim Hall79d07d22020-04-27 18:20:16 +0100402 for idx, tens in enumerate(op.outputs):
403 q = tens.quantization
404 if q is None:
Fredrik Svedbergb3d941e2021-10-13 14:06:03 +0200405 print(f" Output {idx:02d} {tens.dtype!s:>10} NO QUANTIZATION INFO {tens.name}")
Tim Hall79d07d22020-04-27 18:20:16 +0100406 else:
407 print(
Fredrik Svedbergb3d941e2021-10-13 14:06:03 +0200408 f" Output {idx:02d} {tens.dtype!s:>10}"
409 f" min={q.min} max={q.max} scale={q.scale_f32!s} zero_point={q.zero_point} {tens.name}"
Tim Hall79d07d22020-04-27 18:20:16 +0100410 )
411 print()
412
413 def print_passes(self):
Michael McGeagh775e3962020-07-28 11:44:22 +0100414 print("print_passes()", self.name)
Tim Hall79d07d22020-04-27 18:20:16 +0100415 for idx, ps in enumerate(self.passes):
416 print("%03d %s" % (idx * 2, ps))
417
418 def print_passes_with_tensors(self):
Michael McGeagh775e3962020-07-28 11:44:22 +0100419 print("print_passes_with_tensors()", self.name)
Tim Hall79d07d22020-04-27 18:20:16 +0100420 for idx, ps in enumerate(self.passes):
421 print("%3d %s" % (idx * 2, ps))
422 for idx, tens in enumerate(ps.inputs):
423 print(
424 " Input %2d %-15s %-15s %-15s %s"
425 % (idx, tens.purpose.name, tens.mem_area.name, tens.format.name, tens.name)
426 )
427 for idx, tens in enumerate(ps.intermediates):
428 print(
429 " Intermediate %2d %-15s %-15s %-15s %s"
430 % (idx, tens.purpose.name, tens.mem_area.name, tens.format.name, tens.name)
431 )
432 for idx, tens in enumerate(ps.outputs):
433 print(
434 " Output %2d %-15s %-15s %-15s %s"
435 % (idx, tens.purpose.name, tens.mem_area.name, tens.format.name, tens.name)
436 )
437 print()
438
439 def print_cascaded_passes(self):
Michael McGeagh775e3962020-07-28 11:44:22 +0100440 print("print_cascaded_passes()", self.name)
Tim Hall79d07d22020-04-27 18:20:16 +0100441 for idx, ps in enumerate(self.cascaded_passes):
442 print("%3d %s SRAM used %.1f KB" % (idx * 2, ps, ps.sram_used / 1024))
443
444 def print_cascaded_passes_with_tensors(self):
Michael McGeagh775e3962020-07-28 11:44:22 +0100445 print("print_cascaded_passes_with_tensors()", self.name)
Tim Hall79d07d22020-04-27 18:20:16 +0100446 for idx, ps in enumerate(self.cascaded_passes):
447 print("%3d %s SRAM used %.1f KB" % (idx * 2, ps, ps.sram_used / 1024))
448 for idx, tens in enumerate(ps.inputs):
449 print(
450 " Input %2d %-15s %-15s %-15s %s"
451 % (idx, tens.purpose.name, tens.mem_area.name, tens.format.name, tens.name)
452 )
453 for idx, tens in enumerate(ps.intermediates):
454 print(
455 " Intermediate %2d %-15s %-15s %-15s %s"
456 % (idx, tens.purpose.name, tens.mem_area.name, tens.format.name, tens.name)
457 )
458 for idx, tens in enumerate(ps.outputs):
459 print(
460 " Output %2d %-15s %-15s %-15s %s"
461 % (idx, tens.purpose.name, tens.mem_area.name, tens.format.name, tens.name)
462 )
463 print()
464
465 def print_cascaded_passes_with_tensor_sizes(self):
Michael McGeagh775e3962020-07-28 11:44:22 +0100466 print("print_cascaded_passes_with_tensor_sizes()", self.name)
Tim Hall79d07d22020-04-27 18:20:16 +0100467 for idx, ps in enumerate(self.cascaded_passes):
468 print("%3d %s SRAM used %.1f KB" % (idx * 2, ps, ps.sram_used / 1024))
469 for idx, tens in enumerate(ps.inputs):
470 print(
471 " Input %2d %7.1f KB %-24s %-15s %-15s %-20s %s"
472 % (
473 idx,
474 tens.storage_size() / 1024,
475 tens.storage_shape,
476 tens.mem_area.name,
477 tens.purpose.name,
478 tens.format.name,
479 tens.name,
480 )
481 )
482 for idx, tens in enumerate(ps.intermediates):
483 print(
484 " Intermediate %2d %7.1f KB %-24s %-15s %-15s %-20s %s"
485 % (
486 idx,
487 tens.storage_size() / 1024,
488 tens.storage_shape,
489 tens.mem_area.name,
490 tens.purpose.name,
491 tens.format.name,
492 tens.name,
493 )
494 )
495 for idx, tens in enumerate(ps.outputs):
496 print(
497 " Output %2d %7.1f KB %-24s %-15s %-15s %-20s %s"
498 % (
499 idx,
500 tens.storage_size() / 1024,
501 tens.storage_shape,
502 tens.mem_area.name,
503 tens.purpose.name,
504 tens.format.name,
505 tens.name,
506 )
507 )
508 print()
509
510 def print_high_level_command_stream(self):
Michael McGeagh775e3962020-07-28 11:44:22 +0100511 print("print_high_level_command_stream()", self.name)
Tim Hall79d07d22020-04-27 18:20:16 +0100512 for idx, cmd in enumerate(self.high_level_command_stream):
513 print("%3d %s" % (idx, cmd))
514
515
516class Graph:
517 def __init__(self, name="<unnamed>", batch_size=1):
518 self.name = name
519 self.batch_size = batch_size
520 self.subgraphs = []
Michael McGeagh22f74e12020-08-07 16:21:03 +0100521 self.metadata = []
Tim Hall79d07d22020-04-27 18:20:16 +0100522 self.memory_used = {}
Diqing Zhongdb5124c2021-01-11 12:52:48 +0100523 self.total_original_weights = 0
Fredrik Svedbergf5c07c42021-04-23 14:36:42 +0200524 self.total_npu_encoded_weights = 0
Louis Verhaard3c07c972020-05-07 08:12:58 +0200525 self.weight_cache = None # See CompressedWeightCache
Jonas Ohlsson845e2322022-03-01 12:39:55 +0100526 self.bandwidths = 0
527 self.macs = 0
528 self.cycles = 0
Tim Hall79d07d22020-04-27 18:20:16 +0100529
530 def get_root_subgraph(self):
531 return self.subgraphs[0]
532
533 def prune_startup_init_pass(self):
534 for sg in self.subgraphs:
535 sg.prune_startup_init_pass()
536
537 def update_consumers(self):
538 for sg in self.subgraphs:
539 sg.update_consumers()
540
541 def refresh_after_modification(self):
542 for sg in self.subgraphs:
543 sg.refresh_after_modification()
544
Tim Hallcd035042023-08-08 14:10:17 +0100545 def print_operators(self, ignore_placeholder_const=True, show_attributes=True):
Tim Hall79d07d22020-04-27 18:20:16 +0100546 for sg in self.subgraphs:
Tim Hallcd035042023-08-08 14:10:17 +0100547 sg.print_operators(ignore_placeholder_const, show_attributes)
Tim Hall79d07d22020-04-27 18:20:16 +0100548
Fredrik Svedbergc875aa62021-05-06 09:53:31 +0200549 def print_graph(self, label=None):
Tim Hall79d07d22020-04-27 18:20:16 +0100550 for sg in self.subgraphs:
Fredrik Svedbergc875aa62021-05-06 09:53:31 +0200551 sg.print_graph(label)
Tim Hall79d07d22020-04-27 18:20:16 +0100552
553 def print_graph_with_tensors(self):
554 for sg in self.subgraphs:
555 sg.print_graph_with_tensors()
556
557 def print_graph_with_tensor_quantization(self):
558 for sg in self.subgraphs:
559 sg.print_graph_with_tensor_quantization()
560
561 def print_passes(self):
562 for sg in self.subgraphs:
563 sg.print_passes()
564
565 def print_passes_with_tensors(self):
566 for sg in self.subgraphs:
567 sg.print_passes_with_tensors()
568
569 def print_cascaded_passes(self):
570 for sg in self.subgraphs:
571 sg.print_cascaded_passes()
572
573 def print_cascaded_passes_with_tensors(self):
574 for sg in self.subgraphs:
575 sg.print_cascaded_passes_with_tensors()
576
577 def print_cascaded_passes_with_tensor_sizes(self):
578 for sg in self.subgraphs:
579 sg.print_cascaded_passes_with_tensor_sizes()
580
581 def print_high_level_command_stream(self):
582 for sg in self.subgraphs:
583 sg.print_high_level_command_stream()