halide / Halide

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

[serialization] Add more metadata for traceability (eg LLVM version) #8304

Open derek-gerstmann opened 1 week ago

derek-gerstmann commented 1 week ago

It'd be nice to add more metadata to the serialization format to enable tools to inject more specific details on where the serialization came from (eg. to enable caching of the data within a larger toolchain).

In particular, adding the LLVM version (particularly when Halide is built from source and not part of a release) would be super useful!

alexreinking commented 1 week ago

What should the deserialization policy be for metadata differences? For instance, if someone builds Halide 18+LLVM 17 and then submits a reproducer, should we be able to deserialize it on our end with Halide 18+LLVM 18?

At the same time, caching scenarios might want a sort of "strict mode" where an error of some sort is returned (or an exception thrown) when attempting to deserialize a metadata-incompatible object (but one that would otherwise return a sensible result).

abadams commented 1 week ago

I'm a bit skeptical about adding the LLVM version. Nothing in the serialized format depends on LLVM in any way. A serialized file should work with any LLVM version that Halide can compile against. Some backends don't even use LLVM.

derek-gerstmann commented 1 week ago

What about an arbitrary header section that allows the client generating the metadata to inject useful strings (that they would need to check for and verify)?