From 4a95c9e69243dfb3520bd346664eaa5150f15217 Mon Sep 17 00:00:00 2001 From: mobicham Date: Mon, 18 Mar 2024 16:54:00 +0000 Subject: [PATCH] add forward-onnly backends for debugging --- hqq/core/quantize.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hqq/core/quantize.py b/hqq/core/quantize.py index cba399f..47f0bc7 100755 --- a/hqq/core/quantize.py +++ b/hqq/core/quantize.py @@ -246,6 +246,10 @@ class HQQBackend(Enum): PYTORCH_BACKPROP_COMPILE = "forward_pytorch_backprop_compile" ATEN_BACKPROP = "forward_aten_backprop" + PYTORCH_FORWARD = "forward_pytorch" + PYTORCH_FORWARD_COMPILE = "forward_pytorch_compile" + ATEN_FORWARD = "forward_aten" + # No cache: less memory, slower class HQQMatmulNoCacheDeq(torch.autograd.Function): @@ -779,6 +783,7 @@ def forward_aten(self, x: Tensor) -> Tensor: out = torch.matmul(x, W_est.t()) if self.bias is not None: out += self.bias + return out def forward_aten_backprop(self, x: Tensor) -> Tensor: