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

Group norm bug fix #3014

Merged
merged 4 commits into from
Jul 26, 2024
Merged

Group norm bug fix #3014

merged 4 commits into from
Jul 26, 2024

Conversation

cehongwang
Copy link
Collaborator

Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Fixes # (issue)

Type of change

Please delete options that are not relevant and/or add your own.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist:

  • [ x] My code follows the style guidelines of this project (You can use the linters)
  • [ x] I have performed a self-review of my own code
  • [ x] I have commented my code, particularly in hard-to-understand areas and hacks
  • [ x] I have added tests to verify my fix or my feature
  • [ x] New and existing unit tests pass locally with my changes
  • [ x] 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: converters Issues re: Specific op converters component: api [Python] Issues re: Python API component: dynamo Issues relating to the `torch.compile` or `torch._dynamo.export` paths labels Jul 17, 2024
@github-actions github-actions bot requested a review from narendasan July 17, 2024 00:22
@cehongwang cehongwang force-pushed the group-norm-bug-fix branch 2 times, most recently from 5f47fb1 to e8d942f Compare July 17, 2024 19:39
@cehongwang cehongwang self-assigned this Jul 17, 2024
@cehongwang cehongwang force-pushed the group-norm-bug-fix branch 2 times, most recently from 937d342 to 8649c5b Compare July 17, 2024 19:42
@narendasan narendasan requested review from zewenli98 and apbose July 17, 2024 21:48
…omposed ops instead of using INormalization Layer. Supported dynamic shape
@cehongwang cehongwang force-pushed the group-norm-bug-fix branch from 8649c5b to 03aca50 Compare July 17, 2024 23:36
reshaped_input.shape,
)

eps_trt = get_trt_tensor(ctx, eps, f"{name}_eps", np.float32)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why is this converted to np.float32?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It is 1e-6 in most cases.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

float16 cannot handle that close to 0

f"{name}_div",
sub_trt,
sqrt_trt,
)

Copy link
Collaborator

Choose a reason for hiding this comment

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

Wanted to clarify if this div would require any mode, eg: trunc? Are the data types always compatible with the output types?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I don't think so. The previous implementation from Evan did not include any mode.

Copy link
Collaborator

Choose a reason for hiding this comment

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

just FYI: we have impl.elementwise.floor_divide and impl.elementwise.trunc_div helper functions, if needed.

Copy link
Collaborator

@zewenli98 zewenli98 left a comment

Choose a reason for hiding this comment

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

LGTM

@peri044 peri044 merged commit 6ac2ec8 into main Jul 26, 2024
54 of 61 checks passed
@HolyWu HolyWu mentioned this pull request Nov 4, 2024
7 tasks
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: converters Issues re: Specific op converters 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.

5 participants