Skip to content

Commit

Permalink
Comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Giuseppe5 committed Oct 2, 2023
1 parent d21ae11 commit 85fa856
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@
'gpfq': [False, True], # Enable/Disable GPFQ
'gpfq_p': [0.25, 0.75], # GPFQ P
'act_quant_percentile': [99.9, 99.99, 99.999], # Activation Quantization Percentile
'uint_sym_act_for_unsigned_values': [False],}
'uint_sym_act_for_unsigned_values': [True], # Whether to use unsigned act quant when possible
}

OPTIONS_DEFAULT = {
'target_backend': ['fx'], # Target backend
Expand All @@ -87,7 +88,8 @@
'gpfq_p': [0.25], # GPFQ P
'gptq_act_order': [False], # Use act_order euristics for GPTQ
'act_quant_percentile': [99.999], # Activation Quantization Percentile
'uint_sym_act_for_unsigned_values': [False],}
'uint_sym_act_for_unsigned_values': [True], # Whether to use unsigned act quant when possible
}

parser = argparse.ArgumentParser(description='PyTorch ImageNet PTQ Validation')
parser.add_argument('idx', type=int)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -274,8 +274,11 @@ def kwargs_prefix(prefix, weight_kwargs):

act_quant_and_bit_width = {'act_quant': act_quant, 'bit_width': act_bit_width}
quant_act_kwargs = {**act_quant_and_bit_width, 'return_quant_tensor': True}

# For potentially unsigned activations, we create a separate dict
unsigned_quant_act_kwargs = quant_act_kwargs.copy()
if uint_sym_act_for_unsigned_values:
# In case we support unsigned activation, the output of softmax can be unsigned
quant_mha_kwargs['attn_output_weights_signed'] = False
unsigned_quant_act_kwargs['signed'] = False

Expand Down

0 comments on commit 85fa856

Please sign in to comment.