-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Merge AMD-HIP port #6257
Comments
I took a quick look but it looks pretty preliminary. Have you verified that its actually working? |
Nope, I was hinted on new additions to Github and reacted on that. So you could be totally correct on this. The good part is that you can choose to integrate it gradually, or wait until it's finished. |
Hi, this is Ben from AMD. The port is in the early stages of development as you note. Glad to see this issue since we wanted to make sure the community was aware of our plans and get some early feedback before we get too deep into the port. Let me provide a little background on the tools and what we'd like to do, and ask a couple questions: HIP is an open-source toolkit designed to port CUDA code. After porting, the code can run on AMD ROCm GPU platform or still on the original CUDA (with same performance). HIP runtime and C++ language are familiar to CUDA programmers so the porting process is lightweight and does little damage to the original code. The HIP code is easy to maintain since it is close to CUDA, and provides full C++ support including templates, classes, namespaces, etc. HIP runtime code, headers, and porting tools are maintained on GitHub and updated every 2-4 weeks by AMD developers. AMD is also developing an open-source optimized machine intelligence library called "MIOpen". This will contain convolution, pooling, and other kernels which have been optimized for AMD GPUs. The MIOpen host runtime API accepts HIP parameters for things like streams, and also defines Tensor and other structures for memory management. MIOpen is currently internal but will be open-sourced shortly. We'd like to use these tools to enable MXNet to run on the ROCm platform. Overall strategy would be to port the CUDA code to HIP, and add the calls into MIOpen in the appropriate layers so it runs fast. The MXNet port is being developed in the open here. One early design question we could use some help on: the port currently replaces the CUDA code with HIP code. This was an easy way to start since it requires less initial modification to the MXNet make system - we can just port the .cu files and start building. However, we likely want to instead use a design where the HIP files exist alongside the CUDA ones. What is best way to add a new HIP target to the MXNet code - where should we put the files, and what make changes are required? Thanks! We look forward to participating in the MXNet community, |
I suggest adding a compilation flag
So now we can switch between hip and cuda in source codes by
|
Also you can modify the CMake building system
On Mon, Jun 5, 2017 at 09:42 Mu Li ***@***.***> wrote:
I suggest adding a compilation flag USE_HIP. Then in makefile, add the
following
ifeq ($(USE_HIP), 1)
CFLAGS += -DMXNET_USE_CUDNN=1
LDFLAGS += -lhip # if there is a libhip.so
endif
So now we can switch between hip and cuda in source codes by
#if MXNET_USE_HIP == 1
// codes
#endif
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#6257 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ABM13n_XhAclw_3LYogGmd7zIjoemavWks5sBDARgaJpZM4NbXQy>
.
--
Sent from mobile phone
|
Hi, This is Srihari from AMD: |
We are thinking of more modular approach, like introducing another flag MXNET_USE_GPU, this would have an inline function defined that will be common for both CUDA and HIP implementations, we would separate the inline function implementations into two different files specific to CUDA and HIP, based on the flag that is defined, the preprocessor would expand the inline function into the corresponding implementation. We think that this approach would help us in future to separate the implentation into different backends(HIP,CUDA,...). Please comment. |
That makes sense. |
This issue is closed due to lack of activity in the last 90 days. Feel free to reopen if this is still an active issue. Thanks! |
Just wonder if MXNet can be used with AMD GPUs now? Thanks! |
Thank you, Shiwen.
…On Sat, Oct 14, 2017 at 5:25 PM, Hu Shiwen ***@***.***> wrote:
Reopened #6257 <#6257>.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#6257 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AZHmjvca2zRlT8d46yPOnZqa582bCbkxks5ssVEVgaJpZM4NbXQy>
.
|
@xiaoxinyin This is Work In Progress as a separate package. Very soon we will discuss on refactoring the code and its abstractions(HIP backend) to start merging the code to master. |
@apache/mxnet-committers: This issue has been inactive for the past 90 days. It has no label and needs triage. For general "how-to" questions, our user forum (and Chinese version) is a good place to get help. |
@szha We have created a provision for common backend (CUDA and HIP).We are in the process of creating PR for the same.MxNet has 8 subModules[dlpack, dmlc-core, mshadow, nnvm, ps-lite, cub, openmp, googletest] and backend change should go as atomic commit in all sub-modules.So Please suggest way to raise PR in all sub-modules in one go. |
@sriharikarnam submodules are versioned by commit hash, so you may go ahead and make changes in the submodules first, and once merged, update the submodules in mxnet. |
We are in-progress of disscusiion with sub module owners. example: |
This change will break all legacy build systems and documents with USE_CUDA=1 enabled. I suggest keep USE_CUDA and add USE_GPU as a dispatcher to turn on either USE_CUDA or USE_HIP in makefile and cmake |
please find below changes to retain legacy build system with USE_CUDA. 1) Build system changes: 2) Deep Learning accelerated library(CUDNN): 3)CUDA runtime API |
@sriharikarnam could you add a subpage to apache mxnet wiki and send out an email to dev@ list for the community to review the high level design? Making a PR to reveal the code changes will be also helpful. |
@eric-haibin-lin |
Sorry I was not aware that you cannot edit the wiki page. What's your cwiki.apache.org account/email? I can add you. For the initial design let's just send out a link to google doc on dev@ for people to comment, and we can copy paste the final design to cwiki later. |
M@sriharikarnam Does this has any progress?Is this work still going on? |
@PistonY |
Any news on this? It has been over 2 years already... |
Is this not happening? |
AMD has just released their port for MXnet to AMD GPUs, to be found here.
Please merge that code, so MXnet works on both NVidia and AMD hardware.
The text was updated successfully, but these errors were encountered: