Usage Description
The thread scheduling optimization feature of Kunpeng BoostKit provides two feature switches: batch operator scheduling and thread affinity isolation. You can configure the switches as required.
For details about how to use TF Serving to start the inference pressure test, see Starting the Service and Performing a Pressure Test in the TensorFlow Serving Porting Guide.
Batch Operator Scheduling
TF Serving Command Interface |
--batch_op_scheduling |
||
|---|---|---|---|
Function |
Enables the operator scheduling optimization and XLA thread pool management optimization features. |
||
Parameter Type |
bool |
||
Value Range |
true and false. Set true to enable the feature or false to diable the feature. |
||
Recommended Scenario |
Recommended when single-core inference latency meets requirements, this option enhances concurrent processing capability and overall throughput. |
||
Recommended Configuration |
|
||
Example |
|
Thread Affinity Isolation
TF Serving Command Interface |
--task_affinity_isolation |
||||
|---|---|---|---|---|---|
Function |
Enables the thread affinity isolation feature, which offers two isolation methods.
|
||||
Parameter Type |
std::string |
||||
Parameter Format |
mode;m-n;k. The default value is 0. |
||||
Value Range |
For details, see Table 1. |
||||
Recommended Scenario |
|
||||
Example |
A server has four NUMA nodes, each containing 40 physical cores (160 in total) or 80 logical cores (320 in total) with hyper-threading enabled.
|
Parameter |
Value Range |
Description |
Constraints |
|---|---|---|---|
mode |
0, 1, 2 |
|
When mode is set to 0, the m-n and k are invalid and can be omitted. |
m-n |
Available CPU cores |
The core binding range is [m, n]. |
m ≤ n |
k |
Available CPU cores |
Number of cores allocated to the TensorFlow thread. |
k is no more than the total number of bound cores (n - m + 1). When mode is set to 2, k is invalid and can be omitted. |
numactl is a tool used to control and manage the NUMA architecture on Linux. It can be installed using Yum.
1 | yum install -y numactl numactl-devel |
For example, numactl -C 0-79 -m 0 indicates that the TF Serving service runs on the cores of NUMA node 0, so that CPU resources can be fully utilized. -C and -m specify cores and memory of NUMA node 0, respectively.