caten/aasm
caten/aasm
UnaryOps
:CAST
The node :CAST casts the first read tensor into :dtype
, writing the result into the first write.
When optimizing cast in-place, the 0th read is consumed.
superclasses = UNARYOPS
, JITABLE
,
:NOT
The node :NOT computes the logical-not of the given tensor if the input is a boolean, otherwise (integer) computes a bitwise-not.
When optimizing not in-place, the 0th read is consumed.
superclasses = UNARYOPS
, JITABLE
,
:SQRT
The node :SQRT computes square-root of the first read tensor, writing the result to the first write.
When optimizing sqrt in-place, the 0th read is consumed.
superclasses = UNARYOPS
, JITABLE
,
:LOG2
The node :LOG2 computes log2
of the first read tensor, writing the result to the first write.
When optimizing log2 in-place, the 0th read is consumed.
superclasses = UNARYOPS
, JITABLE
,
:EXP2
The node :EXP2 computes exp2
of the first read tensor, writing the result to the first write.
When optimizing exp2 in-place, the 0th read is consumed.
superclasses = UNARYOPS
, JITABLE
,
:SIN
The node :SIN computes sine of the first read tensor, writing the result to the first write.
When optimizing sin in-place, the 0th read is consumed.
superclasses = UNARYOPS
, JITABLE
,
:RECIP
The node :RECIP computes the reciprocal of the first read tensor, writing the result to the first write.
When optimizing recip in-place, the 0th read is consumed.
superclasses = UNARYOPS
, JITABLE
,
:NEG
The node :NEG flips the sign of the first read tensor, writing the result to the first write.
When optimizing neg in-place, the 0th read is consumed.
superclasses = UNARYOPS
, JITABLE
,
BinaryOps
:GCD
Computes the greatest common divisor of two integer tensors in read, writing the result to the first write.
(Note: This computation should only applied to scalar tensors, and used for only computing the dynamic shaped tensor indexing.)
When optimizing gcd in-place, the 0th read is consumed.
superclasses = BINARYOPS
, JITABLE
,
:MAX
Computes the maximum value of two tensors in read, writing the result to the first write.
When optimizing max in-place, the 0th read is consumed.superclasses = BINARYOPS
, JITABLE
,
:MOVE
Moves the second read into the first read, setting the result to first write.
- _jit_dont_render_me[boolean] (TODO)When optimizing move in-place, the 0th read is consumed.
superclasses = BINARYOPS
, JITABLE
,
:XOR
The node :XOR computes the bit-wise xor of two tensors in read
if they are integer, otherwise (boolean) computes the logical-xor.
superclasses = BINARYOPS
, JITABLE
,
:OR
The node :OR computes the bit-wise or of two tensors in read
if they are integer, otherwise (boolean) computes the logical-or.
superclasses = BINARYOPS
, JITABLE
,
:AND
The node :AND computes the bit-wise and of two tensors in read
if they are integer, otherwise (boolean) computes the logical-and.
superclasses = BINARYOPS
, JITABLE
,
:IDIV
The node :IDIV divides the first tensor in read
by the second tensor in read
, writing the result to the first write
.
Unlike other BinaryOps, :IDIV assumes two tensors to be an integer typed tensor.
superclasses = BINARYOPS
, JITABLE
,
:MUL
The node :MUL multiplies the two tensors in read
and writes the result to the first write
.
superclasses = BINARYOPS
, JITABLE
,
:ADD
The node :ADD adds the two tensors in read
and writes the result to the first write
.
superclasses = BINARYOPS
, JITABLE
,
TernaryOps
:WMMA
The node :WMMA is generated during optimization (simplifiers.lisp) by AJIT and represents a fused computation of :ADD and :MUL. WMMA is not generated during VM execution.
WMMA is used to optimize the gemm computation:
WMMA(c, a, b) is the equivalent to:
c += a * b (if reduction = t)
out = c + a * b (if reduction = nil)
superclasses = TERNARYOPS
, JITABLE
,
:WHERE
If the result of the first read (boolean) is true, the second read is selected, and if false, the third read is selected and written to the first write. When optimizing in-place, note that the value of the second read is used as a placeholder since choosing the first read would result in a data type mismatch with write.
When optimizing where in-place, the 1th read is consumed.
superclasses = TERNARYOPS
, JITABLE
,
:<
Compares the second and third tensors in read with <
, writing the result to the first write. The first read tensor is an placeholder for the first write tensor and is always boolean.
When optimizing < in-place, the 0th read is consumed.
superclasses = TERNARYOPS
, JITABLE
,
:!=
Compares the second and third tensors in read with not-equal
, writing the result to the first write. The first read tensor is an placeholder for the first write tensor and is always boolean.
When optimizing != in-place, the 0th read is consumed.
superclasses = TERNARYOPS
, JITABLE
,
Buffer
:VIEW
Creates a view object of the tensor in a first read.
View object
can modify the multi-dimensional offset of tensors, strides, shapes, and strides without copying.
[upfrom, below)
. by indicates the step of stride. the out tensor is reinitialized with shape-new
and stride-new.
View has an attribute
broadcast[list]`, this indicates the stride of thecorresponding axis is recognised as 0 if set to T.
- nrank[(unsigned-byte 32)] the rank of viewed tensor.
- broadcast[list] broadcasting order.
- permute[list] is an optional parameter and does nothing in VM, but requires to apply Polyhedral Compiler. If the view was created in
caten/apis:!permute
, set the argument to this attribute.
When optimizing view in-place, the 0th read is consumed.
superclasses = BUFFEROPS
, JITABLE
,
:STORE
Just like a :MOVE, moves the second tensor in read into the first tensor in read, writing the result to the first write. (Note: :STORE can be removed in the future refactoring)
When optimizing store in-place, the 0th read is consumed.
superclasses = BUFFEROPS
, BINARYOPS
, JITABLE
,
:LOAD
Fills the first tensor in read
with value
, writing the result into the first write. The first read can be either of tensor or scalar.
- value[symbol or number] initial value.
When optimizing load in-place, the 0th read is consumed.
superclasses = BUFFEROPS
, JITABLE
,
:ALLOCATE
Allocates a new matrix of scalar value in the VM.
:Allocate is defined as described above. The first through nrank
-th read scalar tensors represent the size of the Tensor, and from the nrank
-th read to the last, they represent the stride of the allocated Tensor. (they can be sliced using subseq
)
- dtype[dtype-t] dtype to allocate.
- nrank[(unsigned-byte 32)] a rank of tensor. If set to 0, allocates a scalar.
- from[symbol or buffer or null] If specified, instead of allocating, an already allocated Buffer is used. If a symbol is specified, a buffer is already defined in the variable table of AVM. If buffer is specified, use the buffer directly.
When optimizing allocate in-place, the 0th read is consumed.
superclasses = BUFFEROPS
, JITABLE
,
Indexing
:INDEX-COMPONENTS
The node :INDEX-COMPONENTS Indicates which element-wise computation of the Tensor is being performed. Typically, it should return the argument used when performing Aref on the Tensor with the corresponding strides
.
When optimizing index-components in-place, the 0th read is consumed.
superclasses = INDEXING
, JITABLE
,
JIT Specific Ops
:JIT_KERNEL
The node :JIT_KERNEL is an instruction that calls a jit-compiled kernel from the VM. When optimizing jit_kernel in-place, the 0th read is consumed.
:EXPR
The node :EXPR is a data structure used by the JIT compiler, representing a node that fuses multiple composable nodes. The list of composable nodes is defined in op/expr
in ajit/renderer.lisp.
- Expr[Caten/AJIT:EXPR] a tree structure comprised of
CATEN/AJIT:EXPR
. Each node are comprised ofop/expr
. - reduction[boolean]
When optimizing expr in-place, the 0th read is consumed.
superclasses = JITABLE
,