-
Notifications
You must be signed in to change notification settings - Fork 738
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
[NVPTX][AMD][New offload model] Add support for -fsycl-embed-ir in the new offloading model #14526
[NVPTX][AMD][New offload model] Add support for -fsycl-embed-ir in the new offloading model #14526
Conversation
There will be merge issues with a parallel PR. #13806 Thanks |
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.
lgtm, minor comments!
@@ -0,0 +1,106 @@ | |||
// RUN: %{build} %{embed-ir} -O2 --offload-new-driver -o %t.out |
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.
Can we put this in the sycl/test-e2e/NewOffloadDriver
folder instead?
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.
What is the plan for these tests after the new offload driver becomes the default?
If the plan is to delete the tests using the new driver explicitly after the default behavior is changed, I agree with @sarnex that it would make sense to put them all in the same place.
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.
hi Lukas and Nick
Thanks so much for feedback here.
I am going to remove the E2E test here. I have a new PR coming in very soon that adds a sequence of test for new driver and I will include this there.
I evaluated three options:
- Adding a new file in the same location as the original test
- Adding a new file in a separate folder
- Adding few lines in existing test to enable new offload testing
It seems to me that Option #3 will be the easiest to maintain when we make changes to the test in the future.
@sarnex and @sommerlukas WDYT?
Thanks
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.
IMO 2) is the easiest to maintain, they're all in the same place and won't bog down teams not working on tools
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.
Hi @sarnex . I thought about that. But, users making changes to the original test should remember to change the NewOffloadModel test as well. I thought that was a painpoint.
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 don't feel super strongly on this, so if the test owners are okay with it, it's fine with me.
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 don't feel strong about the location, but I'd prefer if we had a test actually using the IR embedded by the flag.
For example, I think that none of the tests currently in this PR check whether the embedded IR has the correct target name/prefix as expected by the SYCL runtime.
With an e2e test, we would ensure that IR embedding is actually functional.
Option 3 would also be viable to achieve that.
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 am adding the test back. Based on further 'internal thinking' and the fact that there is no 'strong' push for a particular option , I have decided to go with option 2. This will atleast avoid triaging headaches as @sarnex suggested.
Thanks again for discussion.
/// check for -sycl-embed-ir transmission to clang-linker-wrapper tool | ||
// RUN: %clangxx -fsycl -### -fsycl-targets=nvptx64-nvidia-cuda \ | ||
// RUN: -fno-sycl-libspirv -nocudalib --offload-new-driver \ | ||
// RUN: -fsycl-embed-ir %s 2>&1 \ |
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.
What happens if -fsycl-embed-ir
is passed for devices other than NVidia or AMD?
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.
According to our implementation, it will be ignored. I can add a test for it.
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.
Is that acceptable? Would a warning or error be appropriate here?
@@ -0,0 +1,106 @@ | |||
// RUN: %{build} %{embed-ir} -O2 --offload-new-driver -o %t.out |
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.
What is the plan for these tests after the new offload driver becomes the default?
If the plan is to delete the tests using the new driver explicitly after the default behavior is changed, I agree with @sarnex that it would make sense to put them all in the same place.
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.
Looks OK to me.
Removed the 'ccc-print-phases' testing based on comment from @mdtoguchi Thanks |
…e new offloading model Signed-off-by: Arvind Sudarsanam <arvind.sudarsanam@intel.com>
Signed-off-by: Arvind Sudarsanam <arvind.sudarsanam@intel.com>
Signed-off-by: Arvind Sudarsanam <arvind.sudarsanam@intel.com>
…ired Signed-off-by: Arvind Sudarsanam <arvind.sudarsanam@intel.com>
9c76275
to
e34ae78
Compare
Signed-off-by: Arvind Sudarsanam <arvind.sudarsanam@intel.com>
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.
LGTM
The following test is unrelated to the current PR since it fails in others PRs. |
@intel/llvm-gatekeepers Can we merge it? |
Unrelated failure of CUDA CI is tracked in #14715. |
…e new offloading model (intel#14526) When compiling for Nvidia/AMD devices and the user requested the IR to be embedded in the application (via option), We run the output of sycl-post-link (filetable referencing LLVM Bitcode + symbols) through the offload wrapper and link the resulting object to the application. --------- Signed-off-by: Arvind Sudarsanam <arvind.sudarsanam@intel.com> Co-authored-by: Sabianin, Maksim <maksim.sabianin@intel.com>
When compiling for Nvidia/AMD devices and the user requested the IR to be embedded in the application (via option), We run the output of sycl-post-link (filetable referencing LLVM Bitcode + symbols) through the offload wrapper and link the resulting object to the application.