Skip to content

introduce new train method for sq#227

Merged
LHT129 merged 1 commit into
antgroup:mainfrom
LHT129:sq8_train
Dec 23, 2024
Merged

introduce new train method for sq#227
LHT129 merged 1 commit into
antgroup:mainfrom
LHT129:sq8_train

Conversation

@LHT129

@LHT129 LHT129 commented Dec 17, 2024

Copy link
Copy Markdown
Collaborator

No description provided.

@LHT129 LHT129 added the kind/improvement Optimizations, UX polish, or minor improvements 性能优化、体验打磨或细节改良 label Dec 17, 2024
@LHT129
LHT129 requested a review from inabao December 17, 2024 11:19
@LHT129 LHT129 self-assigned this Dec 17, 2024
@LHT129
LHT129 force-pushed the sq8_train branch 3 times, most recently from b94ca10 to 75b9517 Compare December 18, 2024 10:27
auto ignore_count = static_cast<uint64_t>(static_cast<float>(count - 1) * 0.001);

for (uint64_t i = 0; i < dim_; ++i) {
upper_bound[i] = std::numeric_limits<float>::lowest();

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Unnecessary initialization

std::priority_queue<float, std::vector<float>, std::greater<>> heap_max;
std::priority_queue<float, std::vector<float>, std::less<>> heap_min;
heap_max.emplace(upper_bound[i]);
heap_min.emplace(lower_bound[i]);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

No need for initial values in advance

Comment thread src/quantization/scalar_quantization_trainer.cpp
uint64_t count,
float* upper_bound,
float* lower_bound) const {
auto ignore_count = static_cast<uint64_t>(static_cast<float>(count - 1) * 0.001);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

what happened when count = 0?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

never

Signed-off-by: LHT129 <tianlan.lht@antgroup.com>

@inabao inabao left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@LHT129
LHT129 merged commit 0d2dfa2 into antgroup:main Dec 23, 2024
@LHT129
LHT129 deleted the sq8_train branch December 23, 2024 06:35
Roxanne0321 pushed a commit to Roxanne0321/vsag that referenced this pull request Mar 3, 2025
Signed-off-by: LHT129 <tianlan.lht@antgroup.com>
jiacai2050 pushed a commit to jiacai2050/vsag that referenced this pull request Mar 6, 2025
Signed-off-by: LHT129 <tianlan.lht@antgroup.com>
LHT129 added a commit that referenced this pull request May 11, 2026
Signed-off-by: LHT129 <tianlan.lht@antgroup.com>
Sia-Sheerland pushed a commit to Sia-Sheerland/vsag that referenced this pull request Jun 26, 2026
Signed-off-by: LHT129 <tianlan.lht@antgroup.com>
Signed-off-by: Sia Sheerland <x1075956441x@163.com>

Signed-off-by: Sia Sheerland <x1075956441x@163.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/improvement Optimizations, UX polish, or minor improvements 性能优化、体验打磨或细节改良 size/M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants