Skip to content

Conversation

@victor-eds
Copy link
Contributor

@victor-eds victor-eds commented Oct 31, 2024

Each of the two commits in this PR should be reviewed separately.

08786ac: To be upstreamed. Extends memory allocation analysis infrastructure so the analysis to use can be configured.

d3fe27b: Downstream. Use an Intel-specific analysis. This is just a copy of the original for now, so, please, do not review the analysis implementation.

96a2e78 and cbfdaf9 should be part of the first commit. Will squash there when upstreaming.

Parametrize `Allocation::run` to support more runnning more allocation
analyses, thus making the allocation analysis framework more easily
extensible.

`ModuleAllocation` instances are now obtained from a templated `get`
static member function to propagate the analysis kind to use.

Signed-off-by: victor-eds <[email protected]>
@victor-eds victor-eds requested review from a team, chengjunlu and etiotto October 31, 2024 16:53
@victor-eds victor-eds self-assigned this Oct 31, 2024
Comment on lines -253 to +263
explicit ModuleAllocation(ModuleOp moduleOp)
: CallGraph<Allocation>(moduleOp) {
walk<WalkOrder::PreOrder, WalkOrder::PostOrder>(
template <typename AllocationAnalysis = triton::AllocationAnalysis>
static ModuleAllocation get(ModuleOp moduleOp) {
ModuleAllocation res(moduleOp);
res.walk<WalkOrder::PreOrder, WalkOrder::PostOrder>(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Cannot have templated constructors like this, so this is a static member function now.

…ysis`

This is just a copy of `mlir::triton::AllocationAnalysis` for now.

Signed-off-by: victor-eds <[email protected]>
@victor-eds victor-eds force-pushed the specialize-allocation-analysis branch from d3fe27b to 68bf33c Compare October 31, 2024 16:54
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do not review analysis implementation. This is a copy of Allocation.cpp.

@chengjunlu
Copy link
Contributor

Does this PR solves the issue about the allocation #2340

@victor-eds
Copy link
Contributor Author

Does this PR solves the issue about the allocation #2340

This is a first PR refactoring the code so we can modify freely and fix issues like that one and the ones I'm finding with my current FA work

@vlad-penkin vlad-penkin linked an issue Nov 1, 2024 that may be closed by this pull request
@victor-eds
Copy link
Contributor Author

Allocation.cpp is just a copy for now. No need to review. Rest is ready to upstream.

@victor-eds victor-eds marked this pull request as draft November 5, 2024 08:46
@victor-eds victor-eds marked this pull request as ready for review November 6, 2024 14:01
@victor-eds
Copy link
Contributor Author

Just rebased and solved conflicts. Enabling auto-merge.

@victor-eds victor-eds enabled auto-merge (squash) November 6, 2024 14:02
@victor-eds victor-eds merged commit 6e6cff9 into intel:main Nov 6, 2024
4 checks passed
victor-eds added a commit to victor-eds/intel-xpu-backend-for-triton that referenced this pull request Nov 26, 2024
intel#2605
introduced allocation analysis specialization downstream, but
upstreaming lead to a different approach
(triton-lang/triton#5070).

This commit reverts residual changes to the analysis matching upstream's
triton-lang/triton@deee78f.

Signed-off-by: victor-eds <[email protected]>
etiotto pushed a commit that referenced this pull request Nov 26, 2024
#2605
introduced allocation analysis specialization downstream, but
upstreaming lead to a different approach
(triton-lang/triton#5070).

This commit reverts residual changes to the analysis matching upstream's
triton-lang/triton@deee78f.

Closes #2825.

Signed-off-by: victor-eds <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support running different allocation analyses

4 participants