mbs-octoml commented on a change in pull request #9693:
URL: https://github.com/apache/tvm/pull/9693#discussion_r767969790
##########
File path: include/tvm/relay/attrs/on_device.h
##########
@@ -54,44 +54,48 @@ namespace relay {
* multiply(device_copy(add(%x, %y), src_se_scope=GPU, dst_se_scope=CPU), %z)
* \endcode
*
- * The Relay call
- * \code
- * on_device(sub_expr, se_scope=S, is_fixed=True)
- * \endcode
- * is similar to the above, however the annotation itself must appear in an
expression on the
- * same \p SEScope \p S. The compiler will check the \p SEScopes are
consistent, and will not
- * insert any "device_copy" call. This form of annotation shouldn't be
necessary in user programs.
- * However it is needed by the \p PlanDevices pass to fully specify the
results of device planning
- * so that the pass is idempotent.
- *
- * E.g.: The following program is equivalent to the above:
- * \code
- * let %a = on_device(add(%x, %y), se_scope=GPU, is_fixed=True)
- * multiply(device_copy(%a, src_se_scope=GPU, dst_se_scope=CPU), %z)
- * \endcode
- * The "on_device" annotation with \p is_fixed=True indicates unambiguously
that \p %a is stored
- * on the GPU.
+ * The \p constraint_body (default true) and \p constraint_result (default
false) fields can be
+ * used by passes for finer-grained control over how the \p SEScope constraint
should be applied.
*/
struct OnDeviceAttrs : public tvm::AttrsNode<OnDeviceAttrs> {
/*!
- * \brief (Virtual) \p SEScope on which the result of the argument
expression should be stored.
+ * \brief The \p SEScope to constraint to apply to the body, result, or both
body and result
+ * of the "on_device" call.
*/
SEScope se_scope = SEScope::FullyUnconstrained();
+
+ /*!
+ * \brief If fales (the default), the result of the "on_device" call is not
constrained to be
Review comment:
[Addressing in sequel #9613]
Done.
--
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]