-
Notifications
You must be signed in to change notification settings - Fork 228
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
[DRAFT] enable MIOpen on Windows #2272
Conversation
@atamazov Please review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Size of long integer is 4 bytes on 64-bit Windows and 8 bytes on 64-bit Linux. We have a lot of places in the code where long integers are used. You should replace all of them with exact-width integer types from stdint (or size_t in some cases) or somehow force compiler to treat them as 8 bytes integers.
.gitignore
Outdated
# JetBrains IDEs | ||
.idea/ | ||
cmake-build*/ | ||
build*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These lines should'n be there, because developers use different IDEs and we can't add all of them
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My question is because that is precisely the purpose of .gitignore. Those files typically are huge in other projects. IDEs add a lot of pollution to the project tree. Anyway, we will be adding Visual Studio Code and Visual Studio IDE in other PRs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added the final version to this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My question is because that is precisely the purpose of .gitignore.
Take a look at Linux's .gitignore. There is nothing associated with IDEs. IDE typically creates only one directory, and this is not a big deal. You can add your favorite IDE in your own .gitignore.
Also developers usually have several build directories for convenience, so adding build directory to .gitignore makes no sense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where every single developer would have to exclude every single file/folder from their commits manually every time
I agree that this file must help developers. But this does not mean that you need to add paths to folders with private photos, your diploma project files, and other files not related to the project. Each developer should manually add files to a commit, and not automatically add junk and then try to clean it up.
But why would i have to add paths to such things? These should not and probably will never end up in a project folder. But the folders that the different IDEs create do end up in the project folder. Its not like one moves them there manually and by will, the IDE just creates them there. Thats what the .gitignore is for. To get around this and exclude such folders, so the project is not bloated and "dependant" on a single IDE.
You are missing the point i guess. You dont write random paths in the .gitignore. You add paths there, that definitly could or will end up in the project folder, but are not part of the project.
In Jetbrains IDEs cases, these folders ".idea/", "cmake-build*/", "build*/" will definitly end up in your project folder, if you use that IDE. Not matter if you want it or not (afaik you can configure the different IDEs not to do so, but thats a competely other thing and way out of this scope). So its not like you should add them to the .gitignore, you basically have to if you dont want to check for those files/folders everytime you make any changes/commits in your project. These files and folders will 100% guranteed end up in your project folder and you 100% dont want to have them in your public git repo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where every single developer would have to exclude every single file/folder from their commits manually every time
I agree that this file must help developers. But this does not mean that you need to add paths to folders with private photos, your diploma project files, and other files not related to the project. Each developer should manually add files to a commit, and not automatically add junk and then try to clean it up.
I really think you are missing the point of that file, so i´ll try to explain it differently:
Lets imagine a project on github, a very simple hello world project. So you had the following (broken down) folder Structure:
- Hello_World
- helloworld.cpp
So you have the Hello_World project folder and a simple helloworld.cpp in that folder, nothing more. Everything fine. Now you open up that project in Visual Studion and now your project folder looks like this:
- Hello_World
- helloworld.cpp
- .vs
Randomly a .vs folder appeared. Now you open the same project in a Jetbrains IDE and the folder structure looks like this:
- Hello_World
- helloworld.cpp
- .vs
- .idea
And there we got another folder, that has nothing to do with the project, but ended up in your project folder. You now make some changes to the helloworld.cpp file and want to commit, but git finds the .vs and the .idea folder and wants to add that to your commit, you would have to exclude that from your commit. You make further changes and further commits. You will propably at one point get really annyoed by the fact, that you have to exclude those 2 folders manually every single time you make a commit. Now the .gitignore comes in to play. You add those folders to your .gitignore and will never ever have to think about those folders in your git commits. Git will just skip them.
Now think about a bigger project with more than just one developer and they all use different IDEs. You dont want to rely on every developer to be able to always be 100% certain they have excluded those files and folders before they commit. Mistakes can happen and those files/folders will sooner or later end up in your git project.
To prevent this from ever happening, you exclude those files and folders, that you know will be created by the different IDEs in your .gitignore. Now no developer have to check first and be 100% certain, that they have correctly excluded every single file and folder that a commonly used IDE might have added to they project folder.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please pay more attention to review codes and cmakefiles. I can agree with @Joly0, but I never think to argue about ignore file is useful.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Totally agree with @scarsty. There shouldnt need to be any argue about the ignore file. It is useful, it is a nice addition by @apwojcik and its smart he thought about adding it in this pr.
Please focus on reviewing the real code and bring this pr and project forward. Many are waiting for a final windows release to use their ROCm cards on Windows
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Joly0 I think you should read @scarsty's comment one more time. I would also like to draw your attention to the fact that this particular pull request is a draft, it was an initial draft. It was decided to split all the work into several subsequent pull requests. If you have constructive suggestions for the entire work, you can present them by creating a new issue or pull request.
endif() | ||
|
||
project ( MIOpen C CXX ) | ||
|
||
enable_testing() | ||
|
||
find_package(Threads REQUIRED) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this package for MIOpen library itself?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it is linked to the MIOpen dynamic library/shared object, MIOpenDriver, and tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In that case, why didn't this dependency exist before?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Windows requires that dependency. We build a single MIOpen.dll - that is the requirement in the project. It does not harm Linux.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then this dependency must be only for windows
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In that case, why didn't this dependency exist before?
Actually it existed in Linux before -> ${CMAKE_THREAD_LIBS_INIT}
https://cmake.org/cmake/help/latest/module/FindThreads.html
test/perfdb.cpp
Outdated
@@ -989,16 +994,55 @@ class DbMultiProcessTest : public DbTest | |||
if(full_set()) | |||
command += " --all"; | |||
|
|||
#if defined(WIN32) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice to keep that code somewhere in one place. I don't insist but looks like it could be a bit better.
|
||
LPSTR lpCmdLn{}; | ||
|
||
#if !defined(UNICODE) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This check is missed for all the other cases where we use CreateProcess.
That's why I think it would be better to keep that code in a one place and reuse it everywhere.
c3f8d52
to
42aebc4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All the review comments must be properly resolved prior merging.
Hi @apwojcik , thank you for working on Windows support. Having MIOpen on Windows is an important milestone, which also improves the quality of our software. I have two general questions about this PR.
Both questions lead to the following issue. Given that our customers will intuitively expect the same MIOpen behavior on Windows and Linux, the approach taken by this PR may lead to significant misunderstanding, a lot of extra work and communication. In this regard, @apwojcik do you agree that Windows and Linux builds should be unified further as much as possible to minimize the risks? |
@dmikushin I invited you to today's meeting |
327cff9
to
9718bc5
Compare
May I ask to not to force-push commits? It's hard to track what happened in-between and since the number of changes is a quite huge, it's hard to re-review everything from the scratch. |
cmake/Findzstd.cmake
Outdated
# | ||
# MIT License | ||
# | ||
# Copyright (c) 2017 Advanced Micro Devices, Inc. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# Copyright (c) 2017 Advanced Micro Devices, Inc. | |
# Copyright (c) 2023 Advanced Micro Devices, Inc. |
cmake/google-test.cmake
Outdated
# | ||
# MIT License | ||
# | ||
# Copyright (c) 2017 Advanced Micro Devices, Inc. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# Copyright (c) 2017 Advanced Micro Devices, Inc. | |
# Copyright (c) 2023 Advanced Micro Devices, Inc. |
I am sorry for that. We are trying to pass the compilation on CI and want the branch clean without intermediate commits. Unfortunately, we do not have a local copy of your CI to test the compilation. We will have it soon. As soon as the compilation passes, the fixes for review comments and failing tests will be added incrementally. |
8d1fdb1
to
009a461
Compare
997446d
to
4f7740f
Compare
@apwojcik How is this pull request going? I would love to see next September/October with ROCM 5.7 to see the 7900xtx. |
Any changes so far? Are we perhaps scheduled for October-November? |
mark... |
Willing to contribute in any way I can. |
When will it be merged all the PR that has been opened for windows? @apwojcik |
Signed-off-by: Artur Wojcik <artur.wojcik@amd.com> rocblas: disable beta features on Windows
4f7740f
to
8cb1a62
Compare
As the review is too slow, I have built a MIOpen.dll with the branch of uif2-initial, and it seems work well on 7900xtx. Please see #2375 (comment) |
This is great! what does this mean for the windows port exactly? are we close to a full release? |
I am not an official. Everyone knows that miopen is one of (maybe we can remove "one of") the most important component to rocm and Windows is the most widely used platform for business and personal use. After the releasing the rocm of Windows Edition, I have paid attention to this for a period of time but the review progress is worrying. |
Just out of curiosity, has anyone talked to the ProRender people to find out where the MIOpen.dll they're shipping with every render plugin on Windows is coming from? It appears to be complete as far as the API is concerned and exported functions (not something stripped down). I think ProRender uses it run denoising mainly, I'm not sure what else. Glancing at the Houdini and Blender plugins, version is v2.0.5.0 / ~7MB / built 11/3/2022 |
that miopen.dll is using OpenCL as backend, which is not good for the new version of rocm. |
Thanks for clearing that up. I can picture multiple ways in which OpenCL isn't the best front-end language to describe the basic data types of tensors never mind that it doesn't seem to be worked on with the goal of at least 1M new vendor extensions per year like... I dunno, Vulkan. I have both a 7900XTX and an RTX4090 in my primary workstation now so if you need tests run on code which dispatches the equivalent ops to both (I thought I read that it was a thing with ROCm & HIP + PyTorch, which is heavily dependent on this AFAIK; it certainly works with the ncnn-vulkan runners / networks but that's a whole other thing) either to compare results, benchmark, or just make sure it doesn't explode when the combination exists after there's a functional build going, feel free to ping me. |
@apwojcik Does this PR and the other windows related PRs overlap or are they exclusive? |
In the cmake file if(WIN32)
set(MIOPEN_USER_DB_PATH "$HOME\\\\.miopen\\\\db\\\\" CACHE STRING "Default path to user db files")
set(MIOPEN_CACHE_DIR "$HOME\\\\.miopen\\\\cache\\\\" CACHE STRING "")
set(MIOPEN_SYSTEM_DB_PATH "C:\\\\ProgramData\\\\MIOpen\\\\" CACHE PATH "Default path to system db files")
else()
set(MIOPEN_USER_DB_PATH "~/.config/miopen/" CACHE STRING "Default path of user db files")
set(MIOPEN_CACHE_DIR "~/.cache/miopen/" CACHE STRING "")
endif() here $HOME is undefined on Windows usually, so the PATH becomes like |
@apwojcik Since all the work has been continued in subsequent PRs, please close this PR if you no longer need it. |
Closing this PR. The work continues in a separate series of PRs. |
Please do not delete the |
PR to enable compilation of MIOpen on Windows. The list of changes compared to Linux:
miopen_generate_export_header()
- usingWINDOWS_EXPORT_ALL_SYMBOLS
is dangerous. It exposes the public exports, not only the API. Furthermore, more importantly, the number of symbols to export is limited to 64K per single DLL on Windows.MIOpen
target was split into theMIOpenCore
static library and theMIOpen
dynamic library. Both tests andMIOpen
DLL link toMIOpenCore
.cmake/googletest.cmake
was renamed tocmake/google-test.cmake
- the Windows file system is case insensitive. There's an official module in CMake namedGoogleTest
. That led to configuration failures because CMake took an incorrect module during the import.sequences
have been upgraded to be used with the Standard Library algorithms, functions, and containers.