[Bug][FFI] save_json / ToJSONGraph segfaults on a trivial IRModule in 0.26.0 (also breaks MetaSchedule tuner)
Los mantenedores suelen responder en 3 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 22/100
Línea de trabajo
Start by running the four-line reproduction in the issue, which calls tvm.ir.save_json on a trivial IRModule and segfaults inside tvm::ffi::ToJSONGraph. The issue links this to PR #19662, which routed JSON serialization through tvm-ffi, so begin with that change and the native ToJSONGraph code it touched. Done means save_json returns a string on x86_64 and aarch64 and the MetaSchedule tune_tir reproduction no longer crashes.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Expected behavior
tvm.ir.save_json(mod) returns a JSON string for a valid IRModule.
Actual behavior
On the 0.26.0 release, tvm.ir.save_json() segfaults (SIGSEGV, core dumped) on even a trivial IRModule. The native backtrace points at tvm::ffi::ToJSONGraph:
!!!!!!! Segfault encountered !!!!!!!
File "<unknown>", line 0, in tvm::ffi::ToJSONGraph(tvm::ffi::Any const&, tvm::ffi::Any const&)
File "<unknown>", line 0, in _PyObject_MakeTpCall
...
Segmentation fault (core dumped)
Because MetaSchedule routes workload/record serialization through this same path, this also makes the tuner unusable on this build: ms.tune_tir(...) and ms.relax_integration.tune_relax(...) both crash with the identical ToJSONGraph backtrace during setup/task-extraction (exit 139), even with an in-memory MemoryDatabase. MemoryDatabase.commit_workload(single_primfunc) by itself does not crash, so the fault appears to be in the JSON-graph serialization specifically.
Minimal reproducible example
import tvm
from tvm import te
A = te.placeholder((8,), "float32", name="A")
C = te.compute((8,), lambda i: A[i] * 2.0, name="C")
mod = tvm.IRModule({"main": te.create_prim_func([A, C])})
tvm.ir.save_json(mod) # -> SIGSEGV in tvm::ffi::ToJSONGraph
Environment
- TVM: 0.26.0 (release wheel)
- Python: 3.12.3
- OS: Linux x86_64, glibc 2.39
- The same crash reproduces on aarch64, where it surfaces as SIGBUS instead of SIGSEGV.
Possible cause
This looks related to #19662 ("[FFI][IR] Route JSON serialization through tvm-ffi"), which moved JSON serialization through tvm-ffi — the layer where ToJSONGraph lives. Happy to test a patch or provide a core dump.
- Lenguaje dominante
- Python
- Estrellas
- 13.9k
- Forks
- 4.1k
- Merge medio
- 4 d 22 h
- PR fusionados (30 d)
- 22
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] `relax.op.unique(return_inverse=True)` returns an input-shaped inverse for N-D input when `axis` is NonePosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 3 días
-
[Bug][TOPI] `topi.scanop` (`cumsum` / `cumprod`) performs out-of-bounds write/read on empty tensorsAbiertoneeds-triage type: bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 3 días
-
[Bug] [Relax] take_backward does not normalize negative axis causing heap OOB write and wrong gradientsPosiblemente ocupada @pierceluu10 la tomó hace 4 días. Abiertoneeds-triage type: bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 3 días
-
[Bug][Relax][ONNX] NonZero returns the wrong output shape for scalar inputsPosiblemente ocupada @tandede la tomó hace 9 días. Abiertoneeds-triage type: bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
Los mantenedores suelen responder en 3 días
-
needs-triage type: bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
apache/tvm#21043 · 1 comentario ·
Los mantenedores suelen responder en 3 días
Todos los issues de apache/tvm
Issues similares
-
Dificultad 1/5 1-3 horas Aptitud para principiantes 78/100
web-push-libs/pywebpush#216 · 1 comentario ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
AgriciDaniel/claude-seo#572 ·
Los mantenedores suelen responder en 5 días
-
area:print-dispatch
Dificultad 2/5 1-3 horas Aptitud para principiantes 92/100
Los mantenedores suelen responder en 1 día
-
area: docs domain: technical-writing good first issue type: documentation
Dificultad 2/5 1-3 horas Aptitud para principiantes 80/100
Deepak3699/Ai_Mentor#919 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día