Skip to content

Commit

Permalink
Delete pyop (#21094)
Browse files Browse the repository at this point in the history
### Description
Remove the "--enable_language_interop_ops" build flag, because the code
is incompatible with the latest numpy, and the build flag is not used
anywhere except a macOS CI pipeline. It does not seem to have a ship
plan.


### Motivation and Context
The build error was:
```
onnxruntime/core/language_interop_ops/pyop/pyop.cc:122:85: error: no member named 'elsize' in '_PyArray_Descr'
                                  static_cast<int64_t>(PyArray_DescrFromType(type)->elsize),
                                                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~  ^
```
  • Loading branch information
snnn authored Jun 19, 2024
1 parent 8ab8e64 commit be42374
Show file tree
Hide file tree
Showing 13 changed files with 2 additions and 655 deletions.
10 changes: 1 addition & 9 deletions cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ option(onnxruntime_GCOV_COVERAGE "Compile with options necessary to run code cov
option(onnxruntime_DONT_VECTORIZE "Do not vectorize operations in Eigen" OFF)

option(onnxruntime_USE_FULL_PROTOBUF "Link to libprotobuf instead of libprotobuf-lite when this option is ON" OFF)
option(onnxruntime_ENABLE_LANGUAGE_INTEROP_OPS "Enable operator implemented in language other than cpp" OFF)
option(onnxruntime_DEBUG_NODE_INPUTS_OUTPUTS "Dump debug information about node inputs and outputs when executing the model." OFF)
cmake_dependent_option(onnxruntime_DEBUG_NODE_INPUTS_OUTPUTS_ENABLE_DUMP_TO_SQLDB "Build dump debug information about node inputs and outputs with support for sql database." OFF "onnxruntime_DEBUG_NODE_INPUTS_OUTPUTS" OFF)
option(onnxruntime_USE_DML "Build with DirectML support" OFF)
Expand Down Expand Up @@ -439,13 +438,6 @@ if (onnxruntime_ENABLE_MEMORY_PROFILE)
endif()

set(ONNX_ML 1)
if (NOT onnxruntime_ENABLE_PYTHON)
set(onnxruntime_ENABLE_LANGUAGE_INTEROP_OPS OFF)
endif()

if (onnxruntime_ENABLE_LANGUAGE_INTEROP_OPS)
add_compile_definitions(ENABLE_LANGUAGE_INTEROP_OPS)
endif()

if (NOT (UNIX AND onnxruntime_ENABLE_PYTHON AND onnxruntime_ENABLE_TRAINING AND (NOT onnxruntime_BUILD_SHARED_LIB)))
if (onnxruntime_ENABLE_TRAINING_TORCH_INTEROP)
Expand Down Expand Up @@ -578,7 +570,7 @@ endif()
#Need python to generate def file
if (onnxruntime_BUILD_SHARED_LIB OR onnxruntime_ENABLE_PYTHON)
if (onnxruntime_ENABLE_PYTHON)
if (onnxruntime_ENABLE_LANGUAGE_INTEROP_OPS OR onnxruntime_REQUIRE_PYTHON_EMBED_LIB)
if (onnxruntime_REQUIRE_PYTHON_EMBED_LIB)
find_package(Python 3.8 COMPONENTS Interpreter Development NumPy)
else()
find_package(Python 3.8 COMPONENTS Interpreter Development.Module NumPy)
Expand Down
7 changes: 0 additions & 7 deletions cmake/onnxruntime.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -205,13 +205,6 @@ set(onnxruntime_INTERNAL_LIBRARIES
onnxruntime_flatbuffers
)

if (onnxruntime_ENABLE_LANGUAGE_INTEROP_OPS)
list(APPEND onnxruntime_INTERNAL_LIBRARIES
onnxruntime_language_interop
onnxruntime_pyop
)
endif()

if (onnxruntime_USE_EXTENSIONS)
list(APPEND onnxruntime_INTERNAL_LIBRARIES
onnxruntime_extensions
Expand Down
8 changes: 0 additions & 8 deletions cmake/onnxruntime_language_interop_ops.cmake

This file was deleted.

12 changes: 0 additions & 12 deletions cmake/onnxruntime_pyop.cmake

This file was deleted.

7 changes: 0 additions & 7 deletions cmake/onnxruntime_python.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -193,10 +193,6 @@ target_link_libraries(onnxruntime_pybind11_state PRIVATE
${pybind11_lib}
)

if (onnxruntime_ENABLE_LANGUAGE_INTEROP_OPS)
target_link_libraries(onnxruntime_pybind11_state PRIVATE onnxruntime_language_interop onnxruntime_pyop)
endif()

set(onnxruntime_pybind11_state_dependencies
${onnxruntime_EXTERNAL_DEPENDENCIES}
${pybind11_dep}
Expand Down Expand Up @@ -1027,6 +1023,3 @@ if (onnxruntime_USE_QNN)
endif()

endif()
if (onnxruntime_ENABLE_LANGUAGE_INTEROP_OPS)
include(onnxruntime_language_interop_ops.cmake)
endif()
4 changes: 0 additions & 4 deletions cmake/onnxruntime_training.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,6 @@ if (onnxruntime_BUILD_UNIT_TESTS)
Boost::mp11 safeint_interface
)

if (onnxruntime_ENABLE_LANGUAGE_INTEROP_OPS)
list(APPEND ONNXRUNTIME_LIBS onnxruntime_language_interop onnxruntime_pyop)
endif()

if(UNIX AND NOT APPLE)
if (HAS_NO_MAYBE_UNINITIALIZED)
target_compile_options(onnxruntime_training_mnist PUBLIC "-Wno-maybe-uninitialized")
Expand Down
20 changes: 0 additions & 20 deletions cmake/onnxruntime_unittests.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -583,10 +583,6 @@ if(onnxruntime_USE_ARMNN)
list(APPEND onnxruntime_test_providers_dependencies onnxruntime_providers_armnn)
endif()

if (onnxruntime_ENABLE_LANGUAGE_INTEROP_OPS)
set(ONNXRUNTIME_INTEROP_TEST_LIBS PRIVATE onnxruntime_language_interop onnxruntime_pyop)
endif()

set(ONNXRUNTIME_TEST_LIBS
onnxruntime_session
${ONNXRUNTIME_INTEROP_TEST_LIBS}
Expand Down Expand Up @@ -916,10 +912,6 @@ endif()
if (onnxruntime_DEBUG_NODE_INPUTS_OUTPUTS)
target_compile_definitions(onnxruntime_test_all PRIVATE DEBUG_NODE_INPUTS_OUTPUTS)
endif()

if (onnxruntime_ENABLE_LANGUAGE_INTEROP_OPS)
target_link_libraries(onnxruntime_test_all PRIVATE onnxruntime_language_interop onnxruntime_pyop)
endif()
if (onnxruntime_USE_ROCM)
if (onnxruntime_USE_COMPOSABLE_KERNEL)
target_compile_definitions(onnxruntime_test_all PRIVATE USE_COMPOSABLE_KERNEL)
Expand Down Expand Up @@ -1057,10 +1049,6 @@ set(onnx_test_libs
onnx_test_data_proto
${onnxruntime_EXTERNAL_LIBRARIES})

if (onnxruntime_ENABLE_LANGUAGE_INTEROP_OPS)
list(APPEND onnx_test_libs onnxruntime_language_interop onnxruntime_pyop)
endif()

if (NOT IOS)
onnxruntime_add_executable(onnx_test_runner ${onnx_test_runner_src_dir}/main.cc)
if(MSVC)
Expand Down Expand Up @@ -1241,10 +1229,6 @@ if (NOT onnxruntime_ENABLE_TRAINING_TORCH_INTEROP)
endif()
set_target_properties(onnxruntime_perf_test PROPERTIES FOLDER "ONNXRuntimeTest")

if (onnxruntime_ENABLE_LANGUAGE_INTEROP_OPS AND NOT onnxruntime_BUILD_SHARED_LIB)
target_link_libraries(onnxruntime_perf_test PRIVATE onnxruntime_language_interop onnxruntime_pyop)
endif()

if (onnxruntime_USE_TVM)
if (WIN32)
target_link_options(onnxruntime_perf_test PRIVATE "/STACK:4000000")
Expand Down Expand Up @@ -1474,10 +1458,6 @@ endif()
onnxruntime_flatbuffers
)

if (onnxruntime_ENABLE_LANGUAGE_INTEROP_OPS)
list(APPEND ONNXRUNTIME_TEST_LIBS onnxruntime_language_interop onnxruntime_pyop)
endif()

target_link_libraries(onnxruntime_test_trainer PRIVATE
${ONNXRUNTIME_TEST_LIBS}
${onnxruntime_EXTERNAL_LIBRARIES}
Expand Down
65 changes: 0 additions & 65 deletions onnxruntime/core/language_interop_ops/language_interop_ops.cc

This file was deleted.

16 changes: 0 additions & 16 deletions onnxruntime/core/language_interop_ops/language_interop_ops.h

This file was deleted.

Loading

0 comments on commit be42374

Please sign in to comment.