[Bug][FFI] save_json / ToJSONGraph segfaults on a trivial IRModule in 0.26.0 (also breaks MetaSchedule tuner)
Maintainer thường phản hồi trong vòng 3 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 22/100
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Python
- Star
- 13.9k
- Fork
- 4.1k
- Merge trung bình
- 4 ngày 22 giờ
- Pull request đã merge (30 ngày)
- 22
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của apache/tvm
-
[Bug] [Relax] `relax.op.unique(return_inverse=True)` returns an input-shaped inverse for N-D input when `axis` is NoneCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 3 ngày
-
[Bug][TOPI] `topi.scanop` (`cumsum` / `cumprod`) performs out-of-bounds write/read on empty tensorsĐang mởneeds-triage type: bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 3 ngày
-
[Bug] [Relax] take_backward does not normalize negative axis causing heap OOB write and wrong gradientsCó thể đã có người làm @pierceluu10 đã nhận 4 ngày trước. Đang mởneeds-triage type: bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 3 ngày
-
[Bug][Relax][ONNX] NonZero returns the wrong output shape for scalar inputsCó thể đã có người làm @tandede đã nhận 9 ngày trước. Đang mởneeds-triage type: bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
Maintainer thường phản hồi trong vòng 3 ngày
-
needs-triage type: bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
apache/tvm#21043 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 3 ngày
Issue tương tự
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 78/100
web-push-libs/pywebpush#216 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
AgriciDaniel/claude-seo#572 ·
Maintainer thường phản hồi trong vòng 5 ngày
-
area:print-dispatch
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 92/100
Maintainer thường phản hồi trong vòng 1 ngày
-
area: docs domain: technical-writing good first issue type: documentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 80/100
Deepak3699/Ai_Mentor#919 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày