Skip to content

refactor: replace embd_normalize integer parameter with enum#24173

Open
SaurabhCodes-16 wants to merge 1 commit into
ggml-org:masterfrom
SaurabhCodes-16:refactor/embd-normalize-enum
Open

refactor: replace embd_normalize integer parameter with enum#24173
SaurabhCodes-16 wants to merge 1 commit into
ggml-org:masterfrom
SaurabhCodes-16:refactor/embd-normalize-enum

Conversation

@SaurabhCodes-16
Copy link
Copy Markdown

@SaurabhCodes-16 SaurabhCodes-16 commented Jun 5, 2026

Overview

This PR refactors the embedding normalization parameter from a plain int to a strongly typed enum common_embd_norm, addressing the inline TODO comment in common/common.h.

Specifically:

  • Defined enum common_embd_norm representing the normalization types (-1=none, 0=max absolute, 1=taxicab, 2=euclidean).
  • Refactored common_embd_normalize signature and all parsing, server, and example client usages.
  • Added a performance optimization for the L1 Taxicab norm (COMMON_EMBD_NORM_TAXICAB) avoiding unnecessary std::pow calls.

Requirements

  • I have read and agree with the contributing guidelines
  • AI usage disclosure: YES - Assisted by Antigravity AI coding assistant to refactor parameter signatures/definitions to the new enum and implement the L1 norm optimization.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant