Skip to content

Commit

Permalink
enhance dump func
Browse files Browse the repository at this point in the history
Signed-off-by: Mengni Wang <[email protected]>
  • Loading branch information
mengniwang95 committed Aug 20, 2024
1 parent 2ec554c commit d59fdca
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions onnx_neural_compressor/algorithms/utility.py
Original file line number Diff line number Diff line change
Expand Up @@ -594,18 +594,19 @@ def pad_tensor(weight, group_size, k_blocks):
return weight


def dump_woq_stats(model, quantize_config):
def dump_woq_stats(model, quantize_config, white_list=["MatMul"]):
res = {}

dtype_set = set()
for node in model.graph.node:
if node.name.split("_Q")[0] not in quantize_config:
continue
if node.op_type in ["MatMulFpQ4", "MatMulNBits"]:
optype = "MatMul"
else:
optype = node.op_type

if optype not in white_list:
continue

if optype not in res:
res[optype] = {}

Expand Down

0 comments on commit d59fdca

Please sign in to comment.