Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
1463d65
Allow ONNX and TF modules optional
apwojcik Apr 25, 2025
4cc170f
fix license
apwojcik Apr 25, 2025
0dc8684
fix pyflakes
apwojcik Apr 25, 2025
bacde80
fix yapf
apwojcik Apr 25, 2025
4ada011
Revert "fix yapf"
apwojcik Apr 25, 2025
3ec4e30
fix python format
apwojcik Apr 25, 2025
154bceb
fix pyflakes
apwojcik Apr 25, 2025
6eeb27c
add config.h.in
apwojcik May 4, 2025
a8d4327
Merge branch 'develop' into onnx_tf_optional
apwojcik May 4, 2025
31c95e1
change to MIGRAPHX_DISABLE_*
apwojcik May 4, 2025
dd77e86
remove 'guard_define'
apwojcik May 4, 2025
da302fa
revert blank line insert
apwojcik May 4, 2025
344244b
correct config.h
apwojcik May 4, 2025
f0da7ef
change define01 to define
apwojcik May 5, 2025
a5678f0
remove pb_files
apwojcik May 5, 2025
4aed614
add pb_files for tensorflow frontend
apwojcik May 5, 2025
fc6ce79
temp
apwojcik May 5, 2025
0545f50
Merge branch 'develop' into onnx_tf_optional
apwojcik May 5, 2025
d9557c6
Fix compilation after merging #3905
apwojcik May 6, 2025
e02b184
fix license and formatting
apwojcik May 6, 2025
c6741b2
Merge branch 'fix_onnx_pb_files_windows' into onnx_tf_optional
apwojcik May 6, 2025
2e2f5be
fix tidy
apwojcik May 6, 2025
26375ed
Merge branch 'fix_onnx_pb_files_windows' into onnx_tf_optional
apwojcik May 6, 2025
541dba0
use HAVE_* and migraphx_all_frontends
apwojcik May 6, 2025
ba75cd2
use inlude_guard()
apwojcik May 6, 2025
56ff6ee
Merge branch 'fix_onnx_pb_files_windows' into onnx_tf_optional
apwojcik May 6, 2025
f76b1be
fix resource files for api tests
apwojcik May 6, 2025
3e9f26e
move Embed to master CMake
apwojcik May 6, 2025
6eb730a
move Embed to main CMakeList.txt
apwojcik May 7, 2025
2d3ecfd
fix compile with hipBLASLt OFF
apwojcik May 7, 2025
652aaf5
changed to global property
apwojcik May 7, 2025
62f6e7c
add brief_doc
apwojcik May 7, 2025
2c37a50
Revert "move Embed to main CMakeList.txt"
apwojcik May 7, 2025
0bd61fb
Revert "changed to global property"
apwojcik May 7, 2025
aa0a3ac
fix building Python modules for virutal env
apwojcik May 7, 2025
2f62cad
Merge branch 'develop' into onnx_tf_optional
apwojcik May 7, 2025
b51167e
Merge branch 'fix_onnx_pb_files_windows' into onnx_tf_optional
apwojcik May 7, 2025
9f56376
fix docker issue
apwojcik May 7, 2025
402ffd3
fix linking python
apwojcik May 7, 2025
00e930d
Merge branch 'develop' into onnx_tf_optional
apwojcik May 8, 2025
d6d0347
revert Embed from master CMakeLists.txt
apwojcik May 8, 2025
0db637a
Fix Python virtual env issue
apwojcik May 8, 2025
456aa20
Merge branch 'fix_python_modules_venv_windows' into onnx_tf_optional
apwojcik May 8, 2025
c7426f7
some changes
apwojcik May 8, 2025
8d5097f
hide console window when spawning a process
apwojcik May 12, 2025
3458407
Merge branch 'develop' into onnx_tf_optional
apwojcik May 12, 2025
bc895f1
Merge branch 'develop' into onnx_tf_optional
apwojcik May 28, 2025
fcccf61
Merge branch 'develop' into onnx_tf_optional
apwojcik May 29, 2025
b391c58
move generate to the API CMakeLists.txt
apwojcik May 30, 2025
012dc9d
remove add_subdirectory(tools) from main CMakeLists.txt
apwojcik May 30, 2025
9d3a656
fix dependencies to generate target
apwojcik Jun 2, 2025
5fc4c37
incorporate review feeedback
apwojcik Jun 2, 2025
92839f7
update license
apwojcik Jun 2, 2025
e2533b5
make clang-format optional
apwojcik Jun 2, 2025
7f0537a
fix pyflakes
apwojcik Jun 2, 2025
dfaefb3
Merge branch 'develop' into onnx_tf_optional
apwojcik Jun 2, 2025
71f244a
fix tidy
apwojcik Jun 2, 2025
c59bd23
Revert "fix tidy"
apwojcik Jun 2, 2025
546e647
Merge branch 'develop' into onnx_tf_optional
apwojcik Jun 10, 2025
e6fb3db
Merge branch 'develop' into onnx_tf_optional
apwojcik Jul 3, 2025
97a9c7e
Merge branch 'develop' into onnx_tf_optional
apwojcik Jul 8, 2025
bfabef7
Merge branch 'develop' into onnx_tf_optional
apwojcik Nov 14, 2025
bf21796
Merge branch 'develop' into onnx_tf_optional
apwojcik Jan 26, 2026
d11bc28
update license
apwojcik Jan 26, 2026
dbc19ba
Merge branch 'develop' into onnx_tf_optional
apwojcik Jan 26, 2026
f7d7d5f
Merge branch 'develop' into onnx_tf_optional
apwojcik Feb 26, 2026
033900b
Merge branch 'develop' into onnx_tf_optional
apwojcik May 4, 2026
1b388f5
Merge branch 'develop' into onnx_tf_optional
apwojcik May 8, 2026
dc1ecda
Merge branch 'develop' into onnx_tf_optional
apwojcik May 29, 2026
51c0384
Update src/py/migraphx_py.cpp
apwojcik May 29, 2026
975b157
Update src/py/migraphx_py.cpp
apwojcik May 29, 2026
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
5 changes: 3 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,10 @@ endif()

option(MIGRAPHX_USE_ROCBLAS "Enable MIGraphX to use rocBLAS" ON)
option(MIGRAPHX_USE_HIPBLASLT "Enable MIGraphX to use hipBLASLt" ON)
option(MIGRAPHX_ENABLE_PYTHON "Enable python bindings" ON)
option(MIGRAPHX_USE_MIOPEN "Enable MIGraphX to use MIOpen" ON)
option(MIGRAPHX_ENABLE_PYTHON "Enable python bindings" ON)
option(MIGRAPHX_ENABLE_TENSORFLOW "Enable TensorFlow integration" ON)
option(MIGRAPHX_ENABLE_ONNX "Enable ONNX model import" ON)

if(MIGRAPHX_USE_HIPBLASLT AND NOT MIGRAPHX_USE_ROCBLAS)
message(FATAL_ERROR "hipBLASLt requires rocBLAS, but MIGRAPHX_USE_ROCBLAS is OFF")
Expand Down Expand Up @@ -406,7 +408,6 @@ if(BUILD_TESTING)
rocm_enable_test_package(migraphx)
add_subdirectory(test)
endif()
add_subdirectory(tools)

set(DEST_DIR ${CMAKE_BINARY_DIR})
file(GLOB backend_files ${CMAKE_SOURCE_DIR}/src/py/backend/*.py)
Expand Down
11 changes: 10 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,8 @@ if(WIN32)
target_compile_options(migraphx PUBLIC "SHELL:-Xclang -cfguard")
endif()

configure_file(config.h.in include/migraphx/config.h)

configure_file(version.h.in include/migraphx/version.h)
add_library(migraphx_version INTERFACE)
rocm_install_targets(
Expand Down Expand Up @@ -398,12 +400,18 @@ target_link_libraries(migraphx PRIVATE msgpack-cxx)
target_link_libraries(migraphx INTERFACE $<BUILD_INTERFACE:msgpack-cxx>)

add_library(migraphx_all_targets INTERFACE)
add_library(migraphx_all_frontends INTERFACE)

add_subdirectory(api)
add_subdirectory(driver)
if(MIGRAPHX_ENABLE_ONNX)
add_subdirectory(onnx)
target_link_libraries(migraphx_all_frontends INTERFACE migraphx_onnx)
endif()
if(MIGRAPHX_ENABLE_TENSORFLOW)
add_subdirectory(tf)

target_link_libraries(migraphx_all_frontends INTERFACE migraphx_tf)
endif()
if(MIGRAPHX_ENABLE_PYTHON)
add_subdirectory(py)
endif()
Expand Down Expand Up @@ -445,6 +453,7 @@ if(BUILD_DEV)
endif()

target_compile_definitions(migraphx PUBLIC MIGRAPHX_CXX_COMPILER="${CMAKE_CXX_COMPILER}")
add_dependencies(migraphx generate)

rocm_export_targets(
TARGETS migraphx::migraphx_c
Expand Down
38 changes: 33 additions & 5 deletions src/api/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#####################################################################################
# The MIT License (MIT)
#
# Copyright (c) 2015-2025 Advanced Micro Devices, Inc. All rights reserved.
# Copyright (c) 2015-2026 Advanced Micro Devices, Inc. All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand All @@ -22,9 +22,37 @@
# THE SOFTWARE.
#####################################################################################

add_library(migraphx_c
api.cpp
)
find_package(Python 3 REQUIRED COMPONENTS Interpreter)
find_program(CLANG_FORMAT clang-format PATHS /opt/rocm/llvm ENV HIP_PATH PATH_SUFFIXES bin)

set(TOOLS_DIR "${PROJECT_SOURCE_DIR}/tools")
set(BIN_DIR "${PROJECT_BINARY_DIR}/src/api")
set(SRC_DIR "${PROJECT_SOURCE_DIR}/src/api")

set(GENERATE_COMMAND ${Python_EXECUTABLE} generate.py)
if (CLANG_FORMAT)
list(APPEND GENERATE_COMMAND -f ${CLANG_FORMAT})
endif()
if(MIGRAPHX_ENABLE_ONNX)
list(APPEND GENERATE_COMMAND -Denable_onnx)
endif()
if(MIGRAPHX_ENABLE_TENSORFLOW)
list(APPEND GENERATE_COMMAND -Denable_tensorflow)
endif()
list(APPEND GENERATE_COMMAND -o ${PROJECT_BINARY_DIR}/src)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This changes the generated files to be in the build directory instead of the source directory, but you need to remove all the generated source files that are currently committed.

Although, I prefer to have the source committed especially for the API as it makes it easier to view how API changes might change ABI. I understand how it makes it easier for these custom builds though. Perhaps there si a better way to handle this. I dont know what other team members think of this change @CharlieL7 @shivadbhavsar @kahmed10.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think it's OK to not have the source committed. Having both the generation files and the source has led to developers directly editing generated files.


add_custom_command(
OUTPUT ${BIN_DIR}/api.cpp

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This isnt the only output file.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Or should this just run api.py instead of generate.py?

COMMAND ${GENERATE_COMMAND}
DEPENDS ${TOOLS_DIR}/generate.py ${TOOLS_DIR}/api.py ${TOOLS_DIR}/te.py ${SRC_DIR}/migraphx.py
WORKING_DIRECTORY ${TOOLS_DIR}
COMMENT "Generate MIGraphX C API source files...")

add_custom_target(generate DEPENDS ${BIN_DIR}/api.cpp)

add_library(migraphx_c ${BIN_DIR}/api.cpp)
add_dependencies(migraphx_c generate)

set_target_properties(migraphx_c PROPERTIES EXPORT_NAME c)
migraphx_generate_export_header(migraphx_c DIRECTORY migraphx/api)

Expand All @@ -37,7 +65,7 @@ if(BUILD_TESTING)
endif()

rocm_clang_tidy_check(migraphx_c)
target_link_libraries(migraphx_c PRIVATE migraphx migraphx_tf migraphx_onnx)
target_link_libraries(migraphx_c PRIVATE migraphx migraphx_all_frontends)
target_link_libraries(migraphx_c PUBLIC migraphx_version)

rocm_install_targets(
Expand Down
Loading
Loading