Skip to content

[CORE] Staging Object Tying Feature - #696

Merged
tqchen merged 1 commit into
apache:mainfrom
tqchen:tvm-ffi-r1-dormant-object-tying
Aug 1, 2026
Merged

[CORE] Staging Object Tying Feature#696
tqchen merged 1 commit into
apache:mainfrom
tqchen:tvm-ffi-r1-dormant-object-tying

Conversation

@tqchen

@tqchen tqchen commented Aug 1, 2026

Copy link
Copy Markdown
Member

Summary

Object tying remains compiled but is deliberately staged dormant: canonical-wrapper detection returns false, while C++, Python-defined dataclasses, and Rust objects continue to use matching legacy allocation and deletion paths.

This staging has three goals:

  • let downstream projects upgrade without making existing generated caches depend on the new allocator contract;
  • keep the compatibility change compact by changing only the activation/allocation boundary instead of removing the object-tying implementation;
  • preserve the custom allocator API and a clean path for a later coordinated object-tying activation.

Legacy wrapper identity and reference-count expectations are restored, while activation-only tying tests remain as skipped coverage for the later rollout.

Testing

  • C++: 465 enabled tests passed (2 disabled).
  • Python: 2,381 passed, 78 skipped, 2 expected failures.
  • Rust: 138 unit/integration tests and 3 doctests passed; formatting is clean.
  • Pre-commit: all changed-file checks passed, including ruff, ty, and clang-format.
  • Order-balanced microbenchmarks place the dormant path about 1.3-7.9% behind active tying and 4.7-12.5% ahead of a full revert.

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@tqchen
tqchen force-pushed the tvm-ffi-r1-dormant-object-tying branch from 11c5c52 to 1729a1d Compare August 1, 2026 01:48
Retain the complete Python object-tying implementation and custom allocator API, but deliberately keep canonical wrapper reuse dormant for the current compatibility stage. Public C++, Python-dataclass, and Rust object construction continue to use their matching legacy allocation and deletion paths, and canonical detection returns false.

This staged rollout lets downstream FlashInfer upgrade without breaking previously generated caches, keeps the compatibility change compact by changing the activation and allocation boundary instead of removing the implementation, and preserves a clean path for a later coordinated object-tying activation. Restore legacy wrapper identity and reference-count expectations while retaining the activation-only tying suite as skipped coverage until that rollout.
@tqchen
tqchen force-pushed the tvm-ffi-r1-dormant-object-tying branch from 1729a1d to 89031a1 Compare August 1, 2026 01:49
@tqchen tqchen changed the title [Python] Keep object tying dormant on legacy allocation Staging Object Tying Feature Aug 1, 2026
@tqchen tqchen changed the title Staging Object Tying Feature [CORE] Staging Object Tying Feature Aug 1, 2026
@tqchen

tqchen commented Aug 1, 2026

Copy link
Copy Markdown
Member Author

Post-publication FlashInfer confirmation against published head 89031a1c:

  • Rebuilt the real generated silu_and_mul CUDA source against the published headers for H200 (sm_90a). The resulting DSO has SHA-256 8c9e044ce5d239d946274918bd589e9fbdc6dbdb3b433b448facf2c329db0b52.
  • The DSO has no undefined TVMFFIGetCustomAllocator or TVMFFISetCustomAllocator reference.
  • With LD_BIND_NOW=1, isolated released tvm-ffi 0.1.11 and 0.1.12 runtimes both load the DSO and produce the expected argument-count TypeError; this exercises cache-side error-object construction without a symbol-resolution failure.
  • Both released runtimes also complete a valid FP16 silu_and_mul launch on H200, synchronize successfully, and match the Torch reference at rtol=1e-3, atol=1e-3.
  • In the reverse direction, the pre-allocator-change owned-Shape cache still loads, returns [2, 3], and destroys cleanly with the dormant runtime.

The detailed compatibility investigation and benchmark matrix remain on the task issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants