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

[torchlib] Implement missing operators (set1) #1706

Merged
merged 12 commits into from
Jul 17, 2024

Conversation

shubhambhokare1
Copy link
Contributor

@shubhambhokare1 shubhambhokare1 commented Jun 25, 2024

Implement missing operators uncovered by torch.onnx tests as per #1644

  • Implement <OpOverload(op='aten.fmod', overload='Scalar')>

  • Implement <OpOverload(op='aten.fmod', overload='Tensor')>

  • Implement <OpOverload(op='aten.glu', overload='default')> @shubhambhokare1

  • Implement <OpOverload(op='aten.le', overload='Scalar')>

  • Implement <OpOverload(op='aten.lerp', overload='Scalar')>

  • Implement <OpOverload(op='aten.linalg_cross', overload='default')>

  • Implement <OpOverload(op='aten.mv', overload='default')>

  • Implement <OpOverload(op='aten.pow', overload='Scalar')>

  • Implement <OpOverload(op='aten.remainder', overload='Scalar')>

  • Implement <OpOverload(op='aten.remainder', overload='Tensor')>

  • Implement <OpOverload(op='aten.silu', overload='default')>

  • Implement <OpOverload(op='aten.unsafe_split', overload='Tensor')>

[NOT PART OF THIS PR] Requires adding implementation functions in torchlib eventually (not currently high in priority)

  • Implement <OpOverload(op='aten.__rshift__', overload='Scalar')>
  • Implement <OpOverload(op='aten._linalg_det', overload='default')>
  • Implement <OpOverload(op='aten._linalg_slogdet', overload='default')>
  • Implement <OpOverload(op='aten._prelu_kernel', overload='default')>
  • Implement <OpOverload(op='aten.add', overload='Scalar')>
  • Implement <OpOverload(op='aten.add', overload='Tensor')>
  • Implement <OpOverload(op='aten.affine_grid_generator', overload='default')>
  • Implement <OpOverload(op='aten.aminmax', overload='default')>
  • Implement <OpOverload(op='aten.binary_cross_entropy_with_logits', overload='default')>
  • Implement <OpOverload(op='aten.bitwise_and', overload='Tensor')>
  • Implement <OpOverload(op='aten.bucketize', overload='Tensor')>
  • Implement <OpOverload(op='aten.conv_tbc', overload='default')>
  • Implement <OpOverload(op='aten.fake_quantize_per_tensor_affine_cachemask', overload='default')>
  • Implement <OpOverload(op='aten.fill', overload='Scalar')>
  • Implement <OpOverload(op='aten.index_add', overload='default')>
  • Implement <OpOverload(op='aten.index_copy', overload='default')>
  • Implement <OpOverload(op='aten.index_fill', overload='int_Scalar')>
  • Implement <OpOverload(op='aten.index_put', overload='default')>
  • Implement <OpOverload(op='aten.masked_scatter', overload='default')>
  • Implement <OpOverload(op='aten.masked_select', overload='default')>
  • Implement <OpOverload(op='aten.prod', overload='dim_int')>
  • Implement <OpOverload(op='aten.rsub', overload='Tensor')>
  • Implement <OpOverload(op='aten.scatter', overload='src')>
  • Implement <OpOverload(op='aten.scatter', overload='value')>
  • Implement <OpOverload(op='aten.sort', overload='default')>
  • Implement <OpOverload(op='aten.std', overload='correction')>
  • Implement <OpOverload(op='aten.std_mean', overload='correction')>
  • Implement <OpOverload(op='aten.sym_size', overload='int')>
  • Implement <OpOverload(op='aten.take', overload='default')>
  • Implement <OpOverload(op='aten._adaptive_avg_pool2d', overload='default')>
  • Implement <OpOverload(op='aten._cdist_forward', overload='default')>
  • Implement <OpOverload(op='aten._convolution', overload='default')>
  • Implement <OpOverload(op='aten._fake_quantize_per_tensor_affine_cachemask_tensor_qparams', overload='default')>
  • Implement <OpOverload(op='aten.grid_sampler_3d', overload='default')>
  • Implement <OpOverload(op='aten.hann_window', overload='default')>
  • Implement <OpOverload(op='aten.im2col', overload='default')>
  • Implement <OpOverload(op='aten.repeat_interleave', overload='Tensor')>
  • Implement <OpOverload(op='torchvision.nms', overload='default')>
  • Implement <OpOverload(op='torchvision.roi_align', overload='default')>
  • Implement <OpOverload(op='torchvision.roi_pool', overload='default')>
  • Implement <OpOverload(op='aten.nan_to_num', overload='default')>
  • Implement <OpOverload(op='aten.nll_loss2d_forward', overload='default')>
  • Implement <OpOverload(op='aten.nll_loss_forward', overload='default')>
  • Implement <OpOverload(op='aten.norm', overload='ScalarOpt_dim_dtype')>
  • Implement <OpOverload(op='aten.pixel_unshuffle', overload='default')>

Add operator registration

  • aten::empty
  • aten::fill
  • aten::getitem
  • aten::normal
  • aten::rsub
  • aten::scatter_reduce
  • aten::select
  • aten::slice
  • aten::softmax
  • aten::subtract
  • aten::transpose
  • aten::unbind

@shubhambhokare1 shubhambhokare1 added the topic: torch_lib Related to the torch/aten function lib in development label Jun 25, 2024
@shubhambhokare1 shubhambhokare1 self-assigned this Jun 25, 2024
Copy link

codecov bot commented Jun 25, 2024

Codecov Report

Attention: Patch coverage is 94.73684% with 1 line in your changes missing coverage. Please review.

Project coverage is 74.84%. Comparing base (fb7dea4) to head (4999669).

Files Patch % Lines
onnxscript/function_libs/torch_lib/ops/core.py 94.11% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1706   +/-   ##
=======================================
  Coverage   74.83%   74.84%           
=======================================
  Files         242      242           
  Lines       25886    25882    -4     
  Branches     4666     4669    +3     
=======================================
- Hits        19373    19371    -2     
+ Misses       5643     5641    -2     
  Partials      870      870           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

github-actions bot commented Jun 25, 2024

Test Results

     24 files  ±     0      24 suites  ±0   1h 56m 44s ⏱️ - 7m 28s
 13 889 tests + 1 009  10 587 ✅ +  829    3 300 💤 +   179   2 ❌ +1 
293 280 runs   - 17 316  71 200 ✅  - 2 315  222 070 💤  - 15 002  10 ❌ +1 

For more details on these failures, see this check.

Results for commit 7272bb5. ± Comparison against base commit fb7dea4.

This pull request removes 456 and adds 1465 tests. Note that renamed tests count towards both.
tests.function_libs.torch_lib.ops_test.TestFunctionValidity ‑ test_function_has_op_schema_128_aten_log10
tests.function_libs.torch_lib.ops_test.TestFunctionValidity ‑ test_function_has_op_schema_129_aten_log1p
tests.function_libs.torch_lib.ops_test.TestFunctionValidity ‑ test_function_has_op_schema_130_aten_special_log_softmax
tests.function_libs.torch_lib.ops_test.TestFunctionValidity ‑ test_function_has_op_schema_131_aten_log2
tests.function_libs.torch_lib.ops_test.TestFunctionValidity ‑ test_function_has_op_schema_132_aten_logaddexp
tests.function_libs.torch_lib.ops_test.TestFunctionValidity ‑ test_function_has_op_schema_133_aten_logaddexp2
tests.function_libs.torch_lib.ops_test.TestFunctionValidity ‑ test_function_has_op_schema_134_aten_logcumsumexp
tests.function_libs.torch_lib.ops_test.TestFunctionValidity ‑ test_function_has_op_schema_135_aten_logdet
tests.function_libs.torch_lib.ops_test.TestFunctionValidity ‑ test_function_has_op_schema_136_aten_logsumexp
tests.function_libs.torch_lib.ops_test.TestFunctionValidity ‑ test_function_has_op_schema_137_aten_lt
…
onnxscript.backend.onnx_export_test.TestOnnxBackEnd ‑ test_export2python_produces_correct_onnx_script_model_0289_test_convtranspose_kernel_shape
onnxscript.backend.onnx_export_test.TestOnnxBackEnd ‑ test_export2python_produces_correct_onnx_script_model_0290_test_convtranspose_output_shape
onnxscript.backend.onnx_export_test.TestOnnxBackEnd ‑ test_export2python_produces_correct_onnx_script_model_0291_test_convtranspose_pad
onnxscript.backend.onnx_export_test.TestOnnxBackEnd ‑ test_export2python_produces_correct_onnx_script_model_0292_test_convtranspose_pads
onnxscript.backend.onnx_export_test.TestOnnxBackEnd ‑ test_export2python_produces_correct_onnx_script_model_0293_test_conv_with_autopad_same
onnxscript.backend.onnx_export_test.TestOnnxBackEnd ‑ test_export2python_produces_correct_onnx_script_model_0294_test_conv_with_strides_and_asymmetric_padding
onnxscript.backend.onnx_export_test.TestOnnxBackEnd ‑ test_export2python_produces_correct_onnx_script_model_0295_test_conv_with_strides_no_padding
onnxscript.backend.onnx_export_test.TestOnnxBackEnd ‑ test_export2python_produces_correct_onnx_script_model_0296_test_conv_with_strides_padding
onnxscript.backend.onnx_export_test.TestOnnxBackEnd ‑ test_export2python_produces_correct_onnx_script_model_0297_test_cos
onnxscript.backend.onnx_export_test.TestOnnxBackEnd ‑ test_export2python_produces_correct_onnx_script_model_0298_test_cosh
…
This pull request removes 109 skipped tests and adds 332 skipped tests. Note that renamed tests count towards both.
tests.function_libs.torch_lib.ops_test.TestFunctionValidity ‑ test_script_function_passes_checker_130_aten_special_log_softmax
tests.function_libs.torch_lib.ops_test.TestFunctionValidity ‑ test_script_function_passes_checker_146_aten_mH_complex
tests.function_libs.torch_lib.ops_test.TestFunctionValidity ‑ test_script_function_passes_checker_157_aten_native_dropout
tests.function_libs.torch_lib.ops_test.TestFunctionValidity ‑ test_script_function_passes_checker_160_aten_new_empty
tests.function_libs.torch_lib.ops_test.TestFunctionValidity ‑ test_script_function_passes_checker_161_aten_new_empty_strided
tests.function_libs.torch_lib.ops_test.TestFunctionValidity ‑ test_script_function_passes_checker_162_aten_new_full
tests.function_libs.torch_lib.ops_test.TestFunctionValidity ‑ test_script_function_passes_checker_163_aten_new_ones
tests.function_libs.torch_lib.ops_test.TestFunctionValidity ‑ test_script_function_passes_checker_164_aten_new_zeros
tests.function_libs.torch_lib.ops_test.TestFunctionValidity ‑ test_script_function_passes_checker_173_aten_embedding_bag
tests.function_libs.torch_lib.ops_test.TestFunctionValidity ‑ test_script_function_passes_checker_174_aten_embedding_bag_padding_idx
…
onnxscript.backend.onnx_export_test.TestOnnxBackEnd ‑ test_export2python_produces_correct_onnx_script_model_0308_test_deform_conv_with_mask_bias
onnxscript.backend.onnx_export_test.TestOnnxBackEnd ‑ test_export2python_produces_correct_onnx_script_model_0309_test_deform_conv_with_multiple_offset_groups
onnxscript.backend.onnx_export_test.TestOnnxBackEnd ‑ test_export2python_produces_correct_onnx_script_model_0312_test_dequantizelinear
onnxscript.backend.onnx_export_test.TestOnnxBackEnd ‑ test_export2python_produces_correct_onnx_script_model_0313_test_dequantizelinear_axis
onnxscript.backend.onnx_export_test.TestOnnxBackEnd ‑ test_export2python_produces_correct_onnx_script_model_0314_test_dequantizelinear_blocked
onnxscript.backend.onnx_export_test.TestOnnxBackEnd ‑ test_export2python_produces_correct_onnx_script_model_0315_test_dequantizelinear_e4m3fn
onnxscript.backend.onnx_export_test.TestOnnxBackEnd ‑ test_export2python_produces_correct_onnx_script_model_0316_test_dequantizelinear_e4m3fn_float16
onnxscript.backend.onnx_export_test.TestOnnxBackEnd ‑ test_export2python_produces_correct_onnx_script_model_0317_test_dequantizelinear_e4m3fn_zero_point
onnxscript.backend.onnx_export_test.TestOnnxBackEnd ‑ test_export2python_produces_correct_onnx_script_model_0318_test_dequantizelinear_e5m2
onnxscript.backend.onnx_export_test.TestOnnxBackEnd ‑ test_export2python_produces_correct_onnx_script_model_0319_test_dequantizelinear_int16
…

♻️ This comment has been updated with latest results.

@shubhambhokare1 shubhambhokare1 marked this pull request as ready for review July 16, 2024 16:34
@shubhambhokare1 shubhambhokare1 force-pushed the sbhokare/torchlib-missingops branch from c370e35 to 2216594 Compare July 16, 2024 16:48
@shubhambhokare1 shubhambhokare1 changed the title [torchlib] Implement missing operators [torchlib] Implement missing operators (set1) Jul 16, 2024
@shubhambhokare1 shubhambhokare1 force-pushed the sbhokare/torchlib-missingops branch from 14f43e4 to 87756da Compare July 16, 2024 20:09
@justinchuby
Copy link
Collaborator

Good to merge. Thanks!

@shubhambhokare1 shubhambhokare1 merged commit f8ee736 into main Jul 17, 2024
28 of 41 checks passed
@shubhambhokare1 shubhambhokare1 deleted the sbhokare/torchlib-missingops branch July 17, 2024 01:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: torch_lib Related to the torch/aten function lib in development
Projects
Development

Successfully merging this pull request may close these issues.

3 participants