24 #ifndef TVM_TOPI_CUDA_SOFTMAX_H_
25 #define TVM_TOPI_CUDA_SOFTMAX_H_
62 if (tag ==
"softmax_output") {
63 expsum =
softmax->op->InputTensors()[1];
65 max_elem = s[
exp]->op->InputTensors()[1];
67 }
else if (tag ==
"log_softmax_output") {
68 max_elem =
softmax->op->InputTensors()[1];
69 expsum =
softmax->op->InputTensors()[2];
71 LOG(ERROR) <<
"Tag is expected to be softmax_output or log_softmax_output. Got " << tag;
86 s[expsum].split(k, num_thread, &ko, &ki);
87 auto EF = s.rfactor(expsum, ki)[0];
91 s[expsum].set_store_predicate(thread_x->var == 0);
Range container
Definition: expr.h:725
Managed reference class to TargetNode.
Definition: target.h:200
Array, container representing a contiguous sequence of ObjectRefs.
Definition: array.h:289
void push_back(const T &item)
push a new item to the back of the list
Definition: array.h:457
const ObjectType * as() const
Try to downcast the internal Object to a raw pointer of a corresponding type.
Definition: object.h:910
Array< IterVar > axis
IterVar on each axis.
Definition: operation.h:207
Array< IterVar > reduce_axis
IterVar on each reduction axis, if the body is a Reduce.
Definition: operation.h:209
A Compute op that compute a tensor on certain domain.
Definition: operation.h:226
Global schedule container For operations and all the operations they depend on. The schedule per Oper...
Definition: schedule.h:326
Tensor structure representing a possible input, or intermediate computation result.
Definition: tensor.h:102
Iteration Variable, represents an iteration over an integer interval.
Definition: var.h:315
Generic function that can be specialzied on a per target basis.
Tensor expression language DSL.
Definition: extracted_task.h:33
Schedule create_schedule(Array< Operation > ops)
Create a schedule for array of ops(and their dependencies).
Definition: schedule.h:702
IterVar thread_axis(Range dom, std::string tag)
Create a new IterVar that represents an axis in thread.
IterVar reduce_axis(Range dom, std::string name="rv")
Create a new IterVar for reduction operations.
Tensor softmax(const Tensor &x, int axis=-1, std::string name="tensor", std::string tag="softmax_output")
Softmax activation.
Definition: softmax.h:50
Schedule schedule_softmax(const Target &target, const Array< Tensor > &outs)
Create a rocm schedule for the given softmax output tensors.
Definition: softmax.h:48
Tensor exp(const Tensor &x, std::string name="T_" "exp", std::string tag=kElementWise)
Definition: elemwise.h:50
runtime implementation for LibTorch/TorchScript.
Definition: analyzer.h:36
Operation node can generate one or multiple Tensors.
Collection of Schedule pass functions.