[Refactor] Modify the binding logic, added memory migration and interrupt core binding functions. (#6785)
[Refactor] Modify the binding logic, added memory migration and interrupt core binding functions. ### What this PR does / why we need it? Controls the use of memory on a closer NUMA node to achieve a lower memory access latency, while binding interrupts to different CPU cores to prevent them form interrupting the inference process. ### Does this PR introduce _any_ user-facing change? No ### How was this patch tested?b8eaaa073bSigned-off-by: rowzwel_dx <1392851715@qq.com> Signed-off-by: Rozwel-dx <1392851715@qq.com> - vLLM version: v0.15.0 - vLLM main:9562912ceaSigned-off-by: Rozwel-dx <1392851715@qq.com>
This commit is contained in:
@@ -162,11 +162,11 @@ class TestCpuAlloc(unittest.TestCase):
|
||||
@patch('vllm_ascend.cpu_binding.execute_command')
|
||||
def test_allocate(self, mock_execute_command):
|
||||
self.cpu_alloc.device_info.running_npu_list = [0]
|
||||
self.cpu_alloc.npu_cpu_pool = {0: [0, 1, 2]}
|
||||
self.cpu_alloc.npu_cpu_pool = {0: [0, 1, 2, 3, 4]}
|
||||
self.cpu_alloc.allocate()
|
||||
self.assertEqual(self.cpu_alloc.assign_main[0], [0])
|
||||
self.assertEqual(self.cpu_alloc.assign_acl[0], [1])
|
||||
self.assertEqual(self.cpu_alloc.assign_rel[0], [2])
|
||||
self.assertEqual(self.cpu_alloc.assign_main[0], [2])
|
||||
self.assertEqual(self.cpu_alloc.assign_acl[0], [3])
|
||||
self.assertEqual(self.cpu_alloc.assign_rel[0], [4])
|
||||
self.cpu_alloc.npu_cpu_pool = {0: [0, 1]}
|
||||
with self.assertRaises(RuntimeError):
|
||||
self.cpu_alloc.allocate()
|
||||
|
||||
Reference in New Issue
Block a user