We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 73fc080 commit 46670e1Copy full SHA for 46670e1
modelopt/torch/quantization/algorithms.py
@@ -1013,8 +1013,8 @@ def _get_kl_div_loss(
1013
prob_unquant: torch.Tensor, logits_quant: torch.Tensor, lm_head: nn.Module = None
1014
) -> torch.Tensor:
1015
log_prob_quant = _get_prob_from_logits(logits_quant, return_log_prob=True, lm_head=lm_head)
1016
- # We dont need to calculate the full kl div loss here, just get p*log_q
1017
- return _get_p_log_q(prob_unquant, log_prob_quant)
+ # We dont need to calculate the full kl div loss here, just get - p*log_q
+ return -_get_p_log_q(prob_unquant, log_prob_quant)
1018
1019
1020
def _get_lm_head(model: nn.Module) -> nn.Module:
0 commit comments