-
Notifications
You must be signed in to change notification settings - Fork 84
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
Update passes to use offload_copy based on root module #1875
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #1875 +/- ##
===========================================
- Coverage 91.39% 91.37% -0.02%
===========================================
Files 419 419
Lines 15542 15544 +2
===========================================
Hits 14204 14204
- Misses 1338 1340 +2
|
This build is not recommended to merge 🔴 |
🔴cadene-dpn92_1: FAILED: MIGraphX is not within tolerance - check verbose output |
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.
I understand the change to use get_root_module()
and including a root module pointer. However you mentioned that there might be multiple root modules with multi-target compilation? I do not understand what benefit that gives us compared to having one root module and sub-modules that go to specific targets.
One root module is the "main" module. This main root module would run on the "Ref" target initially and it would call different target-specific root modules at the top level. |
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.
Approved.
Question for my understanding:
If we have offload_copy on and a program that goes GPU->CPU->GPU with the changing root modules, this means that each module would have its own offload copies right? I could see MIGX optimizing the second GPU offloads if we can reuse those from the first GPU section.
On the other hand, if offload_copy is off we would have output parameters for both the GPU sections?
Yes each root module would have its own parameters and offload copies.
Currently, I don't think MIGX is optimizing it but we can try to do it optimization later. Right now idea is that each target root module is compiled as separate self-containing programs. So each target root module would have its own parameters and return values.
Yes if offload_copy is off then it would have output parameters, but it can't work without offload-copies for now for multi-targets. We don't have a mechanism to put parameters into GPU and copy back the final result from the host for the multi-target programs. Also for the multi-targets where execution is switching between GPU/CPU/FPGA, it may not make sense to not have offload-copy, compiler would have to inject necessary copies to switch between targets. |
Needed to run multi-targeted program where "main" isn't the only root module. There could be many root modules other than main.