mlc-ai / relax

Apache License 2.0
149 stars 75 forks source link

[Unity] MetaScheduleApplyDatabase using workload from records #194

Closed MasterJH5574 closed 1 year ago

MasterJH5574 commented 1 year ago

This PR fixes an issue in MetaScheduleApplyDatabase, which uses the IRModule being queried as the base module of TIR Schedule. This will cause the inconsistency between the IRModule being scheduled and the trace of the record. For example, the trace of the record may have get-block instructions which tries to get block from a given name, which exists in the IRModule of the record while does not exist in the IRModule being queried (which is right the IRModule being scheduled).

Therefore, this PR adds a case discussion. When anchor-op equality is not applied, we create the TIR schedule from the IRModule of the record, so that we can prevent the issue above from happening.

Will send this PR to unity soon, together with unit tests.