MCPcopy Create free account
hub / github.com/MeshInfra/WaferLLM / assignId

Function assignId

MeshGEMM/host_common.py:26–61  ·  view source on GitHub ↗
(pc, P)

Source from the content-addressed store, hash-verified

24
25
26def assignId(pc, P):
27 send_id = 0
28 recv_id = 0
29
30 pc = pc + 1
31
32 if pc % 2 == 0:
33 send_id = pc - 2
34 recv_id = pc + 2
35 else:
36 send_id = pc + 2
37 recv_id = pc - 2
38
39 if pc == 1:
40 send_id = 3
41 recv_id = 2
42
43 if pc == 2:
44 send_id = 1
45 recv_id = min(recv_id, P)
46
47 if P % 2 == 0:
48 if pc == P - 1:
49 send_id = P
50 recv_id = P - 3
51 if pc == P:
52 send_id = P - 2
53 recv_id = P - 1
54 else:
55 if pc == P - 1:
56 send_id = max(send_id, 1)
57 recv_id = P
58 if pc == P:
59 send_id = P - 1
60 recv_id = P - 2
61 return send_id - 1, recv_id - 1
62
63
64def make_inputs(P, M, K, N):

Callers 1

make_inputsFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected