-
Notifications
You must be signed in to change notification settings - Fork 25
Add Lowering for conv2d and conv2d_transpose to ttir::ConvolutionOp #3043
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
base: main
Are you sure you want to change the base?
Conversation
|
Testing it is required. I could not test it since i lost the koyeb access |
forge/test/mlir/test_ops_tf.py
Outdated
| ( | ||
| (1, 16, 64, 56, 56, 4, 4, 1, 1), # Flipped output/input channels | ||
| (1, 64, 64, 56, 56, 3, 3, 1, 1), | ||
| (1, 128, 128, 28, 28, 3, 3, 2, 2), # Stride > 1 |
Check failure
Code scanning / flake8
at least two spaces before inline comment Error test
forge/test/mlir/test_ops_tf.py
Outdated
| (1, 64, 64, 56, 56, 3, 3, 1, 1), | ||
| (1, 128, 128, 28, 28, 3, 3, 2, 2), # Stride > 1 | ||
| (1, 128, 128, 14, 14, 3, 3, 1, 1), | ||
| (1, 256, 256, 14, 14, 3, 3, 2, 2), # Stride > 1 |
Check failure
Code scanning / flake8
at least two spaces before inline comment Error test
forge/test/mlir/test_ops_tf.py
Outdated
| (1, 64, 64, 8, 8, 3, 3, 1, 1), | ||
| (1, 64, 64, 16, 16, 3, 3, 1, 1), | ||
| (1, 256, 256, 7, 7, 3, 3, 1, 1), | ||
| (1, 64, 256, 28, 28, 1, 1, 2, 2), # Flipped output/input channels, Stride > 1 |
Check failure
Code scanning / flake8
at least two spaces before inline comment Error test
forge/test/mlir/test_ops_tf.py
Outdated
| def __init__(self): | ||
| super().__init__() | ||
| self.conv2d_transpose = tf.keras.layers.Conv2DTranspose( | ||
| output_channels, # `filters` argument specifies output channels |
Check failure
Code scanning / flake8
at least two spaces before inline comment Error test
|
|
||
| compiled_model = forge.compile(framework_model, sample_inputs=inputs) | ||
|
|
||
| verify(inputs, framework_model, compiled_model) |
Check warning
Code scanning / flake8
no newline at end of file Warning test
Thanks for the contribution @rafey1104! Before our initial review, @marty1885, can we help @rafey1104 with his instance to test out the changes first? |
|
Sure! @rafey1104 can you send an message to |
Add Lowering for conv2d and conv2d_transpose to ttir::ConvolutionOp
Ticket
Fix : 596
Problem description
Lower TTForge
conv2dandconv2d_transposeops to the new, unifiedttir::ConvolutionOp.What's changed
emit_mlir_ttforge_convolution_opfor loweringconv2dandconv2d_transpose.lowering_handler_mapto use the new handler for both convolution op types.AttributeMapperto remapgroups->feature_groups_countandstride->window_strides.ConvolutionLayoutAttrassuming a channel-last (NHWC) layout.ttir.nonewhen no bias is present.is_transposeattribute inttir::ConvolutionOpbased on the source op.test_conv2d_transposeto validate the new lowering path.