nni icon indicating copy to clipboard operation
nni copied to clipboard

fix(speedup): refactor the execution logic of functions in speedup

Open Louis-J opened this issue 2 years ago • 0 comments

Description

In speedup, we use a non-general trick to treat the prim ops. We analyze the relationship between the prim ops, then delete all the prim ops, finally connect the non-prim op directly. We also assume that all the intermediate variables are tensors, tuples of tensors, or lists of tensors. But it'll cause many problems in various models.

So, it's better to execute all the prim ops for real. In this pr, I remove the deletion of prim ops, and execute the prim recursively. And the assumption of variable types is also removed. Now it's closer to the original execution.

But it changed a lot and is untested now. More work is needed.

#5097

Test Options

  • [ ] fast test
  • [ ] full test - HPO
  • [ ] full test - NAS
  • [ ] full test - compression

Checklist

  • [ ] test case
  • [ ] doc

How to test

Louis-J avatar Sep 02 '22 11:09 Louis-J