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

[Task] More descriptive kernel names for nsys/ncu #315

Merged
merged 1 commit into from
Jul 16, 2023
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 6 additions & 1 deletion python/hidet/ir/schedulers/cpu/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,12 @@ def schedule_grid_compute(self, node: GridCompute, tensor_map: Dict[TensorNode,

params, param_map, call_args = self.grid_compute_params_and_args(node, tensor_map)

with FunctionBuilder(name=f'compute_{node.name}', kind='cpu_kernel') as fb:
if self.task is not None:
name = f'{self.task.name}_compute_{node.name}'
else:
name = f'compute_{node.name}'

with FunctionBuilder(name=name, kind='cpu_kernel') as fb:
Comment on lines +29 to +34
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When the auto scheduler is scheduling a task, the self.task will be the task that is scheduling, thus we do not need to add the if here.

# set function parameters
fb.extend_params(params)

Expand Down
9 changes: 6 additions & 3 deletions python/hidet/ir/schedulers/cuda/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,12 @@ def schedule_grid_compute(self, node: GridCompute, tensor_map: Dict[TensorNode,
block_dim = 512
grid_dim: Expr = (prod(node.shape) + block_dim - 1) // block_dim

with FunctionBuilder(
name=f'compute_{node.name}', kind='cuda_kernel', grid_dim=grid_dim, block_dim=block_dim
) as fb:
if self.task is not None:
name = f'{self.task.name}_compute_{node.name}'
else:
name = f'compute_{node.name}'

with FunctionBuilder(name=name, kind='cuda_kernel', grid_dim=grid_dim, block_dim=block_dim) as fb:
# set function parameters
fb.extend_params(params)

Expand Down