triton.Config
- class triton.Config(kwargs, num_warps=4, num_stages=3, num_ctas=1, maxnreg=None, pre_hook=None, ir_override=None)
An object that represents a possible kernel configuration for the auto-tuner to try.
- 变量:
kwargs -- a dictionary of meta-parameters to pass to the kernel as keyword arguments.
num_warps -- the number of warps to use for the kernel when compiled for GPUs. For example, if num_warps=8, then each kernel instance will be automatically parallelized to cooperatively execute using 8 * 32 = 256 threads.
num_stages -- the number of stages that the compiler should use when software-pipelining loops. Mostly useful for matrix multiplication workloads on SM80+ GPUs.
num_ctas -- number of blocks in a block cluster. SM90+ only.
maxnreg -- maximum number of registers one thread can use. Corresponds to ptx .maxnreg directive. Not supported on all platforms.
pre_hook -- a function that will be called before the kernel is called. Parameters of this function are args.
ir_override -- filename of a user-defined IR (*.{ttgir|llir|ptx|amdgcn}).
Example
''' class triton.Config(self, kwargs, num_warps, num_stages, num_ctas, maxnreg, pre_hook) '''
Special Restrictions
num_stages: 适用于 SM80+ GPU 的软件流水线阶段数,Ascend 平台不适用num_ctas: 块集群特性仅适用于 SM90+ GPU,Ascend 平台不适用maxnreg: 对应 PTX .maxnreg 指令,非所有平台支持,Ascend 平台无效
- __init__(kwargs, num_warps=4, num_stages=3, num_ctas=1, maxnreg=None, pre_hook=None, ir_override=None)
Methods
__init__(kwargs[, num_warps, num_stages, ...])all_kwargs()