Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ include(CMakeDependentOption)

option(TORCH_MLIR_ENABLE_WERROR_FLAG "Enable `-Werror` flag on supported directories, treat warning as error" OFF)
option(TORCH_MLIR_USE_INSTALLED_PYTORCH "If depending on PyTorch use it as installed in the current Python environment" ON)
set(TORCH_MLIR_PYTHON_PACKAGE_PREFIX "torch_mlir." CACHE STRING
"Python package prefix used for MLIR python bindings in torch-mlir")
Copy link

Copilot AI Mar 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TORCH_MLIR_PYTHON_PACKAGE_PREFIX is introduced as the configurable prefix, but MLIR_PYTHON_PACKAGE_PREFIX is still hardcoded to torch_mlir. in projects/pt1/python/CMakeLists.txt. This makes prefix customization inconsistent depending on which Python bindings are built. Consider updating that CMakeLists (and any other occurrences) to use TORCH_MLIR_PYTHON_PACKAGE_PREFIX as well so the cache variable applies across the build system.

Suggested change
"Python package prefix used for MLIR python bindings in torch-mlir")
"Python package prefix used for MLIR python bindings in torch-mlir")
set(MLIR_PYTHON_PACKAGE_PREFIX "${TORCH_MLIR_PYTHON_PACKAGE_PREFIX}" CACHE STRING
"Python package prefix used for MLIR python bindings (legacy variable, kept for compatibility)")

Copilot uses AI. Check for mistakes.

option(TORCH_MLIR_ENABLE_REFBACKEND "Enable reference backend" ON)

Expand Down
2 changes: 1 addition & 1 deletion python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ set(TORCH_MLIR_PYTHON_ROOT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/torch_mlir")


# We vendor our own MLIR instance in the `torch_mlir` namespace.
add_compile_definitions("MLIR_PYTHON_PACKAGE_PREFIX=torch_mlir.")
add_compile_definitions("MLIR_PYTHON_PACKAGE_PREFIX=${TORCH_MLIR_PYTHON_PACKAGE_PREFIX}")

################################################################################
# Sources
Expand Down
Loading