This is an archive of the discontinued LLVM Phabricator instance.

[mlir][quantizer] Add gathering of per-axis statistics in quantizer.
ClosedPublic

Authored by Vooblin on Jan 28 2020, 7:30 AM.

Diff Detail

Event Timeline

Vooblin created this revision.Jan 28 2020, 7:30 AM
Vooblin edited subscribers, added: denis13; removed: mehdi_amini, rriddle, jpienaar and 8 others.
Vooblin retitled this revision from [mlir][quantizer] Add gathering of per-axis stats in quantizer. to [mlir][quantizer] Add gathering of per-axis statistics in quantizer..Jan 28 2020, 7:35 AM
stellaraccident requested changes to this revision.Jan 28 2020, 7:52 AM
stellaraccident added inline comments.
mlir/include/mlir/Quantizer/Support/Statistics.h
73

Thanks for picking up this old todo. One bit of debt about this specific class is that it doesn't have any tests in tree (there were some e2e tests in a related pre-llvm repo). I'll have a detailed review of what you wrote later today, but I wanted to mention this in case if you feel like agreeing the testing situation.

We could pretty easily make this unit testable by adding a corresponding (test) op to compute statistics, implementing a constant folder for it, and then lit testing that.

Reviving this code, which has gone somewhat unused for a while will be a project of mine in about a month, so in this specific case, I'm open to accepting this patch without extending the test situation if doing isn't something you can take on, but it would be much better to resolve that.

This revision now requires changes to proceed.Jan 28 2020, 7:52 AM

Unit tests: pass. 62268 tests passed, 0 failed and 827 were skipped.

clang-tidy: pass.

clang-format: pass.

Build artifacts: diff.json, clang-tidy.txt, clang-format.patch, CMakeCache.txt, console-log.txt, test-results.xml

Pre-merge checks is in beta. Report issue. Please join beta or enable it for your project.

rriddle added inline comments.Jan 28 2020, 9:27 AM
mlir/lib/Quantizer/Support/Statistics.cpp
165

Remove trivial braces.

Vooblin marked an inline comment as done.Jan 31 2020, 3:04 AM
Vooblin added inline comments.
mlir/include/mlir/Quantizer/Support/Statistics.h
73

Thanks for the quick response and I'm sorry to be late with the reply. I think that testing approach with constant folder is great and I suggest I'll do it in a next patch. It'll be great if it's possible to accept these patches separately.

Vooblin updated this revision to Diff 241671.Jan 31 2020, 3:11 AM

Remove trivial braces

Vooblin marked an inline comment as done.Jan 31 2020, 3:12 AM
Vooblin added inline comments.
mlir/lib/Quantizer/Support/Statistics.cpp
165

Done

Unit tests: pass. 62268 tests passed, 0 failed and 827 were skipped.

clang-tidy: pass.

clang-format: pass.

Build artifacts: diff.json, clang-tidy.txt, clang-format.patch, CMakeCache.txt, console-log.txt, test-results.xml

Pre-merge checks is in beta. Report issue. Please join beta or enable it for your project.

stellaraccident accepted this revision.Feb 1 2020, 9:39 AM

Lgtm.

Do you need me to commit this on your behalf?

mlir/include/mlir/Quantizer/Support/Statistics.h
73

Ok, given the pre-existing test infra need and the fact that this is effectively experimental code at this point, we can be pragmatic and upgrade the testing in a follow-up. Thanks.

This revision is now accepted and ready to land.Feb 1 2020, 9:39 AM

Yes, thanks!

This revision was automatically updated to reflect the committed changes.