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

Chlo decompose patterns #1984

Merged
merged 9 commits into from
Feb 7, 2024

Conversation

linuxlonelyeagle
Copy link
Contributor

I had added Chlo conversion to Stablehlo pass, and Canonicalize @GleasonK .

@linuxlonelyeagle
Copy link
Contributor Author

Here's some more trivia, should I fix them?

/my_stablehlo/stablehlo/transforms/StablehloCanonicalize.cpp:45:13: warning: comparison of integers of different signs: 'std::tuple_element<0, std::tuple<unsigned long, const long long &>>::type' (aka '__type_pack_element<0UL, unsigned long, const long long &>') and 'const long long' [-Wsign-compare]
    if (idx != value) {
        ~~~ ^  ~~~~~
/my_stablehlo/stablehlo/transforms/StablehloCanonicalize.cpp:692:53: warning: comparison of integers of different signs: 'size_t' (aka 'unsigned long') and 'int64_t' (aka 'long long') [-Wsign-compare]
        op.getKnownNonexpandingDimensions()->size() != resultType.getRank()) {
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~~~~~~~
/my_stablehlo/stablehlo/transforms/StablehloCanonicalize.cpp:53:13: warning: unused function 'isIotaRange' [-Wunused-function]
static bool isIotaRange(ElementsAttr attr) {

Copy link
Member

@GleasonK GleasonK left a comment

Choose a reason for hiding this comment

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

Thanks for upstreaming these passes!! 🚀

Minor feedback on file renaming / pass naming, and lets split off the canonicalize pass to a separate PR and give it a simple test point to make sure its working, keep this PR specific to CHLO decomposition. I can add more tests once these are submitted.

stablehlo/transforms/CHLODecompositionPatterns.td Outdated Show resolved Hide resolved
stablehlo/transforms/Passes.td Outdated Show resolved Hide resolved
stablehlo/transforms/Passes.td Outdated Show resolved Hide resolved
@GleasonK
Copy link
Member

GleasonK commented Feb 5, 2024

Here's some more trivia, should I fix them?

/my_stablehlo/stablehlo/transforms/StablehloCanonicalize.cpp:45:13: warning: comparison of integers of different signs: 'std::tuple_element<0, std::tuple<unsigned long, const long long &>>::type' (aka '__type_pack_element<0UL, unsigned long, const long long &>') and 'const long long' [-Wsign-compare]
    if (idx != value) {
        ~~~ ^  ~~~~~
/my_stablehlo/stablehlo/transforms/StablehloCanonicalize.cpp:692:53: warning: comparison of integers of different signs: 'size_t' (aka 'unsigned long') and 'int64_t' (aka 'long long') [-Wsign-compare]
        op.getKnownNonexpandingDimensions()->size() != resultType.getRank()) {
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~~~~~~~
/my_stablehlo/stablehlo/transforms/StablehloCanonicalize.cpp:53:13: warning: unused function 'isIotaRange' [-Wunused-function]
static bool isIotaRange(ElementsAttr attr) {

As mentioned above, lets split canonicalize to a separate PR. Then yes, it would be great to fix these if they're simple.

@GleasonK
Copy link
Member

GleasonK commented Feb 6, 2024

Looks like we need to address those compilation warnings you mentioned to get CI working. If you can get CMakeBuild working, I'll send you a patch to make the Bazel CI work. Holding off on sending that patch until existing feedback is addressed / CMake is working to avoid any merge conflicts.

@linuxlonelyeagle
Copy link
Contributor Author

Looks like we need to address those compilation warnings you mentioned to get CI working. If you can get CMakeBuild working, I'll send you a patch to make the Bazel CI work. Holding off on sending that patch until existing feedback is addressed / CMake is working to avoid any merge conflicts.

ok,It may be a little late to address this problem,I read the error reported by ci and I know what the problem is.

BUILD.bazel Outdated Show resolved Hide resolved
Copy link
Member

@GleasonK GleasonK left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks again for doing this! I'll add some extra test cases and might so some additional refactoring as I start trying to integrate this pass elsewhere. In the near future I plan to migrate the CHLO->MHLO pass to use CHLO->StableHLO->MHLO, this PR was an important first step. 🚀

@GleasonK GleasonK merged commit c85cefd into openxla:main Feb 7, 2024
10 checks passed
@linuxlonelyeagle
Copy link
Contributor Author

LGTM! Thanks again for doing this! I'll add some extra test cases and might so some additional refactoring as I start trying to integrate this pass elsewhere. In the near future I plan to migrate the CHLO->MHLO pass to use CHLO->StableHLO->MHLO, this PR was an important first step. 🚀

I appreciate everything you do. I hope to continue working together in the future 😉.

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