Skip to content
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

[VitisAI] Add vaip Integration Using FetchContent (Cherry-pick of PR#22038 to win-ort-main branch) #23608

Merged

Conversation

wonchung-microsoft
Copy link
Contributor

Description

Integrating the VitisAI EP implement repository into ONNXRuntime using FetchContent.
Statically linking core EP functionality and limiting dynamic links to C-style ABI functions.

This is a cherry-pick of PR#22038

Motivation and Context

Addressing ABI and build compatibility ensures smoother integration and broader applicability of the VitisAI EP.

While PR#22038 is waiting to be merged to main branch, we want to utilize Vitis AI EP in win-ort-main branch. This cherry-pick was ok-ed by AMD.

wcy123 and others added 9 commits February 6, 2025 16:48
update to use integrated vaip

update vaip as the single entry point for cmake

add dummy vaip_xcompile_run.

onnxruntime_vitisia_ep.dll is optional.

vaip_xcompiler_compile maybe nullptr.

update create_ep_context_nodes.
fix compile error

move configuration to vaip

update vaip repo remote url

add vaip_get_default_config API

move pattern zoo to internal (#1)

* move pattern zoo to internal

* change external vaip

---------

Co-authored-by: mingyue <[email protected]>
Co-authored-by: mingyue <[email protected]>

add get_patterrn_list API and change get_pattern API (#2)

* add get_patterrn_list API and change get_pattern API

* lintrunner -a

---------

Co-authored-by: mingyue <[email protected]>
Co-authored-by: mingyue <[email protected]>

change xcompiler_compile API by CPS (#3)

Co-authored-by: mingyue <[email protected]>

[deps] change vaip remote and branch

Add vaip_get/has_mem_xclbin APIs (#4)

* Add vaip_get/has_mem_xclbin APIs

---------

Co-authored-by: mingyue <[email protected]>

vaip point to github/amd

use main branch
cmake/deps.txt Outdated
@@ -60,3 +60,4 @@ directx_headers;https://github.com/microsoft/DirectX-Headers/archive/refs/tags/v
cudnn_frontend;https://github.com/NVIDIA/cudnn-frontend/archive/refs/tags/v1.7.0.zip;d0753d8d5b39947ca0729d7773cb84653a129eb1
dawn;https://github.com/google/dawn/archive/12a3b24c456cebd9fd11f23ac0164f78129b00c6.zip;ad428f6dc16f1336d584f7bad5714e1097dafc43
kleidiai;https://gitlab.arm.com/kleidi/kleidiai/-/archive/d15722976120710080ca098fe8ddabf4556cb40f/kleidiai-d15722976120710080ca098fe8ddabf4556cb40f.zip;d6c840d00c3b05aedf06e957ddaece1013d1f40b
vaip;https://github.com/amd/vaip.git;main
Copy link
Member

Choose a reason for hiding this comment

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

You should put a fixed git commit id, or git tag in the second part.
The third part is a the sha1sum of file downloaded from the second part.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

@@ -43,6 +53,10 @@
target_compile_options(onnxruntime_providers_vitisai PRIVATE -Wno-unused-parameter)
endif(MSVC)

if(MSVC)
target_link_options(onnxruntime_providers_vitisai PRIVATE "/NODEFAULTLIB:libucrt.lib" "/DEFAULTLIB:ucrt.lib")
Copy link
Member

Choose a reason for hiding this comment

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

Why this line is needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Quote from AMD regarding this:

Linking Hybrid CRT is intended to optimize resource management and improve performance. Hybrid CRT (C Runtime) may combine different runtime libraries to optimize specific computational tasks, reduce unnecessary overhead, and potentially allow better memory management.
Among the models we support, some invoke custom ops implemented on the CPU. In our experiments, /MT + Hybrid CRT achieves the best performance.

I believe this is primarily for performance after AMD's internal experiments with vaip.

@wonchung-microsoft wonchung-microsoft changed the title [VitisAI] Add vaip Integration Using FetchContent (Cherry-pick of PR#22038 to main branch) [VitisAI] Add vaip Integration Using FetchContent (Cherry-pick of PR#22038 to win-ort-main branch) Feb 7, 2025
@wonchung-microsoft wonchung-microsoft merged commit 480bcdf into win-ort-main Feb 10, 2025
42 of 46 checks passed
@wonchung-microsoft wonchung-microsoft deleted the user/wonchung/fetch_content_vitisai_ep branch February 10, 2025 21:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants