[SYCL] Support build with shared libzstd#22294
Conversation
Distros of Fedora family packages only shared libzstd build against which was not fully supported. This commit addresses the gap in a similar way as it's already handled in few other cases in llvm. See for reference: * https://github.com/llvm/llvm-project/blob/af2e3e7881013acbc0309efdb82d1d386eb68d6f/llvm/lib/Support/CMakeLists.txt#L28 * https://github.com/llvm/llvm-project/blob/af2e3e7881013acbc0309efdb82d1d386eb68d6f/lld/ELF/CMakeLists.txt#L9 Signed-off-by: Dmitry Rogozhkin <dmitry.v.rogozhkin@intel.com>
|
@uditagarwal97 Do you mind handling the review of this one? I remember you worked on the zstd support and there was some weird behavior requiring us to use the static one for reasons I don't totally remember. Thanks! |
|
@dvrogozh The reason why we only supported building DPCPP with static zstd initially was to ease distribution of DPCPP by not requiring customers to install zstd separately (if we would have used shared zstd library). While installing zstd on Linux is trivial, that's not the case on Windows. So, in this PR, please put shared zstd build behind a flag that user can opt-in so that the default DPCPP build remains the same. |
Such flag already exists and is inherited from original vllm - that's Line 185 in 7561294 |
I don't think we can rely on And for Fedora build you can explicitly pass -DLLVM_USE_STATIC_ZSTD=0. |
@uditagarwal97, this seem to reinvent the wheel. |
Even if the user doesn't set So, what are our options? Which of these options do you think will be most comfortable for our customers? Regarding
Not all of our users use |
|
@uditagarwal97, with all respect, but what you suggest and highlight does not make sense to me. Per my opinion the proposal you are making is an attempt to workaround initially wrong implementation done in the SYCL library CMake file motivated by highly controversial idea of convenience to use static library and in direct contradiction with the established practice in the upstream LLVM. I strongly recommend to reconsider your recommendation and align behavior with the upstream LLVM practice. Note that right now is a very good time to do so considering that v7.0.0 is a next major release series of DPC++ compiler which is not yet released, so changes in the default behavior if any are totally expected at this very moment. I still don't see however which changes in "default" behavior you are talking about considering that LLVM+cmake already have everything needed to tune the build, i.e. I would also like to point out that even following your idea we will need to patch not only SYCL cmake, but also LLVM and LLD cmakes as well. Please, review the respective code pieces I've pointed to in the PR description. I am absolutely not ok to follow your recommendation to change the PR I have proposed. That is a wrong thing to do per my opinion. This would complicate the code and diverge from the established practice to handle zstd library in upstream LLVM. If you chose not to accept the contribution proposed in this PR, I do expect that you provide the resolution for the following issue which is one of the issues blocking CI enabling on pytorch side for intel/llvm compiler path: |
I'm not sure what was not clear in my previous comment and I would disagree about the initial implementation being incorrect. Upstream LLVM has an optional runtime dependency on
Quote from my previous comment about current DPCPP build behavior:
All I want is for this behavior to stay the same. You can achieve that by setting
Sorry, how? Why would we need to change LLVM/LLD Cmake files? On Fedora, if we build DPCPP with
I am not the sole maintainer/reviewer in intel/llvm, so if anyone else feel comfortable with the change in this PR, they can approve it. I'd have no objections to it. Personally, based on my prior experience enabling zstd in intel/llvm, I think this change will bring unnecessary inconvenience to our users, and so I'm not comfortable approving it myself.
It's simple. Quote from my prior comment: Can we have something like this in |
What you describe is a standard situation in Linux ecosystem development when some new dependency is being introduced and adopted. Instead of swimming against the current and introduce non-standard development approaches it's much better to recognize that 1) there are already know ways to handle what you want to handle, 2) they exist for the reason, 3) they were introduced as a result of the actual experience many Linux developers in the community. I understand that on Windows it's a pain to build almost anything, but that's nether an excuse to step out from open source community practices. If you will look deeper you will find out that these practices do cover Windows case as well. |
I understand your concern and if you feel strongly about making zstd a runtime dependency of DPCPP, let's start an internal discussion including SYCL architects and DPCPP component owners. But, we should definitely have a thorough discussion first before introducing a new runtime dependency to DPCPP. For the time being, to unblock Pytorch, can we use the workaround that I suggested? I am open to discussing other approaches as well. |
I don't feel that this needs to be discussed. This sounds like bureaucracy discussion for no reason. This is a strong requirement from Linux distros to support a build and runtime of the component (intel/llvm) against system installed dependencies. Note that a word "support" is important here - it means that this can be exposed as a choice to the user who will decide if he wants to have a runtime dependency or will prefer to link it in statically. The existing LLVM options already cover all these cases. In other words - this is not actually a component (DPCPP) call to use zstd as a static library, that's a user call. Note that if left unfixed this will be overridden by the patch carried on the Linux distro side. |
I'm sorry if you feel that it's a bureaucratic discussion. Let me reiterate that it's done this way solely for the convenience of our users. If you have any alternative approach/ideas which solves your use case without being inconvenient to other users, I'm all ears. |
Distros of Fedora family package only shared libzstd build against which was not fully supported. This commit addresses the gap in a similar way as it's already handled in few other cases in llvm. See for reference:
llvm/llvm/lib/Support/CMakeLists.txt
Lines 28 to 38 in b09acde
and:
llvm/lld/ELF/CMakeLists.txt
Lines 9 to 18 in b09acde
Fixes: #22310
CC: @sarnex