tvm
tvm copied to clipboard
[Relax][Transform] Compose preproc functions in LiftTransformParams
The LiftTransformParams pass produces additional functions, either named $FOO_transform_params when generating one transformation function per inference function, or transform_params when generating a single shared transformation function. Prior to this commit, if the IRModule already contained a function with that name, an error would be raised.
After this commit, the LiftTransformParams pass will instead check for existing functions, and compose the previous transformation function with the newly-lifted transformation. This allows LiftTransformParams to be used alongside a hand-written parameter transformation.
Closes https://github.com/apache/tvm/issues/17200
This PR relies on bugfixes implemented in https://github.com/apache/tvm/pull/17312 and https://github.com/apache/tvm/pull/17313. The PR branch contains these bugfixes in its history, to allow CI to run, but will need to be rebased after these per-requisites land in order to maintain a linear commit history on main.
This PR is currently marked as a draft until the pre-requisites land.
The pre-requisite PRs have landed, this PR is rebased on top of main, and is now ready for review.