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

fix: Ensure proper type inheritance in aten::masked_fill #1430

Merged
merged 2 commits into from
Nov 2, 2022

Conversation

gs-olive
Copy link
Collaborator

@gs-olive gs-olive commented Nov 1, 2022

Description

Fix a bug in aten::masked_fill.Scalar(Tensor self, Tensor mask, Scalar value) -> (Tensor) where differing types in self and value cause an error at model compilation time. Improved type handling and inheritance behavior, and add regression tests to catch the bug.

  • Ensure value input inherits type from self, avoiding a bug where mismatched types cause TRT Select to throw an error
  • Test type-mismatched inputs (regression tests) to ensure type-casting is handled correctly

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.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

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 made corresponding changes to the documentation
  • [ 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

- Ensure `value` input inherits type from `self`, avoiding a bug where
mismatched types cause TRT `Select` to throw an error
- Test type-mismatched inputs (regression tests) to ensure type-casting
is handled correctly
@github-actions github-actions bot added component: conversion Issues re: Conversion stage component: converters Issues re: Specific op converters component: core Issues re: The core compiler component: tests Issues re: Tests labels Nov 1, 2022
@gs-olive gs-olive added the release: v1.3 Tagged to be included in v1.3 label Nov 1, 2022
@gs-olive gs-olive self-assigned this Nov 1, 2022
Copy link
Collaborator

@narendasan narendasan left a comment

Choose a reason for hiding this comment

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

LGTM

@narendasan narendasan merged commit b1db33a into pytorch:master Nov 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla signed component: conversion Issues re: Conversion stage component: converters Issues re: Specific op converters component: core Issues re: The core compiler component: tests Issues re: Tests release: v1.3 Tagged to be included in v1.3
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants