54 This function generates a file which includes output arrays of BCQ v1
55 information bundles. Each bundle is consisted with one of candidate
56 operations (BCQ may be applied) and BCQ constant nodes related with
60 ops = graph.get_operations()
67 has_dequant_weight =
False
69 if op.type ==
"Const" and "/bcqinfo_" in op.outputs[0].name:
71 if "one_compiler/bcqinfo_one_metadata" in op.outputs[0].name:
74 prefix_index = op.outputs[0].name.index(
"/bcqinfo_")
75 prefix = op.outputs[0].name[:prefix_index]
76 prefix_set.add(prefix)
80 infoname = op.outputs[0].name[prefix_index + 1:-2]
81 if infoname ==
"bcqinfo_dequant_weight":
82 has_dequant_weight =
True
85 ret_output_arrays = [
'one_compiler/bcqinfo_one_metadata']
88 ret_output_arrays += output_arrays.split(
',')
91 for prefix
in prefix_set:
92 ret_output_arrays.append(prefix +
'/bcqinfo_do_w_x')
93 ret_output_arrays.append(prefix +
'/bcqinfo_alpha')
94 ret_output_arrays.append(prefix +
'/bcqinfo_packed_binary_code')
95 ret_output_arrays.append(prefix +
'/bcqinfo_number_of_clusters')
96 ret_output_arrays.append(prefix +
'/bcqinfo_size_of_clusters')
97 ret_output_arrays.append(prefix +
'/bcqinfo_qbits_of_clusters')
98 ret_output_arrays.append(prefix)
99 if has_dequant_weight:
100 ret_output_arrays.append(prefix +
'/bcqinfo_dequant_weight')
102 return ret_output_arrays