yr.FunctionGroupOptions

yr.FunctionGroupOptions#

class yr.FunctionGroupOptions(cpu: int | None = None, memory: int | None = None, resources: ~typing.Dict[str, float] = <factory>, scheduling_affinity_type: ~yr.config.SchedulingAffinityType | None = None, scheduling_affinity_each_bundle_size: int | None = None, timeout: int | None = None, concurrency: int | None = None, recover_retry_times: int = 0)[source]#

Bases: object

Function group options.

Attributes

concurrency

Instance concurrency, limited to the range [1, 1000].

cpu

Required CPU size in millicores (m), limited to the range [300, 16000].

memory

Required memory size in MB, limited to the range [128, 65536].

recover_retry_times

Number of recovery retry attempts, used when instance recovery fails.Default is 0.

scheduling_affinity_each_bundle_size

The number of function instances within each bundle.

scheduling_affinity_type

The affinity type of instances within the bundle, Default is None.

timeout

Timeout in seconds, valid values are -1 or within [0, 0x7FFFFFFF].

resources

Custom resources, currently supports "NPU/XX/YY", where XX is the card model such as Ascend910B4, and YY can be count, latency, or stream.

Methods