MatmulOptions#
-
class nvmath.
linalg. MatmulOptions(advanced. - compute_type: int | None = None,
- scale_type: int | None = None,
- sm_count_target: int | None = 0,
- fast_accumulation: bool | None = False,
- device_id: int | None = None,
- handle: int | None = None,
- logger: Logger | None = None,
- memory_limit: int | str | None = '80%',
- blocking: Literal[True, 'auto'] = 'auto',
- allocator: BaseCUDAMemoryManager | None = None,
用于为
Matmul
对象和包装函数matmul()
提供选项的数据类。- compute_type#
CUDA 计算类型。一个合适的计算类型
- 类型:
nvmath.
linalg. ComputeType
- will be selected if not specified.
- scale_type#
CUDA 数据类型。如果未指定,将选择与计算类型相符的合适数据类型。
- 类型:
nvmath.
CudaDataType
- logger#
Python Logger 对象。如果未提供 Logger 对象,将使用根 Logger。
- 类型:
- memory_limit#
MM 操作可用的最大内存。可以指定为值(带有可选后缀,如 K[iB]、M[iB]、G[iB])或百分比。默认值为设备内存的 80%。
- blocking#
一个标志,用于指定执行函数和方法的行为,例如
matmul()
和Matmul.execute()
。当blocking
为True
时,执行方法在操作完成之前不会返回。当blocking
为"auto"
时,如果输入在 GPU 上,则方法立即返回。当操作数在 CPU 上时,执行方法始终会阻塞,以确保用户不会在结果可用之前意外地使用它。默认值为"auto"
。- 类型:
Literal[True, ‘auto’]
- allocator#
一个支持
BaseCUDAMemoryManager
协议的对象,用于分配设备内存。如果未提供分配器,将使用来自库包的内存分配器(对于 PyTorch 操作数,使用torch.cuda.caching_allocator_alloc()
,否则使用cupy.cuda.alloc()
)。- 类型: