Repository navigation
Conversation
|
@ScottTodd is it possible to run build_test_all_arm64 on this PR? It was skipped. The runtime seems to include CUDA now https://github.com/iree-org/iree/actions/runs/9363507812/job/25774464868?pr=17564#step:9:163 |
https://iree.dev/developers/general/contributing/#ci-behavior-manipulation use ci-extra (or ci-exactly) then push a commit to retrigger |
|
Nice, looks like this worked. I see CUDA enabled in https://github.com/iree-org/iree/actions/runs/9371176047/job/25799891554?pr=17564 and some compiler tests with no runtime / hardware requirements using it ran and passed. |
|
note that this may edge into non-default path territory - downloading/compiling cuda stuff for one particular board vs the more common arm systems is a big addition to the default flow (iow, this makes all arm users download/build cuda, whereas only jetson-like users may care) |
|
Yeah, it's even trickier because we check for I'm going to suggest such users enable the flag and don't rely on the default. Given the current status of the CUDA target being opt-in for unsupported platforms is safer. |
|
The motivation for this was here on Discord
The compiler doesn't necessarily need to run on the board itself, so I'm not sure if we'd need to enable the cuda compiler for our package builds to address the user pain there 🤔 |
|
The only thing IREE_CUDA_AVAILABLE does is change the default flags for compiler and runtime backend inclusion. |
|
Hmmm... points taken. I'm on the fence here. If we just want to opt the release build in to including CUDA and leave developer builds stuck with the previous behavior (detected as not available -> defaulted to off), we could pull some changes back from #14611 # build_tools/python_deploy/build_linux_packages.sh
function build_iree_compiler() {
# (always enable? opt-in based on arch?)
+ IREE_TARGET_BACKEND_CUDA=$(uname -m | awk '{print ($1 == "x86_64") ? "ON" : "OFF"}') \
build_wheel compiler/
}
# compiler/setup.py
"-DPython3_EXECUTABLE={}".format(sys.executable),
"-DCMAKE_BUILD_TYPE={}".format(cfg),
+ get_env_cmake_option("IREE_TARGET_BACKEND_CUDA"), |
|
I get the arguments about not building CUDA for every aarch64 source build, but only when building the packages. I will update the PR with the pointer from @ScottTodd.
To be fair, Jetson boards are super common in the edge AI space. There are also ARM workstations coming on the market that seem to support external GPUs. So having CUDA at least in the AArch64 package would be nice. |
I looked into this and we would still need # Supported default target backends that are only available on certain
# platforms.
set(IREE_TARGET_BACKEND_CUDA_DEFAULT ${IREE_TARGET_BACKEND_DEFAULTS})
if(NOT IREE_CUDA_AVAILABLE)
set(IREE_TARGET_BACKEND_CUDA_DEFAULT OFF)
endif()
cmake_dependent_option(IREE_TARGET_BACKEND_CUDA "Enables the 'cuda' compiler target backend" ${IREE_TARGET_BACKEND_CUDA_DEFAULT} ${IREE_BUILD_COMPILER} OFF)
in the main CMakeLists.txt. Reading trough that file in a bit more detail, I think having CUDA disabled on ARM is actually the inconsistent behavior. The main reasons for that:
I will therefore mark this PR as ready for review. |
All that controls is the default value? You should still be able to enable it if the "available" check fails?
I agree there - the logic and policies should be pretty similar. |
Ah I think I misread https://cmake.org/cmake/help/latest/module/CMakeDependentOption.html (especially the part with exposing it to the user). I think it should work with So which path should we go? I would prefer the one in this PR, but I am also open to do this only for the packages. If we go that route, we should probably change rocm to the same behavior in a follow-up PR. @ScottTodd |
|
I have no idea why ROCM got enabled by default on arm64 - that's silly :) |
|
I can do that. I will move CUDA to that behavior in this PR then and try to move rocm in a follow-up. We probably also need to change some comments (for example the ones I posted) and maybe some docs. "That behavior" meaning that it is disabled by default on ARM (maybe even all?) builds, but the packages include them. Does that sound about right @benvanik @ScottTodd ? |
|
The discussion here bounced around a bit. Let me try to collect my thoughts... In PRs like #11976 and #14611, we moved towards more robust build system logic for getting prerequisite files from either the system or from an automatic download for CUDA. Once the build system logic was reliable enough, we enabled CUDA by default on all supported platforms and changed release scripts from being opt-in to just relying on the new defaults. I haven't looked as closely at the ROCm/HIP side, but there is some logic in Enabling compiler target backends and runtime HAL drivers by default (downloading deps automatically as needed) on supported platforms has the advantage of developer builds, CI test builds, and CI release builds all using the same settings. It also has the disadvantage of increasing build time, binary size, and overall complexity for users that don't need those features. Some key metric to optimize for in build system configuration are predictability and convenience. We could make the decision to have hardware backends be disabled by default (predictable), or we could introduce more conditional checks based on platforms where the community gets the most value on average (convenience). I'm still not sure which outcome I'd like here. The automatic downloading is pretty robust and I think the costs of being enabled by default are pretty low. |
|
I think regardless of choice we need to not tie defaults to what the CI/bots/packaging systems do - those should never use defaults. The big red flag here for me is that changing a source build default (the only thing the defaults should be used for) is being used to control packaging. The only bots that should use defaults are smoketest bots for user flows ("if a user checks out a build with no settings, can we build?"). So completely split the argument: CI/packaging/etc uses no defaults at all, and all we're talking about is defaults for source builds. If source builds require a few small deps then I care less about what the default is - but I do reiterate that it's a slippery slope in terms of what we build by default. Many of us are on 64-96 core machines with 128+GB of RAM. Not all users are. Consider first exposure: you check out IREE and build the first time and it takes a very long time building files you don't care about and a lot more harddrive space than you'd expect - are you going to go dig through CMakeLists.txt to find which settings to disable, or are you going to call it bloatware like tf? I know the answer :) Now, if you're a first-time user and want to target CUDA specifically you should hit the getting started CUDA guide which has the right settings (you need to hit this guide anyway to set compiler flags, so it's on the path), or check the cmake output saying "CUDA DISABLED, use IREE_BLAHBLAH to enable," etc. |
|
Sorry, sent without the last sentence: we can enable a lightweight rocm by default in source builds if everyone thinks that's best - I don't, but I'm just one vote :) |
|
Switching at least the package builds to explicitly enable features SGTM. For CI builds, I'll be okay with that if we at least check that the default configuration can configure without errors - more ideas relating to that here: #17136 (comment). |
Signed-off-by: Maximilian Bartel <[email protected]>
Signed-off-by: Maximilian Bartel <[email protected]>
This reverts commit 0d4fae3. Signed-off-by: Maximilian Bartel <[email protected]>
Signed-off-by: Maximilian Bartel <[email protected]>
fabe687 to
bd2d210
Compare
|
@benvanik I updated the PR to only include CUDA for aarch64 when building the package. I would like to post a PSA on the email list before changing the default build behavior and would like to introduce that in a follow up PR. WDYT? |
|
@benvanik Could I get another review/opinion on this PR please? :) |
|
As someone who has tried at various points to build with everything disabled, I think it would be better for that to be the default in the source. And then we have some documented/checked in way to enable the kitchen sink and that is used consistently in CI and packaging. On the cuda/hip front, neither should require the SDK but cuda is currently downloading a ton of stuff to extract the one file it needs (because licensing / none of that stuff is open source). So I think hip is in a better situation here. I don't think either should be enabled in a default build from source config (and neither should other things). |
|
Sounds like we found consensus then. However it doesn't feel like this PR is the correct place to make this change. I would create a follow up PR with a PSA on the email list to disable HIP and CUDA in a default build. Otherwise it could confuse some folks who always used the default build for CUDA/HIP. It would have confused me for sure... This PR would then still be about enabling CUDA for the iree python packages for arm. Could I get a review from that perspective in mind? 🙂 |
|
The incremental nature of this change is giving me some pause. I don't want to hold this up for too long, but it sounds to me like making the changes across all backends + build configurations first would be easier to follow. |
As discussed in #17564 the default build should not include targets that require an SDK. This PR disables CUDA and ROCM by default.
As discussed in iree-org#17564 the default build should not include targets that require an SDK. This PR disables CUDA and ROCM by default.
As discussed in iree-org#17564 the default build should not include targets that require an SDK. This PR disables CUDA and ROCM by default.
ci-extra: build_test_all_arm64