Skip to content

Connect isSymmetric kernel to DaphneDSL#962

Merged
pdamme merged 2 commits intodaphne-project:mainfrom
gghsu:959-connect-isSymmetric-kernel
May 5, 2025
Merged

Connect isSymmetric kernel to DaphneDSL#962
pdamme merged 2 commits intodaphne-project:mainfrom
gghsu:959-connect-isSymmetric-kernel

Conversation

@gghsu
Copy link
Copy Markdown
Contributor

@gghsu gghsu commented May 3, 2025

This pull request addressed Issue #959 by connecting isSymmetric-kernel to DaphneDSL.

To achieve this, I did following modification:

  1. Add instantiated/precompiled for relevant combinations of data types (e.g., DenseMatrix and CSRMatrix) and value types (e.g., double and int64_t) in src/runtime/local/kernels.json
  2. Add a DaphneIR operation IsSymmetricOp in src/ir/daphneir/DaphneOps.td
  3. Add a DaphneDSL built-in function isSymmetric that generates an IsSymmetricOp in the IR in src/parser/daphnedsl/DaphneDSLBuiltins.cpp.
  4. Add script-level test cases for the new DaphneDSL built-in function in test/api/cli/operations/isSymmetric_1.daphne.
    image
  5. Add Boolean value in ValueTypeCode Enum.

Though it builds successfully and passes all the testcase, there is a warning as below which happens in build process. I think it might due to the new boolean output type, however, I'm not sure how to fix it at this time.
image

@pdamme pdamme self-requested a review May 5, 2025 15:11
- Fixed failing code style CI check by formatting DaphneDSLBuiltins.cpp.
- Added the new DaphneDSL built-in function isSymmetric() to the user documentation.
- Undid unnecessary changes regarding ValueTypeCode BOOL in ValueTypeCode.h and DaphneInferTypesOpInterface.cpp.
- Moved definition of IsSymmetricOp in DaphneOps.td near the other meta-data/property-related ops (NumColsOp, TypeOfOp, etc.).
- And some more minor things.
Copy link
Copy Markdown
Collaborator

@pdamme pdamme 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 this contribution, @gghsu! It's great to finally connect the isSymmetric-kernel to DaphneDSL to offer it to users. Your code looks good to me.

I only applied some minor improvements, e.g., formatted the code to make the CI code style checks pass, added the new built-in function to the user documentation, and moved the definition of IsSymmetricOp in DaphneOps.td close to the other meta-data-related ops. Furthermore, your changes related to the ValueTypeCode BOOL were not strictly required for this PR, so I undid them. See the commit I added for details. Nevertheless, these are just minor editorial changes; overall, you did very good work!


Congrats on your first contribution to DAPHNE! It would be great to see more PRs from you in the future :) .

@pdamme pdamme merged commit 2bd07ae into daphne-project:main May 5, 2025
3 checks passed
@pdamme
Copy link
Copy Markdown
Collaborator

pdamme commented May 5, 2025

Though it builds successfully and passes all the testcase, there is a warning as below which happens in build process. I think it might due to the new boolean output type, however, I'm not sure how to fix it at this time.

This warning is from inside the ANTLR library. We should fix that at some point (maybe by upgrading to a newer version of ANTLR), but that's not related to this PR :) .

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