This is an automated email from the ASF dual-hosted git repository.
tqchen pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tvm.git
The following commit(s) were added to refs/heads/main by this push:
new 08af2cd3b4 [REFACTOR][PYTHON] Remove tvm.ffi shim; import tvm_ffi
directly (#19721)
08af2cd3b4 is described below
commit 08af2cd3b472b241ae52268acd3d36ec381c45dd
Author: Tianqi Chen <[email protected]>
AuthorDate: Wed Jun 10 17:25:46 2026 -0400
[REFACTOR][PYTHON] Remove tvm.ffi shim; import tvm_ffi directly (#19721)
`python/tvm/ffi.py` was a thin `from tvm_ffi import *` redirect. This
removes it and imports `tvm_ffi` directly at the single use site.
---
python/tvm/ffi.py | 21 ---------------------
.../tvm/relax/backend/adreno/transform/_ffi_api.py | 4 ++--
python/tvm/s_tir/transform/transform.py | 3 ++-
python/tvm/tirx/transform/transform.py | 3 ++-
4 files changed, 6 insertions(+), 25 deletions(-)
diff --git a/python/tvm/ffi.py b/python/tvm/ffi.py
deleted file mode 100644
index 29d82a477b..0000000000
--- a/python/tvm/ffi.py
+++ /dev/null
@@ -1,21 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-# pylint: disable=wildcard-import
-# ruff: noqa: F403
-"""Redirects to tvm_ffi"""
-
-from tvm_ffi import *
diff --git a/python/tvm/relax/backend/adreno/transform/_ffi_api.py
b/python/tvm/relax/backend/adreno/transform/_ffi_api.py
index 793021a93e..5bf55a3632 100644
--- a/python/tvm/relax/backend/adreno/transform/_ffi_api.py
+++ b/python/tvm/relax/backend/adreno/transform/_ffi_api.py
@@ -15,6 +15,6 @@
# specific language governing permissions and limitations
"""FFI APIs for Adreno transform"""
-import tvm.ffi
+import tvm_ffi
-tvm.ffi.init_ffi_api("relax.backend.adreno.transform", __name__)
+tvm_ffi.init_ffi_api("relax.backend.adreno.transform", __name__)
diff --git a/python/tvm/s_tir/transform/transform.py
b/python/tvm/s_tir/transform/transform.py
index af4ec493cc..0a56fe5bea 100644
--- a/python/tvm/s_tir/transform/transform.py
+++ b/python/tvm/s_tir/transform/transform.py
@@ -17,7 +17,8 @@
"""S-TIR specific transformations."""
# pylint: disable=invalid-name, unsupported-binary-operation
-from ... import ffi as _ffi
+import tvm_ffi as _ffi
+
from . import _ffi_api
diff --git a/python/tvm/tirx/transform/transform.py
b/python/tvm/tirx/transform/transform.py
index 56b32dcd8f..297872eae6 100644
--- a/python/tvm/tirx/transform/transform.py
+++ b/python/tvm/tirx/transform/transform.py
@@ -20,7 +20,8 @@
import enum
from collections.abc import Callable
-from ... import ffi as _ffi
+import tvm_ffi as _ffi
+
from . import _ffi_api
from . import function_pass as _fpass