tqchen commented on code in PR #14394:
URL: https://github.com/apache/tvm/pull/14394#discussion_r1192626426
##########
include/tvm/relax/expr.h:
##########
@@ -985,6 +985,11 @@ constexpr const char* kComposite = "Composite";
constexpr const char* kPartitionedFromPattern = "PartitionedFromPattern";
/*! \brief The required workspace for an external function. */
constexpr const char* kWorkspaceSize = "WorkspaceSize";
+/*! \brief Indicate whether the function is pure (has no visible side effects
for any input). */
+constexpr const char* kIsPure = "IsPure";
+/*! \brief Indicate whether the function should be considered pure even if it
contains
+ * an impure call. */
+constexpr const char* kForcePure = "ForcePure";
Review Comment:
One minor nit: we now hav two kinds of patterns for attribute name
- stl_style: `global_symbol`, `tir.noalias`
- CamelStyle: as in this case.
Would be great for us to consolidate a bit to a single style. Some of the
CameStyle were inherited from relay. To be consistent with some of the more
frequently used annotation (like global symbol)
##########
include/tvm/relax/expr.h:
##########
@@ -985,6 +985,11 @@ constexpr const char* kComposite = "Composite";
constexpr const char* kPartitionedFromPattern = "PartitionedFromPattern";
/*! \brief The required workspace for an external function. */
constexpr const char* kWorkspaceSize = "WorkspaceSize";
+/*! \brief Indicate whether the function is pure (has no visible side effects
for any input). */
+constexpr const char* kIsPure = "IsPure";
Review Comment:
my understanding is that is_pure is more like an annotation of the function,
like ret_struct_info, it might make sense to make it directly as an attribution
of the function (`Optional<Bool> purity_annotation`). Can be done as a followup
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]