[serialization] Add serialization support to generator interface #7792
[serialization] Add serialization support to generator interface #7792steven-johnson merged 10 commits intomainfrom
Conversation
steven-johnson
left a comment
There was a problem hiding this comment.
Since schedules depend pretty critically on the Target, we definitely want to require a target to be set.
That said, perhaps we could/should add an option to the string-to-target conversion that will produce the equivalent of Target() -- i.e., shorthand for arch_unknown-os_unknown-0, which is a "Target" that can't be used usefully for codegen, but perhaps could be useful for some serialization purposes?
may be target dependent). Apply auto-scheduler before serialization so that schedules can be serialized.
Doing a quick pass through our generator tests, only a few can actually be serialized without specifying a target, so I'm not sure how useful it would be. |
Fix hlpipe comments. Add missing hlpipe enum to pyenums.
|
Thanks for the comments and feedback! I've made the |
Remove redundant cpp_stub check. Fix comments.
|
Looks like the Make builds are failing to link...? Maybe #7762? |
|
Some stuff probably needs to be guarded with #ifdef WITH_SERIALIZATION |
steven-johnson
left a comment
There was a problem hiding this comment.
LGTM -- bot failures are unrelated, ready to land unless @abadams objects
|
No objection here. I will defer to you, Steven. |
…ide#7792) * Add serialization support to Generator interface * Clang format pass * Make target required when emitting a serialized pipeline (since schedule may be target dependent). Apply auto-scheduler before serialization so that schedules can be serialized. * Fix enum ordering for hlpipe. Fix hlpipe comments. Add missing hlpipe enum to pyenums. * Remove unused Serialization build_mode * Fix formatting * Remove unused serializable flag. Remove redundant cpp_stub check. Fix comments. * Safeguard emit_hlpipe calls with #ifdef WITH_SERIALIZATION --------- Co-authored-by: Derek Gerstmann <dgerstmann@adobe.com> Co-authored-by: Steven Johnson <srj@google.com>
Added new 'hlpipe' output type.
Added new
emit_hlpipe(...)method to generator class interface.Added new
pre_serialization()/post_serializtion()methods to set a flag to bypass target validation during build_pipeline()Note that generators that currently use
natural_vector_size(...)must have a target specified, otherwise they will emit a user_error during serialization. Since almost all our generators seem to rely uponnatural_vector_size(...)it seems like we might need to allow some way to inject a placeholder into the serialization format to allow the target to be unspecified, and the vector size to be resolved when the pipeline is realized.