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

Fix maxpool2d signature + add emitc conversion&test #2385

Merged
merged 3 commits into from
Mar 7, 2025

Conversation

svuckovicTT
Copy link
Contributor

Ticket

#2328

Problem description

Maxpool2d is not supported thru emitc.

What's changed

  • Changed MaxPool2d signature in TTNN dialect to match signature of lib.
  • Added conversion TTNN->EmitC
  • Added test

Checklist

  • New/Existing tests provide coverage for changes

@@ -1246,16 +1246,31 @@ class MaxPool2dOpConversionPattern
outputType.getElementType(),
outputType.getEncoding());

DenseI32ArrayAttr kernelSizeAttr = rewriter.getDenseI32ArrayAttr(
{static_cast<int32_t>(adaptor.getKernelHeight()),
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't all of these already be int32_t?

std::array{op->dilation_height(), op->dilation_width()},
outputMemoryConfig, std::nullopt);
op->channels(), kernelSize, stride, padding, dilation, std::nullopt,
std::nullopt, op->ceil_mode());
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: add parameter names for std::nullopt.

Copy link
Contributor

@sdjordjevicTT sdjordjevicTT left a comment

Choose a reason for hiding this comment

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

Great!

@svuckovicTT svuckovicTT linked an issue Mar 7, 2025 that may be closed by this pull request
@svuckovicTT
Copy link
Contributor Author

@jnie-TT @kmabeeTT @AleksKnezevic leaving for a week-long vacation today, would be great if I could check this in before that, need your approval for the runtime/lib/ttnn/operations/pool/maxpool2d.cpp file 🙏

Copy link
Contributor

@kmabeeTT kmabeeTT left a comment

Choose a reason for hiding this comment

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

Runtime looks good to my eyes, have a good time off!

@svuckovicTT svuckovicTT merged commit 69604bd into main Mar 7, 2025
33 checks passed
@svuckovicTT svuckovicTT deleted the svuckovic/maxpool-emitc-3 branch March 7, 2025 13:37
odjuricicTT pushed a commit that referenced this pull request Mar 8, 2025
### Ticket
#2328 

### Problem description
Maxpool2d is not supported thru emitc.

### What's changed
- Changed MaxPool2d signature in TTNN dialect to match signature of lib.
- Added conversion TTNN->EmitC
- Added test

### Checklist
- [x] New/Existing tests provide coverage for changes
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.

[EmitC] MaxPool2d op conversion to EmitC
5 participants