-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[serialization] Add serialization support to generator interface #7792
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.