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

[MLIR][Torch] Add TorchToLinalg lowering for AtenAvgPool3dOp #3030

Merged
merged 3 commits into from
Jun 4, 2024

Conversation

vivekkhandelwal1
Copy link
Collaborator

This commit also fixes the average pool op' test failing for OnnxToLinalg lowering.

Signed-Off By: Vivek Khandelwal [email protected]

@AmosLewis
Copy link
Collaborator

You will need this commit to
[ONNX] Fix padding attributes for onnx.AveragePool eb3b62f

@AmosLewis
Copy link
Collaborator

Could you also test with model nod-ai/SHARK-TestSuite#185 in shark-testsuites with --torchtolinag flag before iree bump:
python ./run.py --torchmlirbuild ../../torch-mlir/build --tolerance 0.001 0.001 --cachedir ./huggingface_cache --ireebuild ../../iree-build -f onnx -g models --mode onnx --report --tests onnx/models/VideoResNet_vaiq_int8 --torchtolinalg

@vivekkhandelwal1
Copy link
Collaborator Author

Could you also test with model nod-ai/SHARK-TestSuite#185 in shark-testsuites with --torchtolinag flag before iree bump: python ./run.py --torchmlirbuild ../../torch-mlir/build --tolerance 0.001 0.001 --cachedir ./huggingface_cache --ireebuild ../../iree-build -f onnx -g models --mode onnx --report --tests onnx/models/VideoResNet_vaiq_int8 --torchtolinalg

It fails during iree-compile with failure for 3d conv but passed for torch-mlir.

@vivekkhandelwal1
Copy link
Collaborator Author

You will need this commit to [ONNX] Fix padding attributes for onnx.AveragePool eb3b62f

We can do this in a seperate PR, since the current PR doesn't make any change in the Onnx implementation. Or, you can create a PR with your commit for the same.

@vivekkhandelwal1
Copy link
Collaborator Author

vivekkhandelwal1 commented May 16, 2024

Could you also test with model nod-ai/SHARK-TestSuite#185 in shark-testsuites with --torchtolinag flag before iree bump: python ./run.py --torchmlirbuild ../../torch-mlir/build --tolerance 0.001 0.001 --cachedir ./huggingface_cache --ireebuild ../../iree-build -f onnx -g models --mode onnx --report --tests onnx/models/VideoResNet_vaiq_int8 --torchtolinalg

I'm getting this:

Status report for run: test-onnx using mode:onnx todtype:default backend:llvm-cpu

| tests                             | model-run   | onnx-import   | torch-mlir   | iree-compile   | inference   |
|:----------------------------------|:------------|:--------------|:-------------|:---------------|:------------|
| onnx/models/VideoResNet_vaiq_int8 | passed      | passed        | passed       | passed         | mismatch    |

lib/Conversion/TorchToLinalg/Pooling.cpp Outdated Show resolved Hide resolved
lib/Conversion/TorchToLinalg/Utils.cpp Outdated Show resolved Hide resolved
@vivekkhandelwal1
Copy link
Collaborator Author

Hi @rsuderman, can you please re-review this PR?

lib/Conversion/TorchToLinalg/Pooling.cpp Outdated Show resolved Hide resolved
lib/Conversion/TorchToLinalg/Pooling.cpp Outdated Show resolved Hide resolved
lib/Conversion/TorchToLinalg/Pooling.cpp Outdated Show resolved Hide resolved
lib/Conversion/TorchToLinalg/Pooling.cpp Show resolved Hide resolved
@vivekkhandelwal1
Copy link
Collaborator Author

Hi @rsuderman, can you please re-review this?

@vivekkhandelwal1 vivekkhandelwal1 force-pushed the fix-avgpool branch 2 times, most recently from b685a32 to c1121a7 Compare May 31, 2024 16:14
This commit also fixes the average pool op' test failing for
OnnxToLinalg lowering.

Signed-Off By: Vivek Khandelwal <[email protected]>
@vivekkhandelwal1
Copy link
Collaborator Author

Hi @rsuderman, can you please re-review this?

Hi @rsuderman, just a gentle reminder to review this PR.

@vivekkhandelwal1 vivekkhandelwal1 merged commit 661be2d into llvm:main Jun 4, 2024
3 checks passed
sjarus pushed a commit to sjarus/torch-mlir that referenced this pull request Jun 6, 2024
This commit also fixes the average pool op' test failing for
OnnxToLinalg lowering.

Signed-Off By: Vivek Khandelwal <[email protected]>
josel-amd pushed a commit to Xilinx/torch-mlir that referenced this pull request Jun 7, 2024
This commit also fixes the average pool op' test failing for
OnnxToLinalg lowering.

Signed-Off By: Vivek Khandelwal <[email protected]>
josel-amd pushed a commit to Xilinx/torch-mlir that referenced this pull request Jun 10, 2024
This commit also fixes the average pool op' test failing for
OnnxToLinalg lowering.

Signed-Off By: Vivek Khandelwal <[email protected]>
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.

3 participants