tqchen opened a new pull request, #19613: URL: https://github.com/apache/tvm/pull/19613
## Summary The tvm-ffi layer now provides fully featured structural-hash and structural-equal APIs (including `GetFirstStructuralMismatch` with `AccessPath` pair output). The two TUs `src/ir/structural_hash.cc` and `src/ir/structural_equal.cc` had become thin adapters with no logic of their own — they forwarded to tvm-ffi and registered the results as `node.Structural*` globals for Python to call. This PR removes the indirection. - **Commit A** (`[REFACTOR][IR]`): relocates the `ffi::ModuleObj` and `ffi::TensorObj` `__data_to_json__`/`__data_from_json__` `TypeAttrDef` registrations from `structural_hash.cc` into `src/ir/module.cc` and `src/runtime/tensor.cc` respectively, both of which already have a `TVM_FFI_STATIC_INIT_BLOCK` for those types. - **Commit B** (`[REFACTOR][PYTHON]`): rewrites the four Python wrappers in `tvm.ir.base` (`structural_equal`, `get_first_structural_mismatch`, `assert_structural_equal`, `structural_hash`) to call `tvm_ffi._ffi_api` directly, bypassing the now-redundant `node.Structural*` globals. `assert_structural_equal` reconstructs the same diagnostic message in Python using `TVMScriptPrinterScript` with `path_to_underline`. - **Commit C** (`[REFACTOR][IR]`): deletes `src/ir/structural_hash.cc` and `src/ir/structural_equal.cc` whose remaining content (the `node.Structural*` FFI global registrations) is now unused. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
