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

Scheduling revamp #53

Merged
merged 11 commits into from
Jan 17, 2025
Merged

Scheduling revamp #53

merged 11 commits into from
Jan 17, 2025

Conversation

Muxianesty
Copy link
Collaborator

@Muxianesty Muxianesty commented Jan 13, 2025

This Merge Request introduces the following changes:

  • dfcir.latency operation added;
  • New DFCIR operation interfaces to examine them in a generic way;
  • DFCIR operations which can be scheduled now have a latency attribute, which may be present in the text form of corresponding operations IF and ONLY IF they have already been scheduled (e.g. %0 = dfcir.add[2] (...), which means 2 pipeline stages for addition, and %0 = dfcir.add[?] (...) if the operation wasn't scheduled yet);
  • Correct translation pipeline was implemented: DFCxx -> Unscheduled DFCIR -> Scheduled DFCIR -> FIRRTL -> SystemVerilog;
  • DFCIR passes implementation is now more generic;
  • Scheduling configuration files now support external modules (yet their scheduling is not implemented, thus they are ignored for now);
  • Minor changes in the scheduling dataflow graph to reduce copying;
  • HLS mode: --out-scheduled-dfcir <PATH> option was introduced.

Remaining tasks:

  • Add dfcir.const and dfcir.scalarInput recognition in scheduling;
  • Add dfcir.offset deletion after scheduling;
  • Fix existing tests;
  • Fix obsolete documentation in docs/latency_config.md.

@Muxianesty Muxianesty added enhancement New feature or request stage II For issues applicable to Stage II of the project labels Jan 13, 2025
@Muxianesty Muxianesty self-assigned this Jan 13, 2025
@Muxianesty Muxianesty marked this pull request as ready for review January 13, 2025 12:39
@Muxianesty Muxianesty requested a review from ssmolov January 13, 2025 12:40
Comment on lines 202 to 205
if (bool(noQuestion) == bool(noAttr)) {
return parser.emitError(latencyLoc) << "'" << result.name.getStringRef() <<
"' op requires either '?' or valid latency specified";
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Bad indent

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed.

Comment on lines 220 to 225
parser.parseColon() ||
parser.parseCustomTypeWithFallback(firstRawTypes[0]) ||
parser.parseRParen() ||
parser.parseColon() ||
parser.parseCustomTypeWithFallback(resRawTypes[0]) ||
parser.parseOptionalAttrDict(result.attributes)) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Bad indent

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed.

Comment on lines 311 to 314
if (bool(noQuestion) == bool(noAttr)) {
return parser.emitError(latencyLoc) << "'" << result.name.getStringRef() <<
"' op requires either '?' or valid latency specified";
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Bad indent.

Also looks like copy-paste of 197-205 lines

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed indent. Corresponding function instead of copy-paste will be added later in this MR.

Comment on lines 336 to 341
if (parser.parseOperand(secondRawOperands[0]) ||
parser.parseColon() ||
parser.parseCustomTypeWithFallback(secondRawTypes[0]) ||
parser.parseRParen() ||
parser.parseColon() ||
parser.parseCustomTypeWithFallback(resRawTypes[0]) ||
Copy link
Collaborator

Choose a reason for hiding this comment

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

Bad indent.

Also looks similar to complex expression from 219-224 lines. Can we not to copy-paste them?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed indent. Corresponding function instead of copy-paste will be added later in this MR.

//
// Part of the Utopia HLS Project, under the Apache License v2.0
// SPDX-License-Identifier: Apache-2.0
// Copyright 2024 ISP RAS (http://www.ispras.ru)
Copy link
Collaborator

Choose a reason for hiding this comment

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

2024 -> 2025

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed.

Graph::Graph(ModuleOp module)
: Graph(mlir::utils::findFirstOccurence<KernelOp>(module)) {}


Copy link
Collaborator

Choose a reason for hiding this comment

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

extra empty line

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed.

return (isFloat) ? Ops::NEQ_FLOAT : Ops::NEQ_INT;
}

assert(false && "Shouldn't reach this");
Copy link
Collaborator

Choose a reason for hiding this comment

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

Non-informative; can we print useful information about op here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed.

Copy link
Collaborator

@ssmolov ssmolov left a comment

Choose a reason for hiding this comment

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

Agreed to ignore some duplicating code at Tablegen-related components.

@ssmolov ssmolov merged commit c15bf3d into master Jan 17, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request stage II For issues applicable to Stage II of the project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants