Skip to content

Commit

Permalink
Update matmul_4bits_quantizer.py
Browse files Browse the repository at this point in the history
  • Loading branch information
mengniwang95 authored Dec 25, 2023
1 parent 87d825d commit 0b46845
Showing 1 changed file with 0 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -268,13 +268,10 @@ def _generate_q4_node_config(self):
"""Generate weight only quant configuration for nodes."""
q4_node_config = {}
template_config_q4 = {"bits": 4, "group_size": self.block_size, "scheme": "sym" if self.is_symmetric else "asym"}
template_config_fp32 = "fp32"
for node in self.model.model.graph.node:
if node.op_type in ["MatMul"]:
if not all([self.model.get_initializer(i) is None for i in node.input]):
q4_node_config[node.name] = template_config_q4
else:
q4_node_config[node.name] = template_config_fp32
return q4_node_config

def int4_quant_algo(self):
Expand Down

0 comments on commit 0b46845

Please sign in to comment.