Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Metal] Reduce number of threads for reduction layers #8206

Merged
merged 1 commit into from
Jun 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion include/tvm/topi/cuda/reduction.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ Schedule ScheduleReduce(const Target& target, Operation op, Schedule sch,
if (out_stage->op.as<ComputeOpNode>()->axis.size() > 0) {
all_reduce = false;
num_thread = 32;
if (target->kind->name == "opencl") {
if (target->kind->name == "opencl" || target->kind->name == "metal") {
// Without this, CL_INVALID_WORK_GROUP_SIZE occurs with python tests.
// Don't know why.
num_thread = 16;
Expand Down
2 changes: 1 addition & 1 deletion python/tvm/topi/cuda/reduction.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def _schedule_reduce(op, sch, is_idx_reduce=False):
all_reduce = False
num_thread = 32
target = tvm.target.Target.current()
if target and target.kind.name == "opencl":
if target and (target.kind.name == "opencl" or target.kind.name == "metal"):
# without it, CL_INVALID_WORK_GROUP_SIZE occurred when running test_topi_reduce.py
# don't know why
num_thread = 16
Expand Down