Skip to content

Commit

Permalink
remove zero padding
Browse files Browse the repository at this point in the history
  • Loading branch information
gau-nernst committed Jul 6, 2024
1 parent c4bb9e7 commit cb6176e
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions torchao/prototype/low_bit_optim/subclass_8bit.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@


# https://github.com/TimDettmers/bitsandbytes/blob/dada530149212d64d4b69534716202659ef37ec8/bitsandbytes/functional.py#L339-L391
# NOTE: zero padding is removed so this function can work with 4-bit qmap
def create_dynamic_map(signed=True, max_exponent_bits=7, total_bits=8):
"""
Creates the dynamic quantiztion map.
Expand Down Expand Up @@ -54,10 +55,6 @@ def create_dynamic_map(signed=True, max_exponent_bits=7, total_bits=8):

assert len(data) == 2**total_bits

# gap = 256 - len(data)
# for i in range(gap):
# data.append(0)

data.sort()
return data

Expand Down

0 comments on commit cb6176e

Please sign in to comment.