Skip to content

Add Op(embedding_bag_padding_idx) | torchlib(feat) #1022

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

Merged
merged 13 commits into from
Aug 29, 2023

Conversation

xiaowuhu
Copy link
Contributor

@xiaowuhu xiaowuhu commented Aug 23, 2023

  1. It works for common test case, say, when offsets value is common like [0,2,3], but something like [0,2,2,4] will be failed. Guess it is due to op.While ‘s bug.
  2. Only care the shape of the last 3 outputs.
  3. Test case not contain 2D indices, wait to see if it is necessary.
  4. Need to disable loop/scan constrain checking

Fixes #1021

@xiaowuhu xiaowuhu marked this pull request as draft August 23, 2023 11:56
@codecov
Copy link

codecov bot commented Aug 23, 2023

Codecov Report

Merging #1022 (affdc13) into main (0c1995d) will increase coverage by 0.13%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #1022      +/-   ##
==========================================
+ Coverage   77.50%   77.63%   +0.13%     
==========================================
  Files         114      114              
  Lines       14335    14423      +88     
  Branches     1525     1543      +18     
==========================================
+ Hits        11110    11198      +88     
  Misses       2859     2859              
  Partials      366      366              
Files Changed Coverage Δ
...bs/tools/torch_lib/deduce_type_constraints_test.py 86.66% <ø> (ø)
...ipt/tests/function_libs/torch_lib/ops_test_data.py 96.00% <ø> (ø)
onnxscript/function_libs/torch_lib/ops/core.py 78.94% <100.00%> (+0.49%) ⬆️
...ript/tests/function_libs/torch_lib/extra_opinfo.py 98.21% <100.00%> (+0.17%) ⬆️

@github-actions
Copy link

github-actions bot commented Aug 23, 2023

Test Results

         18 files  ±  0         18 suites  ±0   1h 19m 16s ⏱️ - 5m 7s
  10 572 tests +  6    7 853 ✔️ +  5      2 715 💤 +  1  3 ±0  1 🔥 ±0 
156 149 runs  +60  36 626 ✔️ +50  119 513 💤 +10  9 ±0  1 🔥 ±0 

For more details on these failures and errors, see this check.

Results for commit affdc13. ± Comparison against base commit 0c1995d.

This pull request removes 129 and adds 135 tests. Note that renamed tests count towards both.
onnxscript.tests.function_libs.torch_lib.ops_test.TestFunctionValidity ‑ test_function_has_op_schema_137_aten_embedding
onnxscript.tests.function_libs.torch_lib.ops_test.TestFunctionValidity ‑ test_function_has_op_schema_138_aten_hardtanh
onnxscript.tests.function_libs.torch_lib.ops_test.TestFunctionValidity ‑ test_function_has_op_schema_139_aten_leaky_relu
onnxscript.tests.function_libs.torch_lib.ops_test.TestFunctionValidity ‑ test_function_has_op_schema_140_aten_log_sigmoid
onnxscript.tests.function_libs.torch_lib.ops_test.TestFunctionValidity ‑ test_function_has_op_schema_141_aten_nll_loss_weight
onnxscript.tests.function_libs.torch_lib.ops_test.TestFunctionValidity ‑ test_function_has_op_schema_142_aten_nll_loss
onnxscript.tests.function_libs.torch_lib.ops_test.TestFunctionValidity ‑ test_function_has_op_schema_143_aten_reflection_pad2d
onnxscript.tests.function_libs.torch_lib.ops_test.TestFunctionValidity ‑ test_function_has_op_schema_144_aten_relu
onnxscript.tests.function_libs.torch_lib.ops_test.TestFunctionValidity ‑ test_function_has_op_schema_145_aten_relu6
onnxscript.tests.function_libs.torch_lib.ops_test.TestFunctionValidity ‑ test_function_has_op_schema_146_aten_replication_pad2d
…
onnxscript.function_libs.tools.torch_lib.deduce_type_constraints_test.TestDeduceTypeConstraints ‑ test_deduce_type_constraints_does_not_crash_for_onnx_function__aten_embedding_bag_1d_padding_idx_onnx
onnxscript.tests.function_libs.torch_lib.ops_test.TestFunctionValidity ‑ test_function_has_op_schema_137_aten_embedding_bag_padding_idx
onnxscript.tests.function_libs.torch_lib.ops_test.TestFunctionValidity ‑ test_function_has_op_schema_138_aten_embedding
onnxscript.tests.function_libs.torch_lib.ops_test.TestFunctionValidity ‑ test_function_has_op_schema_139_aten_hardtanh
onnxscript.tests.function_libs.torch_lib.ops_test.TestFunctionValidity ‑ test_function_has_op_schema_140_aten_leaky_relu
onnxscript.tests.function_libs.torch_lib.ops_test.TestFunctionValidity ‑ test_function_has_op_schema_141_aten_log_sigmoid
onnxscript.tests.function_libs.torch_lib.ops_test.TestFunctionValidity ‑ test_function_has_op_schema_142_aten_nll_loss_weight
onnxscript.tests.function_libs.torch_lib.ops_test.TestFunctionValidity ‑ test_function_has_op_schema_143_aten_nll_loss
onnxscript.tests.function_libs.torch_lib.ops_test.TestFunctionValidity ‑ test_function_has_op_schema_144_aten_reflection_pad2d
onnxscript.tests.function_libs.torch_lib.ops_test.TestFunctionValidity ‑ test_function_has_op_schema_145_aten_relu
…

♻️ This comment has been updated with latest results.

@xiaowuhu xiaowuhu marked this pull request as ready for review August 24, 2023 09:59
@xiaowuhu xiaowuhu marked this pull request as draft August 24, 2023 12:16
@xiaowuhu xiaowuhu changed the title [draft] add Op(embedding_bag_padding_idx) [WIP] add Op(embedding_bag_padding_idx) Aug 24, 2023
@xiaowuhu xiaowuhu marked this pull request as ready for review August 25, 2023 04:25
@xiaowuhu xiaowuhu changed the title [WIP] add Op(embedding_bag_padding_idx) Add Op(embedding_bag_padding_idx) | feat(torchlib) Aug 25, 2023
@xiaowuhu xiaowuhu changed the title Add Op(embedding_bag_padding_idx) | feat(torchlib) Add Op(embedding_bag_padding_idx) | torchlib(feat) Aug 25, 2023
Copy link
Collaborator

@justinchuby justinchuby left a comment

Choose a reason for hiding this comment

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

Awesome! 🚀

@titaiwangms titaiwangms added the module: torchlib Related to the torch/aten function lib in development label Aug 28, 2023
@justinchuby justinchuby merged commit 793b2c5 into main Aug 29, 2023
@justinchuby justinchuby deleted the xiaowu/AddOp(embedding_bag_padding_idx) branch August 29, 2023 02:11
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.

[torchlib] _embedding_bag
3 participants