Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DRAFT][luci] Introduce MinimumMSE quantization algorithm #12854

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

SlavikMIPT
Copy link
Contributor

@SlavikMIPT SlavikMIPT commented Apr 8, 2024

This commit introduces MinimumMSE quantization algorithm.

For #13677
ONE-DCO-1.0-Signed-off-by: Vyacheslav Bazhenov [email protected]

@SlavikMIPT SlavikMIPT marked this pull request as draft April 8, 2024 15:12
@SlavikMIPT SlavikMIPT force-pushed the minimum-mse-weights-only branch from e836ee6 to b2da3dc Compare May 17, 2024 13:12
@SlavikMIPT SlavikMIPT force-pushed the minimum-mse-weights-only branch from b2da3dc to 7684e7a Compare July 25, 2024 12:42
@SlavikMIPT SlavikMIPT changed the title [DRAFT][luci] Introduce minimum MSE quantization [luci] Introduce MinimumMSE quantization algorithm Jul 25, 2024
@SlavikMIPT SlavikMIPT marked this pull request as ready for review July 25, 2024 12:43
@SlavikMIPT SlavikMIPT force-pushed the minimum-mse-weights-only branch from 7684e7a to 2dfc832 Compare July 25, 2024 12:52
@seanshpark seanshpark requested a review from jinevening July 28, 2024 21:48
@jinevening
Copy link
Contributor

Please fix build errors.

@SlavikMIPT Can you make the new logic as a new function? How a user can control the algorithm?

@SlavikMIPT SlavikMIPT force-pushed the minimum-mse-weights-only branch 2 times, most recently from 5accef2 to 19f0e71 Compare July 31, 2024 16:08
Copy link
Contributor

@seanshpark seanshpark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

plz add positive and negative tests for new codes.

@SlavikMIPT
Copy link
Contributor Author

@jinevening PTAL

@@ -37,6 +37,12 @@ struct LayerInfo
QuantizationGranularity granularity;
};

enum struct QuantizationAlgorithm
{
Common = 0,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Q) what is the meaning of Common ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Q) what is the meaning of Common ?

General algorithm when scale = max / qmax

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know much about the math itself but it would be better to use a word that can express this.

Comment on lines 74 to 76
const auto kSearchIterations = 100;
const auto kPhi = 1.618033988749894848204586834365638118;
const auto kRangeCoefficient = 0.1;
Copy link
Contributor

@jinevening jinevening Oct 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How are these parameters determined? Do you have any reference?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How are these parameters determined? Do you have any reference?

kPhi is golden ratio constant, other are user controlled parameters of algorithm, default values are determined empirically(optimal value of scale is near the max / qmax base scale)

@jinevening
Copy link
Contributor

jinevening commented Oct 15, 2024

How a user can control the algorithm?

Could you answer this question? Can you make a full draft? This PR is just internal change.

@seanshpark
Copy link
Contributor

close as inactive for some time, feel free to reopen if needed

@seanshpark seanshpark closed this Jan 15, 2025
@SlavikMIPT SlavikMIPT reopened this Jan 20, 2025
@SlavikMIPT SlavikMIPT changed the title [luci] Introduce MinimumMSE quantization algorithm [DRAFT][luci] Introduce MinimumMSE quantization algorithm Jan 20, 2025
@SlavikMIPT SlavikMIPT added the DRAFT A draft issue or PR for sharing one's current working status and discussion. label Jan 20, 2025
@SlavikMIPT SlavikMIPT force-pushed the minimum-mse-weights-only branch from 05b2e7a to 28f6b16 Compare January 20, 2025 11:55
This commit introduces MinimumMSE quantization algorithm.

ONE-DCO-1.0-Signed-off-by: Vyacheslav Bazhenov <[email protected]>
@SlavikMIPT SlavikMIPT force-pushed the minimum-mse-weights-only branch from 28f6b16 to 40713f7 Compare January 20, 2025 12:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DRAFT A draft issue or PR for sharing one's current working status and discussion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants