Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AIE NFC] Postpipeliner cleanups and refactorings #253

Open
wants to merge 9 commits into
base: aie-public
Choose a base branch
from

Conversation

martien-de-jong
Copy link
Collaborator

Small logging improvements
Facility to rerun a strategy an arbitrary number of times
Push earliest with 'local' resource conflicts

static cl::opt<int> PostPipelinerMaxTryII(
"aie-postpipeliner-maxtry-ii", cl::init(10),
cl::desc("[AIE] Maximum II steps to be tried in the post-ra pipeliner"));

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Rationale: It is difficult to give a useful absolute value. for small ResMII we will be trying way beyond usefulness, for larger ResMII it may not be enough. A relative amount works better.

@@ -600,6 +604,7 @@ SchedulingStage InterBlockScheduling::updateScheduling(BlockState &BS) {
auto &PostSWP = BS.getPostSWP();
if (PostSWP.canAccept(*BS.TheBlock)) {
BS.FixPoint.II = PostSWP.getResMII(*BS.TheBlock);
BS.FixPoint.IITries = 1;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This also simplifies using a solver only on the first few tries

@@ -139,9 +161,10 @@ class PostPipeliner {
int FirstUnscheduled = 0;
int LastUnscheduled = -1;

/// Holds the cycle of each SUnit. The following should hold:
/// Holds the schuling information for each instruction. The following
Copy link
Collaborator

Choose a reason for hiding this comment

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

schuling -> scheduling

public:
std::vector<NodeInfo> Nodes;
int NInstr;
int MaxEarliest = 0;
Copy link
Collaborator

Choose a reason for hiding this comment

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

It would be nice to have some comments on these fields, for future reference.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Check: those fields are not used now. Are they related to a new feature?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ScheduleInfo is passed to the strategies. These values are computed as a service to implementors of new strategies.

# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#
# (c) Copyright 2024 Advanced Micro Devices, Inc. or its affiliates
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: 2025.

#
# (c) Copyright 2024 Advanced Micro Devices, Inc. or its affiliates

# RUN: llc --mtriple=aie2 -O2 --start-before=postmisched %s \
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we have a description of what does feasibleRA means here? I can see that we have some conf2d_bf16 so it is interesting to also see how this one differs from the others.

@andcarminati
Copy link
Collaborator

Hi @martien-de-jong, this set of changes looks good! I just left some comments for clarification!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants