[13,930 / 16,704] 223 actions running
Compiling xla/python/callback.cc; 10494s processwrapper-sandbox
Compiling xla/python/sharding.cc; 10424s processwrapper-sandbox
Compiling xla/python/py_values.cc; 10411s processwrapper-sandbox
Compiling xla/python/py_compile_only_client.cc; 10405s processwrapper-sandbox
Compiling xla/python/py_client.cc; 10383s processwrapper-sandbox
Compiling xla/python/py_array.cc; 10288s processwrapper-sandbox
Compiling xla/python/py_buffer.cc; 10230s processwrapper-sandbox ...
--
You received this message because you are subscribed to the Google Groups "OpenXLA Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openxla-discu...@openxla.org.
To view this discussion on the web visit https://groups.google.com/a/openxla.org/d/msgid/openxla-discuss/dc5ec898-37c3-435e-ab67-1f46ea2b415fn%40openxla.org.
For more options, visit https://groups.google.com/a/openxla.org/d/optout.
Glad that helped :-)Although if I'm reading that right, I wouldn't call almost 2 hours fast... (I think that's the curse of depending on LLVM, unfortunately)
To view this discussion on the web visit https://groups.google.com/a/openxla.org/d/msgid/openxla-discuss/CAKeN2eewhjbE_%2B9Tg%2BospbzHpWXbcN9gS_DKYnR0L_Wtqn-MCQ%40mail.gmail.com.
On Fri, May 19, 2023 at 6:22 PM 'Geoffrey Martin-Noble' via OpenXLA Discuss <openxla...@openxla.org> wrote:Glad that helped :-)Although if I'm reading that right, I wouldn't call almost 2 hours fast... (I think that's the curse of depending on LLVM, unfortunately)Actually there is more to this I think. Here is a spreadsheet of the build action (compile and link) with the recommended build invocation from the developer guide: https://docs.google.com/spreadsheets/d/1uOTHseY7tc8AEREcTufaSZuP4ONVhLsA/edit?usp=sharing&ouid=101423881461419382626&rtpof=true&sd=trueOn a high level, the four big pieces of the build (time in minutes):1) xla 434.68
2) llvm 274.52
3) mlir 122.92
4) external/nccl_archive 113.30Some learnings, three most impactful and obvious low hanging fruits:1) Bazel compiles most files three times (!!): one for the "host config" and twice otherwise (why? Some dynamic config in bazel splitting the build graph?). There used to be a flag to disable the separate "host" config, I don't know if it still works but the doc could be updated for this.
2) 82 min are spent building xla tests, even though I may never run them, there has to be a way to have tests not build unless we request testing?
3) We build too many LLVM targets, why isn't the configure steps also allowing the user to select targets? 31 min of my build are spent on the AMDGPU backend...
To view this discussion on the web visit https://groups.google.com/a/openxla.org/d/msgid/openxla-discuss/CANF-O%3Db%2BREanpf_8WGWGFcgrP7Or3oX38%3DGq%3D4kNGmWvWy0Gxg%40mail.gmail.com.
On Fri, May 19, 2023 at 6:22 PM 'Geoffrey Martin-Noble' via OpenXLA Discuss <openxla...@openxla.org> wrote:Glad that helped :-)Although if I'm reading that right, I wouldn't call almost 2 hours fast... (I think that's the curse of depending on LLVM, unfortunately)Actually there is more to this I think. Here is a spreadsheet of the build action (compile and link) with the recommended build invocation from the developer guide: https://docs.google.com/spreadsheets/d/1uOTHseY7tc8AEREcTufaSZuP4ONVhLsA/edit?usp=sharing&ouid=101423881461419382626&rtpof=true&sd=trueOn a high level, the four big pieces of the build (time in minutes):1) xla 434.68
2) llvm 274.52
3) mlir 122.92
4) external/nccl_archive 113.30Some learnings, three most impactful and obvious low hanging fruits:1) Bazel compiles most files three times (!!): one for the "host config" and twice otherwise (why? Some dynamic config in bazel splitting the build graph?). There used to be a flag to disable the separate "host" config, I don't know if it still works but the doc could be updated for this.
2) 82 min are spent building xla tests, even though I may never run them, there has to be a way to have tests not build unless we request testing?3) We build too many LLVM targets, why isn't the configure steps also allowing the user to select targets? 31 min of my build are spent on the AMDGPU backend...
To view this discussion on the web visit https://groups.google.com/a/openxla.org/d/msgid/openxla-discuss/CANF-O%3Db%2BREanpf_8WGWGFcgrP7Or3oX38%3DGq%3D4kNGmWvWy0Gxg%40mail.gmail.com.
On Sat, May 20, 2023, 1:40 AM Mehdi AMINI <joke...@gmail.com> wrote:On Fri, May 19, 2023 at 6:22 PM 'Geoffrey Martin-Noble' via OpenXLA Discuss <openxla...@openxla.org> wrote:Glad that helped :-)Although if I'm reading that right, I wouldn't call almost 2 hours fast... (I think that's the curse of depending on LLVM, unfortunately)Actually there is more to this I think. Here is a spreadsheet of the build action (compile and link) with the recommended build invocation from the developer guide: https://docs.google.com/spreadsheets/d/1uOTHseY7tc8AEREcTufaSZuP4ONVhLsA/edit?usp=sharing&ouid=101423881461419382626&rtpof=true&sd=trueOn a high level, the four big pieces of the build (time in minutes):1) xla 434.68
2) llvm 274.52
3) mlir 122.92
4) external/nccl_archive 113.30Some learnings, three most impactful and obvious low hanging fruits:1) Bazel compiles most files three times (!!): one for the "host config" and twice otherwise (why? Some dynamic config in bazel splitting the build graph?). There used to be a flag to disable the separate "host" config, I don't know if it still works but the doc could be updated for this.
If I recall this flag is/will get removed soon and is already for internal version.
2) 82 min are spent building xla tests, even though I may never run them, there has to be a way to have tests not build unless we request testing?Unfortunately as the tests are (almost all) binaries building is what you are requesting if you use "...". Best may be to help folks with a more narrow build target or just one where one does an exclude on tests path (well except here the tests and libraries intermingled). One could combine blaze query with blaze build to filter test targets. One could file an issue for infra team here.
3) We build too many LLVM targets, why isn't the configure steps also allowing the user to select targets? 31 min of my build are spent on the AMDGPU backend...This is where the cmake ones really make life easier ...
On Sat, May 20, 2023, 1:40 AM Mehdi AMINI <joke...@gmail.com> wrote:On Fri, May 19, 2023 at 6:22 PM 'Geoffrey Martin-Noble' via OpenXLA Discuss <openxla...@openxla.org> wrote:Glad that helped :-)Although if I'm reading that right, I wouldn't call almost 2 hours fast... (I think that's the curse of depending on LLVM, unfortunately)Actually there is more to this I think. Here is a spreadsheet of the build action (compile and link) with the recommended build invocation from the developer guide: https://docs.google.com/spreadsheets/d/1uOTHseY7tc8AEREcTufaSZuP4ONVhLsA/edit?usp=sharing&ouid=101423881461419382626&rtpof=true&sd=trueOn a high level, the four big pieces of the build (time in minutes):1) xla 434.68
2) llvm 274.52
3) mlir 122.92
4) external/nccl_archive 113.30Some learnings, three most impactful and obvious low hanging fruits:1) Bazel compiles most files three times (!!): one for the "host config" and twice otherwise (why? Some dynamic config in bazel splitting the build graph?). There used to be a flag to disable the separate "host" config, I don't know if it still works but the doc could be updated for this.I've never understood why things get done the way they do with bazel. The ergonomics are really quite bad for substantial projects. As near as I can tell, through many interactions, the devs don't use it for serious development outside of Google's internal flows (which differ entirely based on a lot of these ergonomics). Removing the separate host config flag is but one thing I've commented on about this.
Yeah sorry I didn't mean to say that 2 hours was inevitable with LLVM. More like building LLVM changes your expectations of a "fast" build
On Sat, May 20, 2023, 06:34 Jacques Pienaar <jpie...@google.com> wrote:On Sat, May 20, 2023, 1:40 AM Mehdi AMINI <joke...@gmail.com> wrote:On Fri, May 19, 2023 at 6:22 PM 'Geoffrey Martin-Noble' via OpenXLA Discuss <openxla...@openxla.org> wrote:Glad that helped :-)Although if I'm reading that right, I wouldn't call almost 2 hours fast... (I think that's the curse of depending on LLVM, unfortunately)Actually there is more to this I think. Here is a spreadsheet of the build action (compile and link) with the recommended build invocation from the developer guide: https://docs.google.com/spreadsheets/d/1uOTHseY7tc8AEREcTufaSZuP4ONVhLsA/edit?usp=sharing&ouid=101423881461419382626&rtpof=true&sd=trueOn a high level, the four big pieces of the build (time in minutes):1) xla 434.68
2) llvm 274.52
3) mlir 122.92
4) external/nccl_archive 113.30Some learnings, three most impactful and obvious low hanging fruits:1) Bazel compiles most files three times (!!): one for the "host config" and twice otherwise (why? Some dynamic config in bazel splitting the build graph?). There used to be a flag to disable the separate "host" config, I don't know if it still works but the doc could be updated for this.
There are other things going on here with PIC. https://github.com/openxla/iree/pull/13471 on the IREE side just disabled this "feature" that forces everything to build at least one of those extra times. A lot more details in the linked issue.If I recall this flag is/will get removed soon and is already for internal version.Indeed 😥I think something only gets built in the host config if it's used as a host tool, so I think this indicates that something is using heavyweight built tools to do build actions also. Could be possible to fix or exclude those
2) 82 min are spent building xla tests, even though I may never run them, there has to be a way to have tests not build unless we request testing?Unfortunately as the tests are (almost all) binaries building is what you are requesting if you use "...". Best may be to help folks with a more narrow build target or just one where one does an exclude on tests path (well except here the tests and libraries intermingled). One could combine blaze query with blaze build to filter test targets. One could file an issue for infra team here.Indeed the user has in this case requested to build tests. build_tag_filters I think would also help here before breaking into bazel query. But I also think it would be useful to examine the use case. Why would you want to build *everything* but not tests? It seems like in this case you probably are just interested in some specific binaries, no?
3) We build too many LLVM targets, why isn't the configure steps also allowing the user to select targets? 31 min of my build are spent on the AMDGPU backend...This is where the cmake ones really make life easier ...The bazel configuration allows you to specify which targets to include when configuring LLVM: https://github.com/llvm/llvm-project/blob/main/utils/bazel/configure.bzl#L173I think it's just at the repository config level and doesn't expose per-build flags though (we could fix that 🙂)
I do appreciate the discussions happening here. I like the idea of further customizing builds via configure options - such as filtering tests or targets for reducing compilation times.We should also consider mentioning in the developer's guide (https://github.com/openxla/xla/blob/main/docs/developer_guide.md) that using "--sandbox_base=<memory dir>" can significantly speed up the build.For me, it reduced the time from approximately 48 hours to about 2 hours. What a difference!
To view this discussion on the web visit https://groups.google.com/a/openxla.org/d/msgid/openxla-discuss/6925cfef-7bd2-4921-9945-29668ceba329n%40openxla.org.