[Bug] [Relax][Runtime] CPU TopK builds for uint64 but fails in the runtime sort
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 80/100
Línea de trabajo
Lee la lógica de dispatch de ordenación de CPU en src/runtime/extra/contrib/sort/sort.cc, especialmente la rama int64 alrededor de las líneas 456–575. Ejecuta la reproducción proporcionada de ONNX TopK con una compilación de TVM habilitada para LLVM; la tarea se considera completada cuando UINT64 devuelve los valores e índices esperados, como en el caso de control INT64.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Expected behavior
A legal UINT64 ONNX TopK should return the selected values and indices on CPU, as the equivalent INT64 control does.
Actual behavior
Both models import and build. INT64 runs correctly, but UINT64 fails only when the VM executes:
InternalError: Unsupported input dtype: uint64
The CPU sort dispatch has an int64 branch but no uint64 branch. The script checks ONNX reference results and uses nonnegative values representable in both types.
Environment
TVM 0.28.dev0, LLVM 18.1.3, Linux x86_64; Python 3.12.3, NumPy 2.5.4, ONNX 1.22.0, ORT 1.29.0. The installed binary build revision is unknown; current main was inspected statically, not rebuilt.
Steps to reproduce
Run with an LLVM-enabled TVM installation:
import numpy as np
import onnx
import tvm
from onnx import TensorProto as T, helper as h, numpy_helper as nh
from onnx.reference import ReferenceEvaluator
from tvm import relax
from tvm.relax.frontend.onnx import from_onnx
for dtype, elem_type in (("int64", T.INT64), ("uint64", T.UINT64)):
x = np.array([1, 4, 2], dtype=dtype)
expected = [np.array([4, 2], dtype=dtype), np.array([1, 2], dtype="int64")]
model = h.make_model(h.make_graph([
h.make_node("TopK", ["x", "k"], ["values", "indices"])], "topk",
[h.make_tensor_value_info("x", elem_type, [3])],
[h.make_tensor_value_info("values", elem_type, [2]),
h.make_tensor_value_info("indices", T.INT64, [2])],
[nh.from_array(np.array([2], dtype="int64"), "k")]),
opset_imports=[h.make_opsetid("", 11)], ir_version=10)
onnx.checker.check_model(model, full_check=True)
for a, b in zip(ReferenceEvaluator(model).run(None, {"x": x}), expected):
np.testing.assert_array_equal(a, b)
mod = from_onnx(model, keep_params_in_input=False)
vm = relax.VirtualMachine(relax.build(mod, target="llvm"), tvm.cpu())
try:
actual = vm["main"](tvm.runtime.tensor(x))
for a, b in zip(actual, expected):
np.testing.assert_array_equal(a.numpy(), b)
print(dtype, "control passed")
except Exception as error:
if dtype == "int64":
raise
print(dtype, type(error).__name__, str(error).splitlines()[-1])
Triage
- needs-triage
- 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
-
[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
-
needs-triage type: bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
Los mantenedores suelen responder en 1 día
Todos los issues de apache/tvm
Issues similares
-
bug severity:low
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 2 días
-
curriculum documentation quality
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
githubnext/gh-aw-workshop#5367 ·
Los mantenedores suelen responder en 3 días
-
OAuth documentation for GET /api/v2/users/me/ appears inconsistent with required global read scopeAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
Create Noise Latents ignores randomize_seed and produces the same noise every runPosiblemente ocupada @griptapeops la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
griptape-ai/griptape-nodes-library-diffusers#127 ·
Los mantenedores suelen responder en 1 día
-
Jenkins capacity report: metrics history is lost when archiving a month failsPosiblemente ocupada @RaphaelFakhri la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
adoptium/infrastructure#4568 ·
Los mantenedores suelen responder en 1 día