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

【Hackathon No.109】InfiniTensor推理引擎的Windows系统适配 #177

Open
wants to merge 62 commits into
base: master
Choose a base branch
from

Conversation

MayYouBeProsperous
Copy link

@MayYouBeProsperous MayYouBeProsperous commented Nov 1, 2023

题目:链接

@YdrMaster
Copy link
Collaborator

fmt 没过,注意你本地格式化是否使用 clang-format-14,版本不对出来也不一样。

@YdrMaster
Copy link
Collaborator

openmp 的问题要不直接在 win 上禁用掉好了,改类型的话会影响全平台不合适。win 只需要先保证能跑

@YdrMaster
Copy link
Collaborator

Ok, 能在 github actions 里加上 windows 平台吗?

@MayYouBeProsperous
Copy link
Author

MayYouBeProsperous commented Nov 3, 2023

你好,生成的库还有问题,正在调试中。另外 cuda 相关的 test 全部失败。
image

@whjthu
Copy link
Contributor

whjthu commented Nov 6, 2023

openmp 的问题要不直接在 win 上禁用掉好了,改类型的话会影响全平台不合适。win 只需要先保证能跑

好像不需要在 win 上完全禁掉 openmp,这个问题不是跟 win 平台或编译器绑定的,是跟 openmp 版本绑定的,需要限制下 openmp 版本不小于3.0。Linux上好像 gcc 4.4 就已经支持到 openmp 3.0 了,所以这个限制应该在 gcc 上不会有问题。

@MayYouBeProsperous
Copy link
Author

MayYouBeProsperous commented Nov 6, 2023

好的,MSVC 默认使用 openmp2.0,增加 /openmp:llvm 编译选项可以启用 openmp3.0 。

@whjthu
Copy link
Contributor

whjthu commented Nov 13, 2023

@MayYouBeProsperous 您好,请问这个PR 是否是可合并状态?

@YdrMaster
Copy link
Collaborator

@MayYouBeProsperous 您好,请问这个PR 是否是可合并状态?

请为 CI 添加一个 windows runner

参考:https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#choosing-github-hosted-runners

@MayYouBeProsperous
Copy link
Author

你好,生成的库还有问题,正在调试中。另外 cuda 相关的 test 全部失败。 image

暂时还没解决这个问题

@MayYouBeProsperous
Copy link
Author

好的,我调试一下

@whjthu whjthu requested review from 526690158 and removed request for PanZezhong1725 January 5, 2024 00:43
@zhengly123
Copy link
Contributor

我按现在的CMakeFiles编译了一次,因使用了静态链接InfiniTensor.lib中的kernels在linking时都被LTO了,未链接进最终的可执行文件中。改为动态链接后,可正常运行,但需要做下列修改:

  1. 导出函数符号:set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
  2. 导出静态变量符号,如infini::DataType

相关链接

  1. Exporting symbols in DLL with MSVC
  2. Retaining sybmols during static linkage with MSVC

@MayYouBeProsperous
Copy link
Author

MayYouBeProsperous commented Mar 21, 2024

感谢指导!目前本地能成功编译,但在 CI Actions 中生成的 pyd 文件还有问题,还在解决中。

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