Welcome to TT-NN documentation!
- What is ttnn?
- Getting Started
- Install
-
Using ttnn
-
Basic Examples
- 1. Converting from and to torch tensor
- 2. Running an operation on the device
- 3. Using __getitem__ to slice the tensor
- 4. Enabling program cache
- 5. Debugging intermediate tensors
- 6. Tracing the graph of operations
- 7. Using tt_lib operation in ttnn
- 8. Enabling Logging
- 9. Supported Python Operators
- 10. Changing the string representation of the tensor
- 11. Visualize using Web Browser
- 12. Register pre- and/or post-operation hooks
- 13. Query all operations
- 14. Falling back to torch
- 15. Capturing graph of C++ functions, buffer allocations, etc
-
Basic Examples
- Tensor
-
APIs
- Device
- Memory Config
-
Operations
- Core
- Tensor Creation
- Matrix Multiplication
-
Pointwise Unary
- ttnn.abs
- ttnn.acos
- ttnn.acosh
- ttnn.asin
- ttnn.asinh
- ttnn.atan
- ttnn.atanh
- ttnn.bitwise_not
- ttnn.bitwise_left_shift
- ttnn.bitwise_right_shift
- ttnn.cbrt
- ttnn.ceil
- ttnn.celu
- ttnn.clamp
- ttnn.clip
- ttnn.clone
- ttnn.cos
- ttnn.cosh
- ttnn.deg2rad
- ttnn.digamma
- ttnn.experimental.dropout
- ttnn.elu
- ttnn.eqz
- ttnn.erf
- ttnn.erfc
- ttnn.erfinv
- ttnn.exp
- ttnn.exp2
- ttnn.expm1
- ttnn.fill
- ttnn.floor
- ttnn.frac
- ttnn.geglu
- ttnn.gelu
- ttnn.glu
- ttnn.gez
- ttnn.gtz
- ttnn.hardshrink
- ttnn.hardsigmoid
- ttnn.hardswish
- ttnn.hardtanh
- ttnn.heaviside
- ttnn.i0
- ttnn.identity
- ttnn.isfinite
- ttnn.isinf
- ttnn.isnan
- ttnn.isneginf
- ttnn.isposinf
- ttnn.leaky_relu
- ttnn.lez
- ttnn.lgamma
- ttnn.log
- ttnn.log10
- ttnn.log1p
- ttnn.log2
- ttnn.log_sigmoid
- ttnn.logical_not
- ttnn.logical_not_
- ttnn.logit
- ttnn.ltz
- ttnn.mish
- ttnn.multigammaln
- ttnn.neg
- ttnn.nez
- ttnn.normalize_global
- ttnn.normalize_hw
- ttnn.polygamma
- ttnn.prelu
- ttnn.rad2deg
- ttnn.rdiv
- ttnn.reciprocal
- ttnn.reglu
- ttnn.relu
- ttnn.relu_max
- ttnn.relu_min
- ttnn.relu6
- ttnn.remainder
- ttnn.round
- ttnn.rsqrt
- ttnn.selu
- ttnn.sigmoid
- ttnn.sigmoid_accurate
- ttnn.sign
- ttnn.signbit
- ttnn.silu
- ttnn.sin
- ttnn.sinh
- ttnn.softmax
- ttnn.softplus
- ttnn.softshrink
- ttnn.softsign
- ttnn.sqrt
- ttnn.square
- ttnn.swiglu
- ttnn.swish
- ttnn.tan
- ttnn.tanh
- ttnn.tanhshrink
- ttnn.threshold
- ttnn.tril
- ttnn.triu
- ttnn.trunc
- ttnn.unary_chain
- ttnn.clamp_bw
- ttnn.clip_bw
- ttnn.hardtanh_bw
- ttnn.threshold_bw
- ttnn.softplus_bw
- ttnn.rdiv_bw
- ttnn.pow_bw
- ttnn.exp_bw
- ttnn.tanh_bw
- ttnn.sqrt_bw
- ttnn.multigammaln_bw
- ttnn.lgamma_bw
- ttnn.fill_bw
- ttnn.hardsigmoid_bw
- ttnn.cos_bw
- ttnn.acosh_bw
- ttnn.acos_bw
- ttnn.atan_bw
- ttnn.rad2deg_bw
- ttnn.frac_bw
- ttnn.trunc_bw
- ttnn.log_sigmoid_bw
- ttnn.fill_zero_bw
- ttnn.i0_bw
- ttnn.tan_bw
- ttnn.sigmoid_bw
- ttnn.rsqrt_bw
- ttnn.neg_bw
- ttnn.relu_bw
- ttnn.logit_bw
- ttnn.hardshrink_bw
- ttnn.softshrink_bw
- ttnn.leaky_relu_bw
- ttnn.elu_bw
- ttnn.celu_bw
- ttnn.rpow_bw
- ttnn.floor_bw
- ttnn.round_bw
- ttnn.log_bw
- ttnn.relu6_bw
- ttnn.abs_bw
- ttnn.silu_bw
- ttnn.selu_bw
- ttnn.square_bw
- ttnn.prod_bw
- ttnn.hardswish_bw
- ttnn.tanhshrink_bw
- ttnn.atanh_bw
- ttnn.asin_bw
- ttnn.asinh_bw
- ttnn.sin_bw
- ttnn.sinh_bw
- ttnn.log10_bw
- ttnn.log1p_bw
- ttnn.erfc_bw
- ttnn.ceil_bw
- ttnn.softsign_bw
- ttnn.cosh_bw
- ttnn.logiteps_bw
- ttnn.log2_bw
- ttnn.sign_bw
- ttnn.div_no_nan_bw
- ttnn.exp2_bw
- ttnn.expm1_bw
- ttnn.reciprocal_bw
- ttnn.digamma_bw
- ttnn.erfinv_bw
- ttnn.erf_bw
- ttnn.deg2rad_bw
- ttnn.polygamma_bw
- ttnn.gelu_bw
- ttnn.repeat_bw
- ttnn.real
- ttnn.imag
- ttnn.angle
- ttnn.is_imag
- ttnn.is_real
- ttnn.polar_bw
- ttnn.imag_bw
- ttnn.real_bw
- ttnn.angle_bw
- ttnn.conj_bw
- ttnn.conj
- ttnn.polar
-
Pointwise Binary
- ttnn.add
- ttnn.addalpha
- ttnn.subalpha
- ttnn.multiply
- ttnn.subtract
- ttnn.div
- ttnn.div_no_nan
- ttnn.floor_div
- ttnn.remainder
- ttnn.fmod
- ttnn.gcd
- ttnn.lcm
- ttnn.logical_and_
- ttnn.logical_or_
- ttnn.logical_xor_
- ttnn.rpow
- ttnn.rsub
- ttnn.ldexp
- ttnn.logical_and
- ttnn.logical_or
- ttnn.logical_xor
- ttnn.bitwise_and
- ttnn.bitwise_or
- ttnn.bitwise_xor
- ttnn.logaddexp
- ttnn.logaddexp2
- ttnn.hypot
- ttnn.xlogy
- ttnn.squared_difference
- ttnn.gt
- ttnn.gt_
- ttnn.lt_
- ttnn.ge_
- ttnn.le_
- ttnn.eq_
- ttnn.ne_
- ttnn.ge
- ttnn.lt
- ttnn.le
- ttnn.eq
- ttnn.ne
- ttnn.isclose
- ttnn.nextafter
- ttnn.maximum
- ttnn.minimum
- ttnn.outer
- ttnn.pow
- ttnn.polyval
- ttnn.scatter
- ttnn.atan2
- ttnn.add_bw
- ttnn.assign_bw
- ttnn.atan2_bw
- ttnn.bias_gelu_bw
- ttnn.div_bw
- ttnn.embedding_bw
- ttnn.fmod_bw
- ttnn.remainder_bw
- ttnn.addalpha_bw
- ttnn.subalpha_bw
- ttnn.xlogy_bw
- ttnn.hypot_bw
- ttnn.ldexp_bw
- ttnn.logaddexp_bw
- ttnn.logaddexp2_bw
- ttnn.mul_bw
- ttnn.sub_bw
- ttnn.squared_difference_bw
- ttnn.concat_bw
- ttnn.rsub_bw
- ttnn.min_bw
- ttnn.max_bw
- Pointwise Ternary
- Losses
- Reduction
- Data Movement
- Normalization
- Moreh Operations
- Transformer
- CCL
- Embedding
- Pooling
- Vision
- KV Cache
- Model Conversion
- Reports
- Operation Hooks
-
Tutorials
-
Tensor and Add Operation
-
Tensor and Add Operation
- Creating a tensor
- Host Storage: Borrowed vs Owned
- Data Type
- Layout
- Device storage
- Open the device
- Initialize tensors a and b with random values using torch
- Add tensor a and b
- Inspect the output tensor of the add in ttnn
- Convert to torch and inspect the attributes of the torch tensor
- Close the device
-
Tensor and Add Operation
- Matmul Operation
-
Multi-Head Attention
-
Multi-Head Attention
- Enable program cache
- Write Multi-Head Attention using ttnn
- Configuration
- Initialize activations and weights using torch
- Convert activations and weights to ttnn
- Run the first iteration of Multi-Head Attention
- Run a subsequent iteration of Multi-Head Attention
- Write optimized version of Multi-Head Attention
- Pre-process the parameters of the optimized model
- Run the first iteration of the optimized Multi-Head Attention
- Run a subsequent iteration of the optimized Multi-Head Attention
- Check that the output of the optimized version matches the output of the original implementation
- Close the device
-
Multi-Head Attention
- ttnn Tracer
- ttnn Profiling
- Resnet Basic Block
- Graphing Torch DiT_XL_2 With TTNN
-
Tensor and Add Operation
- Onboarding New Functionality
- Converting torch Model to ttnn
- Adding New ttnn Operation
- Profiling ttnn Operations
-
Dependencies
-
TT-LIB
- Overview
-
TT-LIB API through
tt_lib
-
Fallback Operations
full()
tensor_slice()
reshape()
chunk()
conv2d()
group_norm()
layer_norm()
pad()
interpolate()
repeat()
repeat_interleave()
concat()
silu()
softmax()
Conv2d
BatchNorm2d
GroupNorm
LayerNorm
MaxPool2d
AdaptiveAvgPool2d
ceil
floor
trunc
unary_fmod
binary_fmod
bitwise_not
unary_bitwise_or
unary_bitwise_and
unary_bitwise_xor
binary_bitwise_or
binary_bitwise_and
binary_bitwise_xor
unary_bitwise_left_shift
unary_bitwise_right_shift
binary_bitwise_left_shift
binary_bitwise_right_shift
torch_argmax
torch_argmin
- Experimental Operations
- Tensor
- Examples of Tensor and TT-LIB Use
-
TT-LIB
- Building and Uplifting Demos