Replies: 5 comments 12 replies
-
It's almost perfect unless mixing and interoperating python and C++ are come into place. And it's x10000 less people who know how to do it properly. |
Beta Was this translation helpful? Give feedback.
-
BTW, when you are using std library or the most of boost library it produces fairly good CROSS-PLATFORM code and most of the windows related changes were not related to the libraries at all. So, it looks like we want to solve the problem which does not even exist. |
Beta Was this translation helpful? Give feedback.
-
I understand Boost is something many of us wish to enjoy, but C++ it is not robust enough for dealing with system management and tooling. Look at clang or gcc frontend or any classic code that does process management, piping, command line construction etc from C/C++ -- it's always an unreadable dead beef altogether. I wouldn't say this myself few years ago, and would fully share your point of view. But pybind11's approach to embedding is totally zero-effort. I've recently learned that it is not only good for making bindings, but its embedded interpreter can save thousands of hours spent on re-implementing obvious things in C++, just because we like it. Opinions are made by experience. Mine is based on using both C++ and pybind11/Python. It's difficult to assess any idea without trying it for anything real. Or in other words it's easy to reject something that I barely experienced. |
Beta Was this translation helpful? Give feedback.
-
Providing a python API(which is quite easy to do with pybind) could help replace some of the driver usages as developers could have more interactive environment. However, rewriting core parts of miopen in python has many problems:
|
Beta Was this translation helpful? Give feedback.
-
I guess the best way to make it interesting is to provide few solid examples where it can be useful, simplify everything, reduce amount of boilerplate code and keep all the interactions between C and Python clear. Current snippet does not make much sense and the most interesting part of interpreting numpy array is missing. |
Beta Was this translation helpful? Give feedback.
-
Besides its main purpose, MIOpen involves a lot of general-purpose system programming, such as working with files, env variables and strings. All this logic in C++ is hard to read and often has portability issues. Moreover, many PRs here these days are focused on even more system code development for the Windows port.
I understand some may argue that having the entire MIOpen source in C++ is a reasonable unification. But in fact developing and reviewing a growing volume of non-compute logic handled with C++ only makes our life harder. C++17, boost and platform APIs are not the right tools for housekeeping, e.g. filesystem. They might work very well, but are marginal and consume more engineering resources than they deserve.
Having them in any language other than C++ will not have any sensible performance penalty.
Why not to offload all compute-unrelated code portions from C++ to Python?
Example:
Resume: do whatever system dirty coding in Python for all platforms, and then return to the clean C++ world for only thing it is really important in: compute. Isn't it an efficient compromise?
This is easier and much more accessible to the community, as the Python scripting can be reviewed by x100 more people than those who know how to use Boost.
Beta Was this translation helpful? Give feedback.
All reactions