-
Couldn't load subscription status.
- Fork 1.1k
Always insert set_host_dirty(), even if there is no GPU target. #8711
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
Conversation
|
These simd_op_checks failing without error output is an annoying mystery... |
|
@vksnk Can you think about this in "preparation" of the dev meeting today? Andrew thought you might want to have something to say about this, regarding internal usage at Google. |
|
I can't think of many internal pipelines which currently rely on host_dirty flag, so I think this should be fine. |
ccb1490 to
2718a2f
Compare
|
Looking at the failure in the make-based builds. Unconditionally true:
On
On this PR branch:
I conclude that this test is broken or should not be run for The CMake build seems to skip this test, based on the However, I don't understand why the CMake build does not attempt to compile and link the generated pipeline. |
|
@alexreinking Do you have a proposal on how to properly disable the output of the generator being compiled in the Make-based system? |
|
@abadams is the person to talk to about Make maintenance |
|
There should be no situation where a pipeline compiled with HL_TARGET=host inserts a dependence on a GPU API, either at link time or run time. This is why I'm a bit dubious of the solution of just always running inject_host_dev_buffer_copies. It may inject unwanted copies. This PR should be constrained to only setting host_dirty flags. However, the test does something that should be an error: it declares that an extern stage leaves a buffer with a dirty OpenCL allocation without having OpenCL support in the target. It wouldn't know how to do the copy-back. I'll open a PR that makes it an error. |
|
See #8794 |
|
An alternative to running inject_host_dev_copies would be to add code in AddImageChecks.cpp near where it checks device_dirty (line 650) to set host_dirty on outputs. |
|
I figured out why it didn't fail for cmake too. Not important but I figured I'd write it down in case it becomes relevant in future. This is failing for the path where we test generators via the cpp backend. When the Makefile runs one of these, after generating the c++ source and a runtime it does roughly: Whereas the cmake build goes via a static library When you link a static library, it only gets the needed symbols. In this case halide_opencl_device_interface isn't needed, because the test never calls the pipeline in the skip case, so the whole pipeline isn't linked. In the Makefile build it's presented as an extra source file. If you do that (or present it as an extra object file), everything directly called counts as a needed symbol, so you get a linker error. So cmake dodged the problem by not linking the problematic code, because it was never called anyway. |
e83e021 to
61fa034
Compare
61fa034 to
f461ff3
Compare
|
I give up... I'll wait with making more contributions until this LLVM ratrace is over. 😭 |
…allows mixing CPU-only and GPU-compatible pipelines.
f461ff3 to
e54a0f2
Compare
|
@alexreinking Can you trigger workflow again here too for make-macos? |
|
All green! |
Always insert
set_host_dirty(), even if there is no GPU target. This allows mixing CPU-only and GPU-compatible pipelines.This is done by simply calling the inject buffer copies lowering pass, which normally does this in the case of GPU targets. The nice thing here is that it doesn't do anything besides adding those calls to
set_host_dirty().cc @abadams