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] Fix more signatures #1613

Merged
merged 25 commits into from
Jun 21, 2024
Merged

Conversation

justinchuby
Copy link
Collaborator

@justinchuby justinchuby commented Jun 14, 2024

Fix more signatures in torchlib that were previously overlooked

@justinchuby justinchuby added the topic: torch_lib Related to the torch/aten function lib in development label Jun 14, 2024
Copy link

codecov bot commented Jun 14, 2024

Codecov Report

Attention: Patch coverage is 77.53623% with 31 lines in your changes missing coverage. Please review.

Project coverage is 75.67%. Comparing base (ae4c67d) to head (6b3eb68).

Files Patch % Lines
onnxscript/function_libs/torch_lib/ops/core.py 82.03% 13 Missing and 10 partials ⚠️
onnxscript/function_libs/torch_lib/ops/nn.py 20.00% 8 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1613      +/-   ##
==========================================
- Coverage   75.84%   75.67%   -0.18%     
==========================================
  Files         240      240              
  Lines       25500    25495       -5     
  Branches     4540     4549       +9     
==========================================
- Hits        19341    19293      -48     
- Misses       5269     5295      +26     
- Partials      890      907      +17     

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

@justinchuby justinchuby requested a review from titaiwangms June 14, 2024 19:56
Copy link

github-actions bot commented Jun 14, 2024

Test Results

     30 files  ±      0      30 suites  ±0   1h 13m 52s ⏱️ - 2h 6m 24s
  8 276 tests  -   2 240   5 658 ✅  -  2 976    2 516 💤 +    637  102 ❌ + 99 
163 398 runs   - 412 805  57 468 ✅  - 62 205  105 797 💤  - 350 730  133 ❌ +130 

For more details on these failures, see this check.

Results for commit b702136. ± Comparison against base commit c332202.

This pull request removes 4817 and adds 2577 tests. Note that renamed tests count towards both.
docs.test.test_documentation_examples.TestDocumentationExample ‑ test_documentation_examples
onnxscript.function_libs.tools.torch_lib.deduce_type_constraints_test.TestDeduceTypeConstraints ‑ test_deduce_type_constraints_does_not_crash_for_onnx_function__aten_convolution_onnx
onnxscript.function_libs.tools.torch_lib.deduce_type_constraints_test.TestDeduceTypeConstraints ‑ test_deduce_type_constraints_does_not_crash_for_onnx_function__aten_scatter_reduce_onnx
tests.eager_mode_test.EagerModeTest_0_reference_runtime ‑ test_sequence_input
tests.eager_mode_test.EagerModeTest_1_onnxruntime ‑ test_sequence_input
tests.eager_mode_test.TestEagerModeArguments_0_reference_runtime ‑ test_function_all_input_by_kwargs
tests.eager_mode_test.TestEagerModeArguments_0_reference_runtime ‑ test_function_attribute_by_positional_args
tests.eager_mode_test.TestEagerModeArguments_0_reference_runtime ‑ test_function_input_and_attribute_by_kwargs_out_of_order
tests.eager_mode_test.TestEagerModeArguments_0_reference_runtime ‑ test_function_some_input_by_kwargs
tests.eager_mode_test.TestEagerModeArguments_0_reference_runtime ‑ test_op_all_input_by_kwargs
…
onnxscript.backend.onnx_export_test.TestOnnxBackEnd ‑ test_export2python_produces_correct_onnx_script_model_0000_test_convinteger_without_padding
onnxscript.backend.onnx_export_test.TestOnnxBackEnd ‑ test_export2python_produces_correct_onnx_script_model_0000_test_slice
onnxscript.backend.onnx_export_test.TestOnnxBackEnd ‑ test_export2python_produces_correct_onnx_script_model_0001_test_cosh_example
onnxscript.backend.onnx_export_test.TestOnnxBackEnd ‑ test_export2python_produces_correct_onnx_script_model_0001_test_sqrt
onnxscript.backend.onnx_export_test.TestOnnxBackEnd ‑ test_export2python_produces_correct_onnx_script_model_0002_test_cast_no_saturate_FLOAT_to_FLOAT8E5M2FNUZ
onnxscript.backend.onnx_export_test.TestOnnxBackEnd ‑ test_export2python_produces_correct_onnx_script_model_0002_test_min_int32
onnxscript.backend.onnx_export_test.TestOnnxBackEnd ‑ test_export2python_produces_correct_onnx_script_model_0003_test_col2im
onnxscript.backend.onnx_export_test.TestOnnxBackEnd ‑ test_export2python_produces_correct_onnx_script_model_0003_test_sce_mean_weight
onnxscript.backend.onnx_export_test.TestOnnxBackEnd ‑ test_export2python_produces_correct_onnx_script_model_0004_test_nllloss_NCd1d2_reduction_mean
onnxscript.backend.onnx_export_test.TestOnnxBackEnd ‑ test_export2python_produces_correct_onnx_script_model_0004_test_reduce_sum_square_do_not_keepdims_example_expanded
…
This pull request removes 19 skipped tests and adds 664 skipped tests. Note that renamed tests count towards both.
onnxscript.function_libs.tools.torch_lib.deduce_type_constraints_test.TestDeduceTypeConstraints ‑ test_deduce_type_constraints_does_not_crash_for_onnx_function__aten_convolution_onnx
onnxscript.function_libs.tools.torch_lib.deduce_type_constraints_test.TestDeduceTypeConstraints ‑ test_deduce_type_constraints_does_not_crash_for_onnx_function__aten_scatter_reduce_onnx
tests.eager_test.TestOnnxSignal ‑ test_dft_rstft_04_A2
tests.eager_test.TestOnnxSignal ‑ test_dft_rstft_07_B2
tests.eager_test.TestOnnxSignal ‑ test_dft_rstft_10_C2
tests.function_libs.torch_lib.ops_test.TestOutputConsistencyEagerCPU ‑ test_output_match_opinfo__native_layer_norm_cpu_float16
tests.function_libs.torch_lib.ops_test.TestOutputConsistencyEagerCPU ‑ test_output_match_opinfo__nn_functional_avg_pool1d_cpu_float16
tests.function_libs.torch_lib.ops_test.TestOutputConsistencyEagerCPU ‑ test_output_match_opinfo__nn_functional_avg_pool2d_cpu_float16
tests.function_libs.torch_lib.ops_test.TestOutputConsistencyEagerCPU ‑ test_output_match_opinfo__nn_functional_cross_entropy_cpu_float16
tests.function_libs.torch_lib.ops_test.TestOutputConsistencyEagerCPU ‑ test_output_match_opinfo__nn_functional_nll_loss_cpu_float16
…
onnxscript.backend.onnx_export_test.TestOnnxBackEnd ‑ test_export2python_produces_correct_onnx_script_model_0002_test_cast_no_saturate_FLOAT_to_FLOAT8E5M2FNUZ
onnxscript.backend.onnx_export_test.TestOnnxBackEnd ‑ test_export2python_produces_correct_onnx_script_model_0005_test_shape_start_1
onnxscript.backend.onnx_export_test.TestOnnxBackEnd ‑ test_export2python_produces_correct_onnx_script_model_0012_test_qlinearmatmul_2D_int8_float16
onnxscript.backend.onnx_export_test.TestOnnxBackEnd ‑ test_export2python_produces_correct_onnx_script_model_0014_test_optional_has_element_tensor_input
onnxscript.backend.onnx_export_test.TestOnnxBackEnd ‑ test_export2python_produces_correct_onnx_script_model_0017_test_if_seq
onnxscript.backend.onnx_export_test.TestOnnxBackEnd ‑ test_export2python_produces_correct_onnx_script_model_0018_test_image_decoder_decode_jpeg_bgr
onnxscript.backend.onnx_export_test.TestOnnxBackEnd ‑ test_export2python_produces_correct_onnx_script_model_0019_test_max_int16
onnxscript.backend.onnx_export_test.TestOnnxBackEnd ‑ test_export2python_produces_correct_onnx_script_model_0020_test_castlike_FLOAT_to_STRING
onnxscript.backend.onnx_export_test.TestOnnxBackEnd ‑ test_export2python_produces_correct_onnx_script_model_0020_test_shape_start_1_end_2
onnxscript.backend.onnx_export_test.TestOnnxBackEnd ‑ test_export2python_produces_correct_onnx_script_model_0021_test_unsqueeze_axis_2
…

♻️ This comment has been updated with latest results.

Copy link
Contributor

@titaiwangms titaiwangms left a comment

Choose a reason for hiding this comment

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

Please run this change with main torch to make sure there is no broken op tests.

Copy link

@github-advanced-security github-advanced-security bot left a comment

Choose a reason for hiding this comment

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

lintrunner found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.

@justinchuby justinchuby added the hold on merging Don't merge yet label Jun 20, 2024
@justinchuby
Copy link
Collaborator Author

CI failures unrelated

@justinchuby justinchuby merged commit 1aa7a70 into main Jun 21, 2024
17 of 45 checks passed
@justinchuby justinchuby deleted the justinchu/more-torchlib-fixes branch June 21, 2024 00:56
xadupre added a commit to xadupre/onnxscript that referenced this pull request Jun 24, 2024
justinchuby added a commit that referenced this pull request Jun 25, 2024
In the modularization pass in the exporter, a single node like `clone`
can be lifted as a function. If we remove the only Identity node the
lifted function will have no nodes. This violates the ONNX standard.

Since removing identity nodes is fast, we are safe to include these
identity nodes in the torchlib.

onnxscript/tools/transformers_models/phi_test.py broke after #1613, it
is fixed by this change.

---------

Signed-off-by: Xavier Dupre <[email protected]>
Co-authored-by: Justin Chu <[email protected]>
@justinchuby justinchuby removed the hold on merging Don't merge yet label Nov 18, 2024
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