-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
[Lang] Matrix/Vector refactor: support basic matrix ops #6077
Conversation
✅ Deploy Preview for docsite-preview ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Shall we add tests for the modifications?
- Why both
UnaryOp
andBinaryOp
are modified in codegen, but onlyBinaryOp
is modified in frontend_ir? - Shall we have
is_real_scalar()
,is_real_tensor()
, and a generalis_real()
so that we don't have to useis_real() || is_real_tensor()
everywhere?
Co-authored-by: Yi Xu <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can probably separate out the codegen
part, and add some c++ tests to test the type promotion and broadcasting.
Some examples can be found in: tests/cpp/ir/ir_type_promotion_test.cpp
and tests/cpp/ir/frontend_type_inference_test.cpp
|
Co-authored-by: Yi Xu <[email protected]>
for more information, see https://pre-commit.ci
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In codegen_llvm.cpp
, for those LLVM operations that supports both Primitive and TensorType operands, let's simplify the condition from sth like is_real_tensor(stmt->ret_type) || is_real(ret_type)
to is_real(ret_type.get_element_type())
, so it's agnostic of whether it's TensorType or not.
for more information, see https://pre-commit.ci
Related issue = #5478
Refactored & Combined PR: #5797 and #5861
A part of PR #5551