halide / Halide

a language for fast, portable data-parallel computation
https://halide-lang.org
Other
5.77k stars 1.07k forks source link

No longer silently hide errors in Metal completion handlers (alternative approach) #8240

Closed shoaibkamil closed 2 weeks ago

shoaibkamil commented 1 month ago

As discussed in the dev meeting, here is an alternative approach for fixing #7780. Now, the runtime saves an error during the callback from a failed command buffer, and reports the error back at the next opportunity for reporting. Note that this means that a pipeline may get an error that should be attributed to the previous pipeline, but additional error information can be added (e.g. prepending the error message with the name of the kernel that caused it) if wanted.

shoaibkamil commented 1 month ago

Sorry @steven-johnson, I brain-farted and hadn't pushed the branch I intended to push when I opened this. Should be correct now.

slomp commented 1 month ago

@shoaibkamil I recommend pre-pending the error message with something that reminds the user that this error has happened unexpectedly during the execution of a previous pipeline.

steven-johnson commented 1 month ago

C:\build_bot\worker\halide-testbranch-main-llvm19-x86-64-windows-cmake\halide-source\test\correctness\gpu_metal_completion_handler_error_check.cpp(2): fatal error C1083: Cannot open include file: 'unistd.h': No such file or directory

shoaibkamil commented 3 weeks ago

@steven-johnson I've substantially revamped the API here to enable users to pass a user context. PTAL

shoaibkamil commented 3 weeks ago

Investigating crash, and will add tests to makefile.

shoaibkamil commented 3 weeks ago

All green finally, modulor vulkan errors.