[Unity][Tracking Issue] Phase Ordering #15009
Labels
branch: unity
needs-triage
PRs or issues that need to be investigated by maintainers to find the right assignees to address it
type:rfc-tracking
RFC progress tracking. Ref: https://github.com/apache/tvm-rfcs
Per the previous discussion of instituting some explicit phase ordering in Relax to account for the fact that some passes already rely on each other, this is a proposal for adopting some of the measures from the discussion.
transform.h
or aREADME.md
ininclude/tvm/relax
that describes the known pass dependencies.LambdaLifting
as a final step after parsing.PackedFunc
s and preparing for VM code generation). It will be important to mark transition points accordingly (LambdaLifting
as 0->1,LegalizeOps
as 1->2,VMBuiltinLower
as 2->3).RunCodegen
).relax.force_pure
attribute after phase 2. Additionally, there should be no remaining uses ofcall_pure_packed
orinvoke_pure_closure
after phase 2. (These are both already implemented by theRemovePurityTracking
pass; this would just enforce the invariant.)call_tir
andcall_dps_packed
after phase 2.This list is meant as a starting point for further discussion, as there were still some unresolved disagreements in the earlier thread. By dividing the implementation into steps, this could help make the discussion more concrete by focusing on implementation.
In terms of implementation, the biggest question centers on the BYOC passes, which rely on inner functions. This is the only major case where the current implementation of passes differs from what was proposed (namely, eliminating inner functions early on). We should also be certain of which passes are responsible for updating the phase attribute (those proposed above under P3.1 are all non-optional passes, so I would argue they are reasonable candidates).
We may also consider trying to enforce some finer-grained ordering constraints (see the "megapasses" in the discussion thread), though there did not seem to be wide support for this; it may suffice to note these constraints in the documentation without enforcing them directly.
cc @quic-sanirudh
The text was updated successfully, but these errors were encountered: