Skip to content

IdModel: loop promotion cleanup#2232

Merged
naoyam merged 13 commits intomainfrom
idmodel_loop_promotion_cleanup
May 21, 2024
Merged

IdModel: loop promotion cleanup#2232
naoyam merged 13 commits intomainfrom
idmodel_loop_promotion_cleanup

Conversation

@naoyam
Copy link
Collaborator

@naoyam naoyam commented May 10, 2024

No logic change. Mostly mechanical cleanup.

Replaced the test-specific IdModel subclass with a callback interface. The callback interface allows to save all necessary temporary results for validation. No more duplication of buildLoopPromotionMap. (Related comment: #2220 (comment))

To introduce the callback interface, moved the loop promotion part out of IdModel to its own builder class.

@naoyam naoyam added the idmodel label May 10, 2024
@naoyam
Copy link
Collaborator Author

naoyam commented May 10, 2024

!build

@naoyam naoyam marked this pull request as ready for review May 10, 2024 22:00
@naoyam
Copy link
Collaborator Author

naoyam commented May 10, 2024

!build

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Almost exact copy from id_model.cpp

idGraph(IdMappingMode::LOOP).validateConsistency();
}

std::unordered_map<ValGroup, IterDomain*> IdModel::buildLoopPromotionMap(
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved to loop_promotion.cpp

@naoyam naoyam requested a review from zasdfgbnm May 10, 2024 22:17
@naoyam
Copy link
Collaborator Author

naoyam commented May 11, 2024

CI passed at 2b605cd

@naoyam
Copy link
Collaborator Author

naoyam commented May 20, 2024

!build

Copy link
Collaborator

@zasdfgbnm zasdfgbnm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the callback only used in tests? Or it will be used somewhere else in the future?

@naoyam
Copy link
Collaborator Author

naoyam commented May 20, 2024

Only the tests. I don't have any planned use case either.

@naoyam naoyam merged commit 690134d into main May 21, 2024
@naoyam naoyam deleted the idmodel_loop_promotion_cleanup branch May 21, 2024 03:48
naoyam added a commit that referenced this pull request May 21, 2024
This was a small oversight. Since sibling tensors always share the
loops, their iter domains should always be mapped in the loop graph, no
matter how they are inlined. Added a simple repro and a fix.

(Stacked on top of #2232)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants