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

auto offloading in dynamic shape IR #1313

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Conversation

Yancey1989
Copy link
Collaborator

No description provided.

disc_ral::createDiscSpecializeFusionWithSpeculationPass(
gpu_options.sm_count, gpu_options.max_threads_per_sm));
// pm.addNestedPass<FuncOp>(
// disc_ral::createDiscSpecializeFusionWithSpeculationPass(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Any problems with it?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

just easier to analysis buffer living range, will remove this comment.

if (main.getName() == SymbolicDimMgr::getShapeConstraintGraphFunctionName())
return;
mlir::OpBuilder b(main);
const int64_t memoryLimitation = 21474836480; // 30GB
Copy link
Collaborator

Choose a reason for hiding this comment

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

it's 20GB...

}
return result;
}
void SortBuffersByPrioriy(std::vector<LivingBuffer>& livingBuffers) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is it possible to consider buffer size here, even with symbolic shape?

return offloadCond;
}
std::vector<LivingBuffer> FilterBuffers(
std::vector<LivingBuffer> livingBuffers) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: reference ..

<< " expr: " << memoryUsageList[instIndex] << "\n";
return memoryUsageList[instIndex];
}
std::vector<int64_t> ConcretMemoryUsageSimulator(int64_t concretValue) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

What's this function for?

offloadIfOp.getElseRegion().front().clear();
b.setInsertionPointToStart(&offloadIfOp.getElseRegion().front());
auto dummyHostBuffer = cloneBuffer(b, endOp->getLoc(), buffer);
dummyHostBuffer.getDefiningOp()->setAttr(kRematBufferAttr,
Copy link
Collaborator

Choose a reason for hiding this comment

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

will this dummy host buffer cause some unexpected behavior .... if it's used somewhere

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