You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, Taichi doesn't have frontend type check. All type related stuff are not handled until Taichi kernels are turned into CHI IRs. This causes the following issues:
Type error messages are not readable. It is very hard for users to distinguish between a user error and a compiler internal error, as they always see a bunch of purple stuff. Even for an experienced user, in some cases it is almost impossible to figure out the connections between the reported CHI IR-level errors and the original Taichi kernels.
It is not possible to support local variable definition requiring type inference. For example, we may want a local array with only initial values (which may or may not be constants) provided.
To solve these issues, I hope to make Taichi support frontend type check.
Describe the solution you'd like (if any)
Add ret_type (return type) member variable and type_check member function for the Expression class (which represents frontend expressions) in Taichi core, and call type_check when a Python-side Expr is constructed. Note that the type inference/check rules need to be consistent with the type_check pass of CHI IR. Our goal is to infer all frontend types and report all type errors at this stage, and the type_check pass of CHI IR should only serve the compiler itself.
Progress:
ArgLoadExpression
RandExpression
UnaryOpExpression
BinaryOpExpression
TernaryOpExpression
InternalFuncCallExpression
ExternalFuncCallExpression
ExternalTensorExpression
GlobalVariableExpression
GlobalPtrExpression
TensorElementExpression
EvalExpression
RangeAssumptionExpression
LoopUniqueExpression
IdExpression
AtomicOpExpression
SNodeOpExpression
LocalLoadExpression
GlobalLoadExpression
ConstExpression
ExternalTensorShapeAlongAxisExpression
FuncCallExpression
The text was updated successfully, but these errors were encountered:
Concisely describe the proposed feature
Currently, Taichi doesn't have frontend type check. All type related stuff are not handled until Taichi kernels are turned into CHI IRs. This causes the following issues:
To solve these issues, I hope to make Taichi support frontend type check.
Describe the solution you'd like (if any)
Add
ret_type
(return type) member variable andtype_check
member function for theExpression
class (which represents frontend expressions) in Taichi core, and calltype_check
when a Python-sideExpr
is constructed. Note that the type inference/check rules need to be consistent with thetype_check
pass of CHI IR. Our goal is to infer all frontend types and report all type errors at this stage, and thetype_check
pass of CHI IR should only serve the compiler itself.Progress:
EvalExpressionThe text was updated successfully, but these errors were encountered: