Skip to content

Commit

Permalink
Merge pull request bytedance#125 from bytedance/jzs/dev
Browse files Browse the repository at this point in the history
use instance = 1 when group_size = 1 for host2device / device2host ops.
  • Loading branch information
suisiyuan authored Dec 12, 2024
2 parents dac895c + fd7df9d commit 0f74e53
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions byte_micro_perf/core/perf_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,8 @@ def start_engine(self) -> None:
output_dir.mkdir(parents=True, exist_ok=True)


op_name = self.workload["operator"]

# get input shape info
target_group_list = self.workload.get("group", [1])
target_group_list.sort()
Expand Down Expand Up @@ -304,6 +306,8 @@ def signal_handler(signum, frame):

# get actual instance num
instance_num = min(device_count, max(1, self.args.parallel)) if group == 1 else group
if group == 1 and op_name in ["host2device", "device2host"]:
instance_num = 1

input_queues = mp.Queue()
output_queues = mp.Queue(maxsize=1)
Expand Down

0 comments on commit 0f74e53

Please sign in to comment.