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

feat: Support flashinfer.rmsnorm #3424

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

feat: Support flashinfer.rmsnorm #3424

wants to merge 3 commits into from

Conversation

bowang007
Copy link
Collaborator

This PR resolves some issues and support flashinfer.rmsnorm

Checklist:

  • My code follows the style guidelines of this project (You can use the linters)
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas and hacks
  • I have made corresponding changes to the documentation
  • I have added tests to verify my fix or my feature
  • New and existing unit tests pass locally with my changes
  • I have added the relevant labels to my PR in so that relevant reviewers are notified

@github-actions github-actions bot added component: tests Issues re: Tests component: conversion Issues re: Conversion stage component: api [Python] Issues re: Python API component: dynamo Issues relating to the `torch.compile` or `torch._dynamo.export` paths labels Mar 4, 2025
@github-actions github-actions bot requested a review from peri044 March 4, 2025 07:41
github-actions[bot]

This comment was marked as outdated.

@bowang007 bowang007 marked this pull request as draft March 4, 2025 07:41
@bowang007 bowang007 self-assigned this Mar 4, 2025
@bowang007 bowang007 marked this pull request as ready for review March 4, 2025 20:34
@bowang007 bowang007 changed the title test: Support flashinfer.rmsnorm feat: Support flashinfer.rmsnorm Mar 4, 2025
Comment on lines +12 to +16
@torch.library.custom_op("flashinfer::rmsnorm", mutates_args=()) # type: ignore[misc]
def flashinfer_rmsnorm(
input: torch.Tensor, weight: torch.Tensor, eps: float = 1e-6
) -> torch.Tensor:
return flashinfer.norm.rmsnorm(input, weight)
Copy link
Collaborator

Choose a reason for hiding this comment

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

we don't need this registration since you can directly use torch.ops.flashinfer.rmsnorm

Copy link
Collaborator Author

@bowang007 bowang007 Mar 6, 2025

Choose a reason for hiding this comment

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

we don't need this registration since you can directly use torch.ops.flashinfer.rmsnorm

@peri044
Actually, I cannot directly use it since the torch custom op registration is commented out here

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@narendasan
Copy link
Collaborator

@bowang007 Can you move the auto plugin gen tests to a runner other than the one used for converter tests?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla signed component: api [Python] Issues re: Python API component: conversion Issues re: Conversion stage component: dynamo Issues relating to the `torch.compile` or `torch._dynamo.export` paths component: tests Issues re: Tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants