[Feature][Relax][ONNX] Support LpNormalization operator in Relax ONNX frontend
Les mainteneurs répondent en général sous 3 jours
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Accessibilité débutants
- 67/100
- Type d'issue
- Fonctionnalité
- Clarté
- Plutôt claire
- Activité
- Active
- Stack technique
- python
- Domaine
- machine-learning
Piste de recherche
Start with python/tvm/relax/frontend/onnx/onnx_frontend.py and compare nearby ONNX operator converters to see how they handle attributes and Relax arithmetic. Implement the specified p and axis behavior for supported norm orders, then add or locate frontend tests covering defaults, axes, and output shape and dtype. Done means ONNX models using LpNormalization import and produce the expected normalized values.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Feature Description
Support the ONNX LpNormalization operator in the Apache TVM Relax ONNX frontend (python/tvm/relax/frontend/onnx/onnx_frontend.py).
Motivation
LpNormalization computes $ vector normalization (most commonly $ or $ norm) along a specified axis. It is universally used as the final projection layer in text embedding, multi-modal embedding, and vector retrieval models (such as BGE, E5, OpenAI CLIP, and sentence-transformers) to normalize feature vectors onto the unit sphere for cosine similarity and vector search.
Importing embedding models containing LpNormalization currently fails in the Relax ONNX frontend with:
NotImplementedError: The following operators are not supported: ['LpNormalization']
This operator was also highlighted in the ONNX operator coverage RFC tracking issue #20124 under Activations / Math operators.
Operator Specification (ONNX Opset 1+)
- Inputs:
input: N-D input tensor of floating-point type (float32,float16,bfloat16).
- Attributes:
axis: int (default -1) - the axis along which the norm is computed.p: int (default 2) - the order of the norm (=1$ for $, =2$ for $).
- Outputs:
output: Normalized tensor with identical shape and dtype asinput.
Expected Behavior
The Relax ONNX frontend should implement LpNormalization using Relax arithmetic operations:
- For =2$: compute
norm = relax.op.sqrt(relax.op.sum(relax.op.square(input), axis=axis, keepdims=True))and returnrelax.op.divide(input, norm)(with safe numerical epsilon). - For =1$: compute
norm = relax.op.sum(relax.op.abs(input), axis=axis, keepdims=True)and returnrelax.op.divide(input, norm).
- Langage dominant
- Python
- Étoiles
- 13.9k
- Forks
- 4.1k
- Merge moyen
- 4 j 22 h
- PR mergées (30 j)
- 22
Préparer son environnement
Ce projet ne fournit ni conteneur de développement, ni Dockerfile, ni guide de contribution : l'installation est à votre charge. Commencez par son README, et consultez notre guide de la première contribution pour les étapes générales.
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de apache/tvm
-
[Bug] [Relax] `relax.op.unique(return_inverse=True)` returns an input-shaped inverse for N-D input when `axis` is NonePeut-être pris Une pull request liée à cette issue est ouverte ou déjà fusionnée. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
Les mainteneurs répondent en général sous 3 jours
-
[Bug][TOPI] `topi.scanop` (`cumsum` / `cumprod`) performs out-of-bounds write/read on empty tensorsOuverteneeds-triage type: bug
Difficulté 2/5 1-3 heures Accessibilité débutants 82/100
Les mainteneurs répondent en général sous 3 jours
-
[Bug] [Relax] take_backward does not normalize negative axis causing heap OOB write and wrong gradientsPeut-être pris @pierceluu10 l’a pris il y a 5 jours. Ouverteneeds-triage type: bug
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
Les mainteneurs répondent en général sous 3 jours
-
[Bug][Relax][ONNX] NonZero returns the wrong output shape for scalar inputsPeut-être pris @tandede l’a pris il y a 9 jours. Ouverteneeds-triage type: bug
Difficulté 2/5 1-3 heures Accessibilité débutants 70/100
Les mainteneurs répondent en général sous 3 jours
-
needs-triage type: bug
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
apache/tvm#21043 · 1 commentaire ·
Les mainteneurs répondent en général sous 3 jours
Toutes les issues de apache/tvm
Issues similaires
-
accepted
Difficulté 2/5 1-3 heures Accessibilité débutants 66/100
future-agi/future-agi#5908 ·
Les mainteneurs répondent en général sous 1 jour
-
Placeholder export disables HTML image input for picture descriptionPeut-être pris @cloudiful l’a pris aujourd’hui. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
docling-project/docling-serve#817 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 92/100
Techiebutler/freeframe#687 ·
Les mainteneurs répondent en général sous 1 jour
-
Parse truncated verbose GC logs up to the first XML errorPeut-être pris Une pull request liée à cette issue est ouverte ou déjà fusionnée. Ouvertebug verbose GC
Difficulté 2/5 1-3 heures Accessibilité débutants 74/100
IBM/javacore-analyser#677 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 79/100
Les mainteneurs répondent en général sous 2 jours