Skip to content

Conversation

@titaiwangms
Copy link
Contributor

@titaiwangms titaiwangms commented Feb 15, 2023

Create a bool overload for bitwise_not and fix an incorrect cast in maskd_fill

Discovered when running bloom export.

def aten_masked_fill(self: TTensor, mask: BOOL, value: TTensor) -> TTensor:
# masked_fill.Tensor(Tensor self, Tensor mask, Tensor value) -> Tensor
mask_cast = op.Cast(mask, to=BOOL.dtype)
value_cast = op.CastLike(value, self)
Copy link
Collaborator

Choose a reason for hiding this comment

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

maybe add a note along this line?

# NOTE: Do not attempt to cast `mask` to BOOL because mask should not take any other types.
# `mask` coming in as other types is often an error and should fail the model.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@justinchuby justinchuby changed the title bloom needed minor changes on Ops fix(atenlib): bitwisenot and mask_fill Feb 15, 2023
@justinchuby justinchuby changed the title fix(atenlib): bitwisenot and mask_fill fix(atenlib): bitwise_not and maskd_fill Feb 15, 2023
@justinchuby justinchuby added the module: torchlib Related to the torch/aten function lib in development label Feb 15, 2023
@codecov
Copy link

codecov bot commented Feb 15, 2023

Codecov Report

Merging #442 (e351070) into main (a7dde7b) will decrease coverage by 0.01%.
The diff coverage is 92.30%.

@@            Coverage Diff             @@
##             main     #442      +/-   ##
==========================================
- Coverage   71.27%   71.27%   -0.01%     
==========================================
  Files         108      108              
  Lines       10475    10478       +3     
  Branches     1085     1086       +1     
==========================================
+ Hits         7466     7468       +2     
- Misses       2699     2700       +1     
  Partials      310      310              
Impacted Files Coverage Δ
onnxscript/function_libs/torch_aten/ops/core.py 67.41% <75.00%> (-0.03%) ⬇️
onnxscript/evaluator.py 85.96% <100.00%> (+0.25%) ⬆️
...xscript/function_libs/torch_aten/graph_building.py 68.66% <100.00%> (-0.40%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@justinchuby justinchuby merged commit 0298154 into microsoft:main Feb 15, 2023
@titaiwangms titaiwangms deleted the titaiwang/bitwisenot_and_maskfill branch February 15, 2023 22:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

module: torchlib Related to the torch/aten function lib in development

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants