Skip to content

Import Featurizers #2643

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 18 commits into from
Dec 14, 2019
Merged
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 .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ onnxprofile_profile_test_*.json
/csharp/packages
/csharp/src/Microsoft.ML.OnnxRuntime/Microsoft.ML.OnnxRuntime.targets
/csharp/src/Microsoft.ML.OnnxRuntime/Microsoft.ML.OnnxRuntime.props
cmake/external/FeaturizersLibrary/
# Java specific ignores
java/src/main/native/ai_onnxruntime_*.h
java/.gradle

9 changes: 9 additions & 0 deletions cgmanifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,15 @@
"type": "git"
}
}
{
"component": {
"git": {
"commitHash": "006df6bff45dac59d378609fe85f6736a901ee93",
"repositoryUrl": "https://github.com/microsoft/FeaturizersLibrary.git"
},
"type": "git"
}
}
],
"Version": 1
}
4 changes: 2 additions & 2 deletions cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -704,8 +704,8 @@ include(onnxruntime_mlas.cmake)

if(onnxruntime_USE_AUTOML)
add_definitions(-DMICROSOFT_AUTOML)
# Build shared featurizer library
include(onnxruntime_automl_featurizers.cmake)
# Fetch and build featurizers
include(external/featurizers.cmake)
endif()

if(WIN32)
Expand Down
85 changes: 85 additions & 0 deletions cmake/external/featurizers.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
# This source code should not depend on the onnxruntime and may be built independently

set(featurizers_URL "https://github.com/microsoft/FeaturizersLibrary.git")
set(featurizers_TAG "006df6bff45dac59d378609fe85f6736a901ee93")

set(featurizers_pref FeaturizersLibrary)
set(featurizers_ROOT ${PROJECT_SOURCE_DIR}/external/${featurizers_pref})
set(featurizers_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/external/${featurizers_pref})

# Only due to GIT_CONFIG
# Uncoment UPDATE_COMMAND if you work locally
# on the featurizers so cmake does not undo your changes.
if (WIN32)
ExternalProject_Add(featurizers_lib
PREFIX ${featurizers_pref}
GIT_REPOSITORY ${featurizers_URL}
GIT_TAG ${featurizers_TAG}
# Need this to properly checkout crlf
GIT_CONFIG core.autocrlf=input
SOURCE_DIR ${featurizers_ROOT}
# Location of CMakeLists.txt
SOURCE_SUBDIR src/Featurizers
BINARY_DIR ${featurizers_BINARY_DIR}
# UPDATE_COMMAND ""
INSTALL_COMMAND ""
)
else()
ExternalProject_Add(featurizers_lib
PREFIX ${featurizers_pref}
GIT_REPOSITORY ${featurizers_URL}
GIT_TAG ${featurizers_TAG}
SOURCE_DIR ${featurizers_ROOT}
# Location of CMakeLists.txt
SOURCE_SUBDIR src/Featurizers
BINARY_DIR ${featurizers_BINARY_DIR}
CMAKE_ARGS -DCMAKE_POSITION_INDEPENDENT_CODE=ON
# UPDATE_COMMAND ""
INSTALL_COMMAND ""
)
endif()

Copy link
Member

Choose a reason for hiding this comment

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

Just wondering, does the lib has any C++ types in its public interface?

Copy link
Member Author

Choose a reason for hiding this comment

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

Well, they are not public outisde ORT. ORT consumes this library.


In reply to: 357838315 [](ancestors = 357838315)

add_library(automl_featurizers STATIC IMPORTED)
add_dependencies(automl_featurizers featurizers_lib)
target_include_directories(automl_featurizers INTERFACE ${featurizers_ROOT}/src)

if(MSVC)
set_property(TARGET automl_featurizers PROPERTY IMPORTED_LOCATION
${CMAKE_CURRENT_BINARY_DIR}/external/${featurizers_pref}/${CMAKE_BUILD_TYPE}/FeaturizersCode.lib)
else()
set_property(TARGET automl_featurizers PROPERTY IMPORTED_LOCATION
${CMAKE_CURRENT_BINARY_DIR}/external/${featurizers_pref}/libFeaturizersCode.a)
endif()

if (WIN32)
# Add Code Analysis properties to enable C++ Core checks. Have to do it via a props file include.
set_target_properties(automl_featurizers PROPERTIES VS_USER_PROPS ${PROJECT_SOURCE_DIR}/ConfigureVisualStudioCodeAnalysis.props)
endif()

# Build this in CentOS
# foreach(_test_name IN ITEMS
# CatImputerFeaturizer_UnitTests
# DateTimeFeaturizer_UnitTests
# HashOneHotVectorizerFeaturizer_UnitTests
# ImputationMarkerFeaturizer_UnitTests
# LabelEncoderFeaturizer_UnitTests
# MaxAbsScalarFeaturizer_UnitTests
# MinMaxScalarFeaturizer_UnitTests
# MissingDummiesFeaturizer_UnitTests
# OneHotEncoderFeaturizer_UnitTests
# RobustScalarFeaturizer_UnitTests
# SampleAddFeaturizer_UnitTest
# StringFeaturizer_UnitTest
# Structs_UnitTest
# TimeSeriesImputerFeaturizer_UnitTest
# )
# add_executable(${_test_name} ${featurizers_ROOT}/src/Featurizers/UnitTests/${_test_name}.cpp)
# add_dependencies(${_test_name} automl_featurizers)
# target_include_directories(${_test_name} PRIVATE ${featurizers_ROOT}/src)
# target_link_libraries(${_test_name} automl_featurizers)
# list(APPEND featurizers_TEST_SRC ${featurizers_ROOT}/src/Featurizers/UnitTests/${_test_name}.cpp)
# endforeach()

# source_group(TREE ${featurizers_ROOT}/src/Featurizers/UnitTests FILES ${featurizers_TEST_SRC})
46 changes: 0 additions & 46 deletions cmake/onnxruntime_automl_featurizers.cmake

This file was deleted.

5 changes: 4 additions & 1 deletion cmake/onnxruntime_graph.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,13 @@ if (onnxruntime_DISABLE_CONTRIB_OPS)
endif()

if(NOT onnxruntime_USE_AUTOML)
list(REMOVE_ITEM onnxruntime_graph_src
file(GLOB_RECURSE automl_to_remove_graph_src
"${ONNXRUNTIME_ROOT}/core/graph/automl_ops/*.h"
"${ONNXRUNTIME_ROOT}/core/graph/automl_ops/*.cc"
)
foreach(I in ${automl_to_remove_graph_src})
list(REMOVE_ITEM onnxruntime_graph_src ${I})
endforeach()
endif()

if(NOT onnxruntime_USE_DML)
Expand Down
8 changes: 0 additions & 8 deletions onnxruntime/automl_ops/automl_featurizers.h

This file was deleted.

81 changes: 0 additions & 81 deletions onnxruntime/automl_ops/automl_types.cc

This file was deleted.

13 changes: 0 additions & 13 deletions onnxruntime/automl_ops/automl_types.h

This file was deleted.

Loading