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

Implement rand* ops | feat(torchilb) #1035

Merged
merged 8 commits into from
Oct 11, 2023
Merged

Implement rand* ops | feat(torchilb) #1035

merged 8 commits into from
Oct 11, 2023

Conversation

justinchuby
Copy link
Collaborator

Implement rand* ops. I split all ops that can take a dtype into two overloads to avoid trace_only logic.

Replaces #875

@justinchuby justinchuby marked this pull request as draft August 29, 2023 02:50
@codecov
Copy link

codecov bot commented Aug 29, 2023

Codecov Report

Merging #1035 (f7c1159) into main (c74bc6a) will increase coverage by 0.19%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #1035      +/-   ##
==========================================
+ Coverage   77.91%   78.10%   +0.19%     
==========================================
  Files         115      115              
  Lines       14706    14826     +120     
  Branches     1562     1574      +12     
==========================================
+ Hits        11458    11580     +122     
+ Misses       2877     2875       -2     
  Partials      371      371              
Files Coverage Δ
onnxscript/function_libs/torch_lib/ops/core.py 80.09% <100.00%> (+0.54%) ⬆️
...ript/tests/function_libs/torch_lib/extra_opinfo.py 98.64% <100.00%> (+0.30%) ⬆️
...ipt/tests/function_libs/torch_lib/ops_test_data.py 96.13% <ø> (-0.05%) ⬇️

... and 1 file with indirect coverage changes

@github-actions
Copy link

github-actions bot commented Aug 29, 2023

Test Results

         18 files  ±           0         18 suites  ±0   2h 11m 58s ⏱️ + 1h 2m 0s
  11 021 tests +         51    8 269 ✔️ +       41      2 723 💤  -            2       29 +  12 
297 189 runs  +142 272  70 151 ✔️ +35 217  225 193 💤 +106 659  1 845 +396 

For more details on these failures, see this check.

Results for commit 47b65f5. ± Comparison against base commit c74bc6a.

This pull request removes 185 and adds 236 tests. Note that renamed tests count towards both.
docs.test.test_documentation_examples.TestDocumentationExample ‑ test_documentation_examples
onnxscript.tests.function_libs.torch_lib.ops_test.TestFunctionValidity ‑ test_function_has_op_schema_180_aten_randn
onnxscript.tests.function_libs.torch_lib.ops_test.TestFunctionValidity ‑ test_function_has_op_schema_181_aten_reciprocal
onnxscript.tests.function_libs.torch_lib.ops_test.TestFunctionValidity ‑ test_function_has_op_schema_182_aten_remainder
onnxscript.tests.function_libs.torch_lib.ops_test.TestFunctionValidity ‑ test_function_has_op_schema_183_aten_repeat
onnxscript.tests.function_libs.torch_lib.ops_test.TestFunctionValidity ‑ test_function_has_op_schema_184_aten_reshape
onnxscript.tests.function_libs.torch_lib.ops_test.TestFunctionValidity ‑ test_function_has_op_schema_185_aten_resolve_conj
onnxscript.tests.function_libs.torch_lib.ops_test.TestFunctionValidity ‑ test_function_has_op_schema_186_aten_resolve_neg
onnxscript.tests.function_libs.torch_lib.ops_test.TestFunctionValidity ‑ test_function_has_op_schema_187_aten_round
onnxscript.tests.function_libs.torch_lib.ops_test.TestFunctionValidity ‑ test_function_has_op_schema_188_aten_round_decimals
…
onnxscript.function_libs.tools.torch_lib.deduce_type_constraints_test.TestDeduceTypeConstraints ‑ test_deduce_type_constraints_does_not_crash_for_onnx_function_aten_rand_like
onnxscript.function_libs.tools.torch_lib.deduce_type_constraints_test.TestDeduceTypeConstraints ‑ test_deduce_type_constraints_does_not_crash_for_onnx_function_aten_rand_like_dtype
onnxscript.function_libs.tools.torch_lib.deduce_type_constraints_test.TestDeduceTypeConstraints ‑ test_deduce_type_constraints_does_not_crash_for_onnx_function_aten_randint
onnxscript.function_libs.tools.torch_lib.deduce_type_constraints_test.TestDeduceTypeConstraints ‑ test_deduce_type_constraints_does_not_crash_for_onnx_function_aten_randint_like
onnxscript.function_libs.tools.torch_lib.deduce_type_constraints_test.TestDeduceTypeConstraints ‑ test_deduce_type_constraints_does_not_crash_for_onnx_function_aten_randint_like_dtype
onnxscript.function_libs.tools.torch_lib.deduce_type_constraints_test.TestDeduceTypeConstraints ‑ test_deduce_type_constraints_does_not_crash_for_onnx_function_aten_randint_like_low_dtype
onnxscript.function_libs.tools.torch_lib.deduce_type_constraints_test.TestDeduceTypeConstraints ‑ test_deduce_type_constraints_does_not_crash_for_onnx_function_aten_randint_like_low_dtype_dtype
onnxscript.function_libs.tools.torch_lib.deduce_type_constraints_test.TestDeduceTypeConstraints ‑ test_deduce_type_constraints_does_not_crash_for_onnx_function_aten_randint_low
onnxscript.function_libs.tools.torch_lib.deduce_type_constraints_test.TestDeduceTypeConstraints ‑ test_deduce_type_constraints_does_not_crash_for_onnx_function_aten_randn_like
onnxscript.function_libs.tools.torch_lib.deduce_type_constraints_test.TestDeduceTypeConstraints ‑ test_deduce_type_constraints_does_not_crash_for_onnx_function_aten_randn_like_dtype
…

♻️ This comment has been updated with latest results.

@justinchuby justinchuby added the topic: torch_lib Related to the torch/aten function lib in development label Aug 29, 2023
@@ -516,6 +516,152 @@
yield opinfo_core.SampleInput(make_arg(case), p=p, train=training)


def sample_inputs_rand(op_info, device, dtype, requires_grad, **kwargs):

Check warning

Code scanning / lintrunner

PYLINT/W0613 Warning test

Unused argument 'kwargs' (unused-argument)
See unused-argument. To disable, use # pylint: disable=unused-argument
yield opinfo_core.SampleInput(make_arg(shape), kwargs=dict(dtype=dtype))


def sample_inputs_rand_like(op_info, device, dtype, requires_grad, **kwargs):

Check warning

Code scanning / lintrunner

PYLINT/W0613 Warning test

Unused argument 'kwargs' (unused-argument)
See unused-argument. To disable, use # pylint: disable=unused-argument
yield opinfo_core.SampleInput(make_arg(shape))


def sample_inputs_rand_like_dtype(op_info, device, dtype, requires_grad, **kwargs):

Check warning

Code scanning / lintrunner

PYLINT/W0613 Warning test

Unused argument 'kwargs' (unused-argument)
See unused-argument. To disable, use # pylint: disable=unused-argument
yield opinfo_core.SampleInput(sample.input, low, high, *sample.args, **sample.kwargs)


def sample_inputs_randn(op, device, dtype, requires_grad, **kwargs):

Check warning

Code scanning / lintrunner

PYLINT/W0613 Warning test

Unused argument 'device' (unused-argument)
See unused-argument. To disable, use # pylint: disable=unused-argument
yield opinfo_core.SampleInput(sample.input, low, high, *sample.args, **sample.kwargs)


def sample_inputs_randn(op, device, dtype, requires_grad, **kwargs):

Check warning

Code scanning / lintrunner

PYLINT/W0613 Warning test

Unused argument 'kwargs' (unused-argument)
See unused-argument. To disable, use # pylint: disable=unused-argument
@justinchuby justinchuby marked this pull request as ready for review October 10, 2023 20:48
@justinchuby justinchuby reopened this Oct 10, 2023
@justinchuby justinchuby merged commit 1ee4ee1 into main Oct 11, 2023
27 of 32 checks passed
@justinchuby justinchuby deleted the justinchu/rand-ops branch October 11, 2023 00:00
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
None yet
Development

Successfully merging this pull request may close these issues.

2 participants