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

Support 2D inner reduction scheduler with autotuning #3456

Merged
merged 7 commits into from
Dec 11, 2024

Conversation

rdspring1
Copy link
Collaborator

Summary:

This PR creates an SOL autotuning script for the 2d inner reduction scheduler. It trains a random forest to predict the best performing configuration for the reduction scheduler.

Inner Reduction Fusions:

  1. Sum --- y = sum(x, dim=-1)
  2. Add Sum --- z = sum(x1 + x2 + x3 + x4, dim=-1)
  3. Tanh Sum --- y = sum(tanh(x), dim=-1)
  4. Exp Sum --- z = sum(exp(x), dim=-1)

@rdspring1 rdspring1 added the Autotune Generate heuristics through machine learning models. label Nov 20, 2024
@rdspring1 rdspring1 force-pushed the autotune_inner_reduction_2d branch from c79d982 to de10254 Compare November 20, 2024 20:17
@rdspring1 rdspring1 changed the title Support 2d inner reduction scheduler with autotuning Support 2D inner reduction scheduler with autotuning Nov 21, 2024
@rdspring1 rdspring1 force-pushed the autotune_inner_reduction_2d branch 4 times, most recently from 31c216c to a466e32 Compare November 24, 2024 19:40
@rdspring1 rdspring1 changed the base branch from main to autotune_pointwise_single November 24, 2024 19:45
@rdspring1 rdspring1 force-pushed the autotune_inner_reduction_2d branch from 4a31a07 to 7eeebe1 Compare November 24, 2024 19:51
Copy link
Collaborator

@liqiangxl liqiangxl left a comment

Choose a reason for hiding this comment

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

LGTM. Similar to pointwise, recomment to use variables instead of instant numbers which provides a more clear interface to the user.

@rdspring1 rdspring1 force-pushed the autotune_pointwise_single branch from 0849e1b to 1c78f7d Compare November 27, 2024 00:50
@rdspring1 rdspring1 force-pushed the autotune_inner_reduction_2d branch from 7eeebe1 to 7817368 Compare November 27, 2024 01:10
@rdspring1
Copy link
Collaborator Author

!build

Copy link
Collaborator

@liqiangxl liqiangxl left a comment

Choose a reason for hiding this comment

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

LGTM.

Support Gelu-Bias, Silu-Mul, Bcast-Add, Mul Fusions
@rdspring1 rdspring1 force-pushed the autotune_pointwise_single branch from 1c78f7d to 45b74f6 Compare December 1, 2024 17:29
@rdspring1 rdspring1 force-pushed the autotune_inner_reduction_2d branch from 7817368 to e7ffb29 Compare December 1, 2024 17:30
@rdspring1
Copy link
Collaborator Author

!build

# SPDX-FileCopyrightText: Copyright (c) 2024-present NVIDIA CORPORATION & AFFILIATES.
# All rights reserved.
# SPDX-License-Identifier: BSD-3-Clause
# Owner(s): ["module: nvfuser"]
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm curious: I noticed this # Owner(s): ["module: nvfuser"] line in other python files in our repo. Is this a standard and is it used by some tool?

@rdspring1 rdspring1 changed the base branch from autotune_pointwise_single to main December 10, 2024 03:18
@rdspring1 rdspring1 changed the base branch from main to autotune_pointwise December 10, 2024 21:13
@rdspring1 rdspring1 changed the base branch from autotune_pointwise to autotune_pointwise_single December 10, 2024 21:14
Base automatically changed from autotune_pointwise_single to main December 11, 2024 16:39
@rdspring1
Copy link
Collaborator Author

!build

@rdspring1 rdspring1 merged commit 1b29928 into main Dec 11, 2024
17 checks passed
@rdspring1 rdspring1 deleted the autotune_inner_reduction_2d branch December 11, 2024 19:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Autotune Generate heuristics through machine learning models.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants