Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Consider a GRU cell with approximate sigmoid/tanh nodes, i.e.
The
u_t
,r_t
,e_t
, and return value of the GRU cell are currently fused together into a single function called:fused_add_abs_add_multiply_multiply_add_add_divide_multiply_subtract_add_abs_add_multiply_multiply_add_add_divide_multiply_add_sign_abs_add_multiply_multiply_add_divide_subtract_multiply_add_divide_multiply_add_add
. This is pretty ungainly when it shows up in thedebug_runtime
profiler,perf
, etc.What I'd propose is modifying https://github.com/dmlc/tvm/blob/89acfeb2582e19e20ba031e896f6b1e64ecc2fb1/src/relay/backend/compile_engine.cc#L82-L84 to detect "long" function names, and replacing them with a truncated version plus a hash of the full name. This allows to disambiguate long fusions (due to taking the hash of the original candidate name), while keeping the size bounded.
Does this sound reasonable? It's arguably an interface change, so it's worth double checking this is OK.
cc @tqchen, @jroesch, @yidawang.