Skip to content

Commit

Permalink
Remove redundant torch.abs in sim check
Browse files Browse the repository at this point in the history
Summary:
The absolute value is redundant because
the next step involves squaring the differences,
which makes all values non-negative.

X-link: pytorch#2822

Pulled By:
spcyppt

X-link: facebookresearch/FBGEMM#109

spcyppt

Reviewed By: q10

Differential Revision: D61492832

fbshipit-source-id: 9208ba1c6c572b500e4e2c505ec6fc8a93a01c77
  • Loading branch information
acoskunses-AMD authored and facebook-github-bot committed Aug 21, 2024
1 parent 1c8ae9d commit 6bb22e0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fbgemm_gpu/experimental/gen_ai/bench/quantize_bench.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def benchmark(
# Compute the output given quantized values.
output = quantize_op.compute(*quantized_vals)
# Compare the quantize op output to reference as a sanity check.
sim_check = torch.mean(torch.pow(torch.abs(output - out_ref), 2))
sim_check = torch.mean(torch.pow(output - out_ref, 2))

# Now perform benchmark.
if bench_quantize:
Expand Down

0 comments on commit 6bb22e0

Please sign in to comment.