[Bug] InferLayoutStack does not handle negative axis
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 68/100
Línea de trabajo
Start at src/relax/op/tensor/manipulate.cc around line 1787, where InferLayoutStack handles the axis, and reproduce the failure with the provided R.stack(..., axis=-1) example followed by ConvertLayout({}). Trace how the axis is validated and used to insert into layout_str; done means this negative-axis case no longer crashes and the relevant tests pass.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
https://github.com/apache/tvm/blob/main/src/relax/op/tensor/manipulate.cc#L1787 trys to convert axis to size_t and insert a character at such position to layout_str. However as described by https://tvm.apache.org/docs/reference/api/python/relax/op.html#tvm.relax.op.stack, the axis can be negative. Program will crash if the axis is negative.
C++ does check whether the position is valid, and throws errors like tvm.error.InternalError: basic_string::replace: __pos (which is 18446744073709551615) > this->size() (which is 2)
Steps to reproduce
from tvm.script import ir as I
from tvm.script import relax as R
@I.ir_module
class Module:
@R.function
def main(inp_0: R.Tensor((2, 3), dtype="float32")) -> R.Tuple(R.Tensor((2, 3, 2), dtype="float32")):
with R.dataflow():
lv: R.Tensor((2, 3, 2), dtype="float32") = R.stack((inp_0, inp_0), axis=-1)
gv: R.Tuple(R.Tensor((2, 3, 2), dtype="float32")) = (lv,)
R.output(gv)
return gv
import tvm
tvm.relax.transform.ConvertLayout({})(Module)
- Lenguaje dominante
- Python
- Estrellas
- 13.9k
- Forks
- 4k
- Merge medio
- 8 h 2 min
- PR fusionados (30 d)
- 180
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de apache/tvm
-
needs-triage type: bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 80/100
Los mantenedores suelen responder en 1 día
-
[Bug] [Relax][ONNX] OneHot does not convert floating-point depth to int64Posiblemente ocupada @tandede la tomó hace 1 día. Abiertoneeds-triage type: bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
-
needs-triage type: bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
needs-triage type: bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
[Bug][Relax] ReorderTakeAfterMatmul fails on vector dot productsPosiblemente ocupada @hiyufan la tomó hace 11 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
apache/tvm#20595 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Todos los issues de apache/tvm
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
FinanceFlash/unvibecode#509 ·
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 82/100
FAIRmat-NFDI/nomad-distro-dev#161 ·
-
bug v2
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
modelcontextprotocol/python-sdk#3821 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
bug severity:low
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 2 días
-
Log-odds calibration uses upper middle score instead of median for even candidate setsPosiblemente ocupada @flysheep-ai la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día