Skip to content

Commit

Permalink
add reshape UT
Browse files Browse the repository at this point in the history
Signed-off-by: Zhang, Weiwei1 <weiwei1.zhang@intel.com>
  • Loading branch information
WeiweiZhang1 committed Dec 2, 2024
1 parent fcf9530 commit a1da41e
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions test/test_autoround.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,8 +350,24 @@ def test_fallback_layers(self):
inputs = tokenizer(text, return_tensors="pt").to(model.device)
res = tokenizer.decode(model.generate(**inputs, max_new_tokens=1)[0])

def test_tensor_reshape(self):
model_name = "facebook/opt-125m"
model = AutoModelForCausalLM.from_pretrained(model_name, torch_dtype=torch.float32, trust_remote_code=True, device_map='auto')
bits, group_size, sym = 4, 100, False
autoround = AutoRound(
self.model,
self.tokenizer,
bits=bits,
group_size=group_size,
sym=sym,
iters=2,
seqlen=2,
dataset=self.llm_dataloader,
)
autoround.quantize()


if __name__ == "__main__":
unittest.main()


0 comments on commit a1da41e

Please sign in to comment.