Skip to content

[ONNX] Update support of exporting bool type index mask#32445

Closed
BowenBao wants to merge 2 commits intopytorch:masterfrom
BowenBao:bool_index
Closed

[ONNX] Update support of exporting bool type index mask#32445
BowenBao wants to merge 2 commits intopytorch:masterfrom
BowenBao:bool_index

Conversation

@BowenBao
Copy link
Collaborator

e.g. tensor[torch.tensor([0, 1, 0], dtype=torch.bool)]
Previously the mask is of type uint8. Both uint8 and bool should be supported for export.

@kostmo
Copy link
Member

kostmo commented Jan 21, 2020

💊 CircleCI build failures summary and remediations

As of commit e115835:

  • 1/1 failures introduced in this PR

Detailed failure analysis

One may explore the probable reasons each build failed interactively on the Dr. CI website.

🕵️ 1 new failure recognized by patterns

The following build failures do not appear to be due to upstream breakage:

See CircleCI build pytorch_xla_linux_xenial_py3_6_clang7_build (1/1)

Step: "Build" (full log | pattern match details)

Jan 23 18:27:26 RuntimeError: Failed to apply patch: /var/lib/jenkins/workspace/xla/torch_patches/X10-device_test.diff
Jan 23 18:27:26 File to patch:  
Jan 23 18:27:26 Skip this patch? [y]  
Jan 23 18:27:26 4 out of 4 hunks ignored 
Jan 23 18:27:26 Applying patch file: /var/lib/jenkins/workspace/xla/torch_patches/X10-clip_grad.diff 
Jan 23 18:27:26 Applying patch file: /var/lib/jenkins/workspace/xla/torch_patches/X10-device_test.diff 
Jan 23 18:27:26 Traceback (most recent call last): 
Jan 23 18:27:26   File "/var/lib/jenkins/workspace/xla/scripts/cond_patch.py", line 67, in <module> 
Jan 23 18:27:26     patch_repo(args) 
Jan 23 18:27:26   File "/var/lib/jenkins/workspace/xla/scripts/cond_patch.py", line 49, in patch_repo 
Jan 23 18:27:26     raise RuntimeError('Failed to apply patch: {}'.format(ppath)) 
Jan 23 18:27:26 RuntimeError: Failed to apply patch: /var/lib/jenkins/workspace/xla/torch_patches/X10-device_test.diff 
Jan 23 18:27:26 + cleanup 
Jan 23 18:27:26 + retcode=1 
Jan 23 18:27:26 + set +x 
Jan 23 18:27:26 =================== sccache compilation log =================== 
Jan 23 18:27:26 =========== If your build fails, please take a look at the log above for possible reasons =========== 
Jan 23 18:27:26 Compile requests                 1 
Jan 23 18:27:26 Compile requests executed        0 
Jan 23 18:27:26 Cache hits                       0 
Jan 23 18:27:26 Cache misses                     0 
Jan 23 18:27:26 Cache timeouts                   0 

This comment was automatically generated by Dr. CI (expand for details).Follow this link to opt-out of these comments for your Pull Requests.

Please report bugs/suggestions on the GitHub issue tracker.

This comment has been revised 4 times.

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

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

@houseroad has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@yf225 yf225 added module: onnx Related to torch.onnx triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module labels Jan 29, 2020
@neginraoof
Copy link
Contributor

LGTM! Thanks.

Copy link
Member

@houseroad houseroad left a comment

Choose a reason for hiding this comment

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

LGTM


def try_mask_to_index(index):
if not sym_help._is_none(index) and index.type().scalarType() == "Byte":
if not sym_help._is_none(index) and (index.type().scalarType() == "Byte" or index.type().scalarType() == "Bool"):
Copy link
Member

Choose a reason for hiding this comment

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

nit: create a helper function is_mask_type()

@facebook-github-bot
Copy link
Contributor

@houseroad merged this pull request in 1c42b94.

BowenBao added a commit to BowenBao/pytorch that referenced this pull request Feb 12, 2020
Summary:
e.g. `tensor[torch.tensor([0, 1, 0], dtype=torch.bool)]`
Previously the mask is of type uint8. Both uint8 and bool should be supported for export.
Pull Request resolved: pytorch#32445

Reviewed By: hl475

Differential Revision: D19610713

Pulled By: houseroad

fbshipit-source-id: 8df636e0c3cb0b82919a689242a962c79220209c
ttumiel pushed a commit to ttumiel/pytorch that referenced this pull request Mar 4, 2020
Summary:
e.g. `tensor[torch.tensor([0, 1, 0], dtype=torch.bool)]`
Previously the mask is of type uint8. Both uint8 and bool should be supported for export.
Pull Request resolved: pytorch#32445

Reviewed By: hl475

Differential Revision: D19610713

Pulled By: houseroad

fbshipit-source-id: 8df636e0c3cb0b82919a689242a962c79220209c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Merged module: onnx Related to torch.onnx open source triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants