Add chipStar (SPIR-V) support for HIP backends#1942
Conversation
|
Note: Please use the libCEED PR template, including the LLM usage declaration. Thanks (requirement in CONTRIBUTING.md) |
|
@jeremylt When will the CI run for this PR? |
|
We have to manually trigger any jobs from forks, so just let us know when you want to run CI. I just approved CI running for the current push. |
|
@jeremylt I've addressed the review feedback in the latest push:
Could you re-trigger CI when convenient? Thanks! |
|
Follow-up: replaced the stderr line filter with |
|
@jeremylt We disabled the HIP backend checks when we removed the AMD card from Noether, right? Did we ever try and get it back going with the NVIDIA card? I'm afraid the CI may not be actually testing the code here (assuming I understand how chip star interacts with the backends). |
Correct - CI is only testing that the build system is correct and that the HIP backend compiles correctly. |
|
Overall this is looking pretty great. I need to do manual testing of the changes since ROCm testing isn't part of CI (as discussed above). Can you post the output of |
zatkins-dev
left a comment
There was a problem hiding this comment.
I think that hijacking the HIP backend for this support is interesting, but creates more brittle and confusing code. I think that this ought to be its own backend, perhaps utilizing the same inner kernels, to clarify the differences with the existing HIP backend
I obviously don't work on the backends that much, so take my opinion with a grain of salt. But the point of chipStar is to just operate straight on HIP code and the changes made, while a bit confusing, are pretty minimal. Perhaps maybe there's some cleaner way to implement the changes. |
I think my main issue is why is this necessary and in what situations. I don't understand it, which means I can't maintain it. |
|
The GPU backends are in a tricky spot with maintainability today, let alone 2 months from now, so I think its a good concern to voice. I agree that the why about not looping over elements is not clear to me either. |
|
@zatkins-dev I wouldn't call this hijacking since chipStar is a full HIP implementation+runtime. The only real change here is the hoisting of These changes are benign but I can run some performance benchmarks on MI50 before and after this refactor and report performance. Having two HIP backends doesn't make sense to me even in the case where there is a performance impact on the AMD side. If I observe a performance degradation on the AMD side, we can discuss how to best set this up. |
|
If the goal is to prevent some threads from not hitting sync points, I would tackle this differently. I have done that before with other kernels. Let me take a look at the code again. |
|
Hijacking may have been a strong word, I meant no offense. I am not concerned about performance, since the macro restores the existing code. I am concerned about how this can be doing the same computation when it removes a loop over elements. I am also confused as to why only the two files that you changed need these changes. As one of the people who will have to maintain this code in the future, I need to know when I should or should not be using these annotations, and I currently have no mental model for that. |
|
I would use the approach in #1950 instead of the macro magic. I think it should do what you're trying to do, but clearer so it can be maintained. I do think that for a big change like this, it is better to first create an issue so design decisions can be discussed first. |
|
After discussion with @jeremylt, I've pulled all kernel changes out of this PR. @jeremylt's PR #1950 handles the syncthreads fix with a cleaner loop-padding approach that works across all platforms without preprocessor guards. This PR now focuses only on the build-system and test-infrastructure changes needed for chipStar support. What's in this PR now
Answers to inline review comments@zatkins-dev on @zatkins-dev on @zatkins-dev on Note on PR #1950I verified the loop-padding approach empirically on chipStar and found a formula bug: chipStar test invocation (for reference)make junit BACKENDS='/gpu/hip/shared /gpu/hip/gen /gpu/hip/ref' JUNIT_ARGS='--env CHIP_LOGLEVEL=crit'Test resultsWith the loop-padding approach (corrected formula equivalent to what I posted on #1950), the following pass on chipStar (Intel Arc A770, Level Zero):
Full |
|
It looks like you heavily use Claude or something similar in your workflow - don't forget to update the LLM usage the disclosure so we know how you do so. Note - you are replying to human generated review comments with machine generated messages. I think it's worth keeping in mind that is a potential frustration point |
| subsearch ?= .* | ||
| JUNIT_BATCH ?= '' | ||
| # Extra arguments forwarded to tests/junit.py (e.g. --env CHIP_LOGLEVEL=crit) | ||
| JUNIT_ARGS ?= |
There was a problem hiding this comment.
Ideally, we should automatically suppress the Chipstar warnings when we build with Chipstar so the test suite passes - so JUNIT_ARGS should be set appropriately by default if Chipstar is enabled
- Detect chipStar via hipconfig and set HIP_LIB_NAME=CHIP - Filter clang-only flags from HIPCONFIG_CPPFLAGS for gcc-compiled sources - Support separate HIPBLAS_DIR for chipStar (hipblas is a separate install) - Use SYCLCXX as linker when SYCL backends are enabled - Skip AMD-specific HIPRTC flags on chipStar; pass only -DCEED_RUNNING_JIT_PASS=1 - Add explicit #include <cstring> in hip-gen for chipStar header compat
|
@jeremylt rebased |
|
Thanks for the work on this, it looks just about ready @pvelesko Can you post the output from @jrwrigh you may want to look at this. Unclear how much the perf difference is chipStar vs SYCL and how much is my perf improvements to the HIP backend family. (but this could provide motivation to find someone with the skills to rework the SYCL backend now that I've overhauled CUDA/HIP backends). I wonder how this looks for HONEE's performance on Intel hardware. |
|
I don't have access to Aurora at the moment. Or at least I'm 90% sure I don't have access to any computer time on there. I can try and double check that tomorrow or Monday. |
|
I tested on my local system and on Aurora. All tests pass except for one (unrelated to this PR, working on it). On Aurora haven't been able to run SYCL tests at all: |
|
Well, like I said above, will merge this once you post the output of |
|
Aurora Benchmarking Results: |
|
@jeremylt make prove results attached btw |
|
It just occurred to me that we need to tell the users how to turn on this feature. Can you add 2-3 sentences explaining what chipStar is and what environment variables the user needs to set here: Line 209 in 5a7ad6a That's the last thing I think we need to merge! |
Explain that the HIP backends can also run on non-AMD GPUs via chipStar (SPIR-V over Level Zero/OpenCL), how to point the build at a chipStar install via HIP_DIR, and which CHIP_* runtime environment variables select the backend and device.
|
@jeremylt readme updated |
|
And libCEED now officially supports chipStar 🎉 |
Purpose:
Add support for chipStar, enabling libCEED HIP backends (
/gpu/hip/ref,/gpu/hip/shared,/gpu/hip/gen) to run on any OpenCL or Level Zero GPU (Intel, etc.) via SPIR-V.LLM/GenAI Disclosure: Claude Code Opus 4.6
By submitting this PR, the author certifies to its contents as described by the Developer's Certificate of Origin.
Please follow the Contributing Guidelines for all PRs.