Skip to content

Conversation

@bdhirsh
Copy link
Contributor

@bdhirsh bdhirsh commented Aug 3, 2022

Context: bernoulli_.float is currently a primitive op, but it's functional counterpart bernoulli.p is CompositeImplicitAutograd.

This is a problem when we're using functionalization on top of python tracing: functionalization will convert bernoulli_.float into bernoulli.p, but the decomposition for bernoulli.p will run before hitting python, and happily convert back into bernoulli_.float.

This doesn't seems to come up very often, but I think the right fix is to just make bernoulli.p a primitive w.r.t. the Python key too, by making it CompositeExplicitAutograd.

Stack from ghstack:

@facebook-github-bot
Copy link
Contributor

facebook-github-bot commented Aug 3, 2022

🔗 Helpful links

❌ 14 New Failures

As of commit 740192c (more details on the Dr. CI page):

Expand to see more
  • 14/14 failures introduced in this PR

🕵️ 14 new failures recognized by patterns

The following CI failures do not appear to be due to upstream breakages

See GitHub Actions build pull / linux-bionic-py3.7-clang9 / test (functorch, 1, 1, linux.2xlarge) (1/14)

Step: "Test" (full log | diagnosis details)

2022-08-11T16:05:17.5101845Z ModuleNotFoundError: No module named 'functorch'
2022-08-11T16:05:16.5909402Z prioritized: []
2022-08-11T16:05:16.5910628Z the rest: ['/var/lib/jenkins/workspace/functorch/test/test_compile_cache', '/var/lib/jenkins/workspace/functorch/test/test_dims', '/var/lib/jenkins/workspace/functorch/test/test_eager_transforms', '/var/lib/jenkins/workspace/functorch/test/test_functionalize', '/var/lib/jenkins/workspace/functorch/test/test_memory_efficient_fusion', '/var/lib/jenkins/workspace/functorch/test/test_minifier', '/var/lib/jenkins/workspace/functorch/test/test_ops', '/var/lib/jenkins/workspace/functorch/test/test_pythonkey', '/var/lib/jenkins/workspace/functorch/test/test_vmap']
2022-08-11T16:05:16.5911262Z 
2022-08-11T16:05:16.5911684Z Downloading https://raw.githubusercontent.com/pytorch/test-infra/generated-stats/stats/slow-tests.json to /var/lib/jenkins/workspace/test/.pytorch-slow-tests.json
2022-08-11T16:05:16.6102027Z Downloading https://raw.githubusercontent.com/pytorch/test-infra/generated-stats/stats/disabled-tests.json to /var/lib/jenkins/workspace/test/.pytorch-disabled-tests.json
2022-08-11T16:05:16.6458784Z Running /var/lib/jenkins/workspace/functorch/test/test_compile_cache ... [2022-08-11 16:05:16.645526]
2022-08-11T16:05:16.6459403Z Executing ['/opt/conda/bin/python', '-bb', '/var/lib/jenkins/workspace/functorch/test/test_compile_cache.py', '-v', '--import-slow-tests', '--import-disabled-tests'] ... [2022-08-11 16:05:16.645580]
2022-08-11T16:05:17.5100437Z Traceback (most recent call last):
2022-08-11T16:05:17.5101068Z   File "/var/lib/jenkins/workspace/functorch/test/test_compile_cache.py", line 5, in <module>
2022-08-11T16:05:17.5101390Z     import functorch
2022-08-11T16:05:17.5101845Z ModuleNotFoundError: No module named 'functorch'
2022-08-11T16:05:17.6716711Z Traceback (most recent call last):
2022-08-11T16:05:17.6717228Z   File "test/run_test.py", line 974, in <module>
2022-08-11T16:05:17.6719771Z     main()
2022-08-11T16:05:17.6720146Z   File "test/run_test.py", line 952, in main
2022-08-11T16:05:17.6722684Z     raise RuntimeError(err_message)
2022-08-11T16:05:17.6723168Z RuntimeError: /var/lib/jenkins/workspace/functorch/test/test_compile_cache failed!
2022-08-11T16:05:17.9692966Z ##[error]Process completed with exit code 1.
2022-08-11T16:05:17.9728569Z Prepare all required actions
2022-08-11T16:05:17.9728883Z Getting action download info
2022-08-11T16:05:18.1776690Z ##[group]Run ./.github/actions/get-workflow-job-id

See GitHub Actions build pull / linux-focal-py3.7-gcc7 / test (functorch, 1, 1, linux.2xlarge) (2/14)

Step: "Test" (full log | diagnosis details)

2022-08-11T16:05:21.2768223Z ModuleNotFoundError: No module named 'functorch'
2022-08-11T16:05:20.3596286Z prioritized: []
2022-08-11T16:05:20.3597410Z the rest: ['/var/lib/jenkins/workspace/functorch/test/test_compile_cache', '/var/lib/jenkins/workspace/functorch/test/test_dims', '/var/lib/jenkins/workspace/functorch/test/test_eager_transforms', '/var/lib/jenkins/workspace/functorch/test/test_functionalize', '/var/lib/jenkins/workspace/functorch/test/test_memory_efficient_fusion', '/var/lib/jenkins/workspace/functorch/test/test_minifier', '/var/lib/jenkins/workspace/functorch/test/test_ops', '/var/lib/jenkins/workspace/functorch/test/test_pythonkey', '/var/lib/jenkins/workspace/functorch/test/test_vmap']
2022-08-11T16:05:20.3598128Z 
2022-08-11T16:05:20.3598535Z Downloading https://raw.githubusercontent.com/pytorch/test-infra/generated-stats/stats/slow-tests.json to /var/lib/jenkins/workspace/test/.pytorch-slow-tests.json
2022-08-11T16:05:20.3766869Z Downloading https://raw.githubusercontent.com/pytorch/test-infra/generated-stats/stats/disabled-tests.json to /var/lib/jenkins/workspace/test/.pytorch-disabled-tests.json
2022-08-11T16:05:20.4114044Z Running /var/lib/jenkins/workspace/functorch/test/test_compile_cache ... [2022-08-11 16:05:20.411064]
2022-08-11T16:05:20.4114969Z Executing ['/opt/conda/bin/python', '-bb', '/var/lib/jenkins/workspace/functorch/test/test_compile_cache.py', '-v', '--import-slow-tests', '--import-disabled-tests'] ... [2022-08-11 16:05:20.411111]
2022-08-11T16:05:21.2767010Z Traceback (most recent call last):
2022-08-11T16:05:21.2767576Z   File "/var/lib/jenkins/workspace/functorch/test/test_compile_cache.py", line 5, in <module>
2022-08-11T16:05:21.2767845Z     import functorch
2022-08-11T16:05:21.2768223Z ModuleNotFoundError: No module named 'functorch'
2022-08-11T16:05:21.4240594Z Traceback (most recent call last):
2022-08-11T16:05:21.4241072Z   File "test/run_test.py", line 974, in <module>
2022-08-11T16:05:21.4243353Z     main()
2022-08-11T16:05:21.4243586Z   File "test/run_test.py", line 952, in main
2022-08-11T16:05:21.4245687Z     raise RuntimeError(err_message)
2022-08-11T16:05:21.4246025Z RuntimeError: /var/lib/jenkins/workspace/functorch/test/test_compile_cache failed!
2022-08-11T16:05:21.6864516Z ##[error]Process completed with exit code 1.
2022-08-11T16:05:21.6893741Z Prepare all required actions
2022-08-11T16:05:21.6894052Z Getting action download info
2022-08-11T16:05:21.8602409Z ##[group]Run ./.github/actions/get-workflow-job-id

See GitHub Actions build pull / linux-bionic-py3.7-clang9 / test (default, 1, 2, linux.2xlarge) (3/14)

Step: "Test" (full log | diagnosis details)

2022-08-11T16:10:18.5501175Z FAIL [0.002s]: tes..._surface (__main__.TestFXAPIBackwardCompatibility)
2022-08-11T16:10:18.4837217Z   test_type_check_reshape_false (fx.test_gradual_type.TypeCheckerTest) ... ok (0.003s)
2022-08-11T16:10:18.4869708Z   test_type_check_reshape_true (fx.test_gradual_type.TypeCheckerTest) ... ok (0.003s)
2022-08-11T16:10:18.5045835Z   test_type_check_symbolic_inferenceconv2D_maxpool2d_flatten (fx.test_gradual_type.TypeCheckerTest) ... ok (0.017s)
2022-08-11T16:10:18.5077804Z   test_type_check_transpose_False (fx.test_gradual_type.TypeCheckerTest) ... ok (0.003s)
2022-08-11T16:10:18.5111278Z   test_type_check_transpose_true (fx.test_gradual_type.TypeCheckerTest) ... ok (0.003s)
2022-08-11T16:10:18.5375674Z   test_type_maxpool2d_fully_static (fx.test_gradual_type.TypeCheckerTest) ... ok (0.026s)
2022-08-11T16:10:18.5422004Z   test_type_typechecl_maxpool2d_3dinput (fx.test_gradual_type.TypeCheckerTest) ... ok (0.005s)
2022-08-11T16:10:18.5494988Z   test_typecheck_basicblock (fx.test_gradual_type.TypeCheckerTest) ... ok (0.007s)
2022-08-11T16:10:18.5500240Z 
2022-08-11T16:10:18.5500649Z ======================================================================
2022-08-11T16:10:18.5501175Z FAIL [0.002s]: test_public_api_surface (__main__.TestFXAPIBackwardCompatibility)
2022-08-11T16:10:18.5502034Z ----------------------------------------------------------------------
2022-08-11T16:10:18.5502537Z Traceback (most recent call last):
2022-08-11T16:10:18.5503764Z   File "test_fx.py", line 3814, in test_public_api_surface
2022-08-11T16:10:18.5504373Z     raise AssertionError(f"Public FX API(s) {non_back_compat_strs} introduced but not given a "
2022-08-11T16:10:18.5505662Z AssertionError: Public FX API(s) ['torch.fx.passes.reinplace.reinplace'] introduced but not given a backwards-compatibility classification! Please decorate these API(s) with `@torch.fx._compatibility.compatibility` to specify BC guarantees.
2022-08-11T16:10:18.5506359Z 
2022-08-11T16:10:18.5506769Z ----------------------------------------------------------------------
2022-08-11T16:10:18.5507313Z Ran 1100 tests in 201.119s
2022-08-11T16:10:18.5507576Z 
2022-08-11T16:10:18.5507847Z FAILED (failures=1, skipped=194, expected failures=5)

See GitHub Actions build pull / linux-bionic-cuda11.6-py3.10-gcc7 / test (functorch, 1, 1, linux.4xlarge.nvidia.gpu) (4/14)

Step: "Test" (full log | diagnosis details)

2022-08-11T16:54:14.1232286Z ModuleNotFoundError: No module named 'functorch'
2022-08-11T16:54:12.7072411Z prioritized: []
2022-08-11T16:54:12.7073907Z the rest: ['/var/lib/jenkins/workspace/functorch/test/test_compile_cache', '/var/lib/jenkins/workspace/functorch/test/test_dims', '/var/lib/jenkins/workspace/functorch/test/test_eager_transforms', '/var/lib/jenkins/workspace/functorch/test/test_functionalize', '/var/lib/jenkins/workspace/functorch/test/test_memory_efficient_fusion', '/var/lib/jenkins/workspace/functorch/test/test_minifier', '/var/lib/jenkins/workspace/functorch/test/test_ops', '/var/lib/jenkins/workspace/functorch/test/test_pythonkey', '/var/lib/jenkins/workspace/functorch/test/test_vmap']
2022-08-11T16:54:12.7074864Z 
2022-08-11T16:54:12.7075413Z Downloading https://raw.githubusercontent.com/pytorch/test-infra/generated-stats/stats/slow-tests.json to /var/lib/jenkins/workspace/test/.pytorch-slow-tests.json
2022-08-11T16:54:12.7299304Z Downloading https://raw.githubusercontent.com/pytorch/test-infra/generated-stats/stats/disabled-tests.json to /var/lib/jenkins/workspace/test/.pytorch-disabled-tests.json
2022-08-11T16:54:12.7758493Z Running /var/lib/jenkins/workspace/functorch/test/test_compile_cache ... [2022-08-11 16:54:12.775430]
2022-08-11T16:54:12.7759280Z Executing ['/opt/conda/bin/python', '-bb', '/var/lib/jenkins/workspace/functorch/test/test_compile_cache.py', '-v', '--import-slow-tests', '--import-disabled-tests'] ... [2022-08-11 16:54:12.775486]
2022-08-11T16:54:14.1230350Z Traceback (most recent call last):
2022-08-11T16:54:14.1230822Z   File "/var/lib/jenkins/workspace/functorch/test/test_compile_cache.py", line 5, in <module>
2022-08-11T16:54:14.1231804Z     import functorch
2022-08-11T16:54:14.1232286Z ModuleNotFoundError: No module named 'functorch'
2022-08-11T16:54:14.2993936Z Traceback (most recent call last):
2022-08-11T16:54:14.2994498Z   File "/var/lib/jenkins/workspace/test/run_test.py", line 974, in <module>
2022-08-11T16:54:14.2996186Z     main()
2022-08-11T16:54:14.2996593Z   File "/var/lib/jenkins/workspace/test/run_test.py", line 952, in main
2022-08-11T16:54:14.2997519Z     raise RuntimeError(err_message)
2022-08-11T16:54:14.2997890Z RuntimeError: /var/lib/jenkins/workspace/functorch/test/test_compile_cache failed!
2022-08-11T16:54:14.5497324Z ##[error]Process completed with exit code 1.
2022-08-11T16:54:14.5534599Z Prepare all required actions
2022-08-11T16:54:14.5534946Z Getting action download info
2022-08-11T16:54:14.6999538Z ##[group]Run ./.github/actions/get-workflow-job-id

See GitHub Actions build pull / linux-focal-py3.7-gcc7 / test (default, 1, 2, linux.2xlarge) (5/14)

Step: "Test" (full log | diagnosis details)

2022-08-11T16:10:16.1663514Z FAIL [0.002s]: tes..._surface (__main__.TestFXAPIBackwardCompatibility)
2022-08-11T16:10:16.0996050Z   test_type_check_reshape_false (fx.test_gradual_type.TypeCheckerTest) ... ok (0.003s)
2022-08-11T16:10:16.1028410Z   test_type_check_reshape_true (fx.test_gradual_type.TypeCheckerTest) ... ok (0.003s)
2022-08-11T16:10:16.1196335Z   test_type_check_symbolic_inferenceconv2D_maxpool2d_flatten (fx.test_gradual_type.TypeCheckerTest) ... ok (0.017s)
2022-08-11T16:10:16.1233955Z   test_type_check_transpose_False (fx.test_gradual_type.TypeCheckerTest) ... ok (0.004s)
2022-08-11T16:10:16.1268489Z   test_type_check_transpose_true (fx.test_gradual_type.TypeCheckerTest) ... ok (0.003s)
2022-08-11T16:10:16.1527926Z   test_type_maxpool2d_fully_static (fx.test_gradual_type.TypeCheckerTest) ... ok (0.026s)
2022-08-11T16:10:16.1574548Z   test_type_typechecl_maxpool2d_3dinput (fx.test_gradual_type.TypeCheckerTest) ... ok (0.005s)
2022-08-11T16:10:16.1651202Z   test_typecheck_basicblock (fx.test_gradual_type.TypeCheckerTest) ... ok (0.007s)
2022-08-11T16:10:16.1652469Z 
2022-08-11T16:10:16.1663081Z ======================================================================
2022-08-11T16:10:16.1663514Z FAIL [0.002s]: test_public_api_surface (__main__.TestFXAPIBackwardCompatibility)
2022-08-11T16:10:16.1664146Z ----------------------------------------------------------------------
2022-08-11T16:10:16.1664484Z Traceback (most recent call last):
2022-08-11T16:10:16.1664791Z   File "test_fx.py", line 3814, in test_public_api_surface
2022-08-11T16:10:16.1665201Z     raise AssertionError(f"Public FX API(s) {non_back_compat_strs} introduced but not given a "
2022-08-11T16:10:16.1666220Z AssertionError: Public FX API(s) ['torch.fx.passes.reinplace.reinplace'] introduced but not given a backwards-compatibility classification! Please decorate these API(s) with `@torch.fx._compatibility.compatibility` to specify BC guarantees.
2022-08-11T16:10:16.1670612Z 
2022-08-11T16:10:16.1670905Z ----------------------------------------------------------------------
2022-08-11T16:10:16.1671246Z Ran 1100 tests in 214.348s
2022-08-11T16:10:16.1671382Z 
2022-08-11T16:10:16.1671548Z FAILED (failures=1, skipped=194, expected failures=5)

See GitHub Actions build pull / linux-bionic-py3.7-clang9 / test (dynamo, 1, 2, linux.2xlarge) (6/14)

Step: "Test" (full log | diagnosis details)

2022-08-11T18:19:28.1901283Z FAIL [0.035s]: tes..._surface (__main__.TestFXAPIBackwardCompatibility)
2022-08-11T18:19:22.9760068Z   test_type_check_reshape_false (fx.test_gradual_type.TypeCheckerTest) ... ok (0.005s)
2022-08-11T18:19:22.9823057Z   test_type_check_reshape_true (fx.test_gradual_type.TypeCheckerTest) ... ok (0.006s)
2022-08-11T18:19:23.0054811Z   test_type_check_symbolic_inferenceconv2D_maxpool2d_flatten (fx.test_gradual_type.TypeCheckerTest) ... ok (0.023s)
2022-08-11T18:19:23.0120926Z   test_type_check_transpose_False (fx.test_gradual_type.TypeCheckerTest) ... ok (0.007s)
2022-08-11T18:19:23.0185654Z   test_type_check_transpose_true (fx.test_gradual_type.TypeCheckerTest) ... ok (0.006s)
2022-08-11T18:19:28.1198569Z   test_type_maxpool2d_fully_static (fx.test_gradual_type.TypeCheckerTest) ... ok (5.101s)
2022-08-11T18:19:28.1302944Z   test_type_typechecl_maxpool2d_3dinput (fx.test_gradual_type.TypeCheckerTest) ... ok (0.010s)
2022-08-11T18:19:28.1898524Z   test_typecheck_basicblock (fx.test_gradual_type.TypeCheckerTest) ... ok (0.059s)
2022-08-11T18:19:28.1898882Z 
2022-08-11T18:19:28.1899036Z ======================================================================
2022-08-11T18:19:28.1901283Z FAIL [0.035s]: test_public_api_surface (__main__.TestFXAPIBackwardCompatibility)
2022-08-11T18:19:28.1910637Z ----------------------------------------------------------------------
2022-08-11T18:19:28.1911084Z Traceback (most recent call last):
2022-08-11T18:19:28.1911494Z   File "test_fx.py", line 3782, in test_public_api_surface
2022-08-11T18:19:28.1911888Z     def test_public_api_surface(self):
2022-08-11T18:19:28.1912285Z   File "test_fx.py", line 3782, in test_public_api_surface
2022-08-11T18:19:28.1912665Z     def test_public_api_surface(self):
2022-08-11T18:19:28.1913058Z   File "test_fx.py", line 3782, in test_public_api_surface
2022-08-11T18:19:28.1950197Z     def test_public_api_surface(self):
2022-08-11T18:19:28.1950695Z   File "test_fx.py", line 3814, in test_public_api_surface
2022-08-11T18:19:28.1951219Z     raise AssertionError(f"Public FX API(s) {non_back_compat_strs} introduced but not given a "

See GitHub Actions build pull / linux-bionic-cuda11.6-py3.10-gcc7 / test (default, 3, 4, linux.4xlarge.nvidia.gpu) (7/14)

Step: "Test" (full log | diagnosis details)

2022-08-11T16:57:34.9046153Z FAIL [0.003s]: tes..._surface (__main__.TestFXAPIBackwardCompatibility)
2022-08-11T16:57:34.8342590Z   test_type_check_reshape_false (fx.test_gradual_type.TypeCheckerTest) ... ok (0.003s)
2022-08-11T16:57:34.8375535Z   test_type_check_reshape_true (fx.test_gradual_type.TypeCheckerTest) ... ok (0.003s)
2022-08-11T16:57:34.8558695Z   test_type_check_symbolic_inferenceconv2D_maxpool2d_flatten (fx.test_gradual_type.TypeCheckerTest) ... ok (0.018s)
2022-08-11T16:57:34.8590095Z   test_type_check_transpose_False (fx.test_gradual_type.TypeCheckerTest) ... ok (0.003s)
2022-08-11T16:57:34.8622954Z   test_type_check_transpose_true (fx.test_gradual_type.TypeCheckerTest) ... ok (0.003s)
2022-08-11T16:57:34.8906527Z   test_type_maxpool2d_fully_static (fx.test_gradual_type.TypeCheckerTest) ... ok (0.028s)
2022-08-11T16:57:34.8946654Z   test_type_typechecl_maxpool2d_3dinput (fx.test_gradual_type.TypeCheckerTest) ... ok (0.004s)
2022-08-11T16:57:34.9044348Z   test_typecheck_basicblock (fx.test_gradual_type.TypeCheckerTest) ... ok (0.010s)
2022-08-11T16:57:34.9045149Z 
2022-08-11T16:57:34.9045409Z ======================================================================
2022-08-11T16:57:34.9046153Z FAIL [0.003s]: test_public_api_surface (__main__.TestFXAPIBackwardCompatibility)
2022-08-11T16:57:34.9047275Z ----------------------------------------------------------------------
2022-08-11T16:57:34.9047973Z Traceback (most recent call last):
2022-08-11T16:57:34.9048716Z   File "/var/lib/jenkins/workspace/test/test_fx.py", line 3814, in test_public_api_surface
2022-08-11T16:57:34.9049636Z     raise AssertionError(f"Public FX API(s) {non_back_compat_strs} introduced but not given a "
2022-08-11T16:57:34.9051623Z AssertionError: Public FX API(s) ['torch.fx.passes.reinplace.reinplace'] introduced but not given a backwards-compatibility classification! Please decorate these API(s) with `@torch.fx._compatibility.compatibility` to specify BC guarantees.
2022-08-11T16:57:34.9052621Z 
2022-08-11T16:57:34.9053108Z ----------------------------------------------------------------------
2022-08-11T16:57:34.9053719Z Ran 1009 tests in 4.070s
2022-08-11T16:57:34.9054020Z 
2022-08-11T16:57:34.9054525Z FAILED (failures=1, skipped=598, expected failures=3)

See GitHub Actions build pull / linux-bionic-py3.7-clang9 / test (dynamo, 2, 2, linux.2xlarge) (8/14)

Step: "Test" (full log | diagnosis details)

2022-08-11T16:07:03.1490610Z RuntimeError: test_functionalization failed!
2022-08-11T16:07:01.8452347Z Executing ['/opt/conda/bin/python', '-bb', 'test_functionalization.py', '-v', '--import-slow-tests', '--import-disabled-tests'] ... [2022-08-11 16:07:01.844894]
2022-08-11T16:07:02.9381439Z Traceback (most recent call last):
2022-08-11T16:07:02.9381755Z   File "test_functionalization.py", line 8, in <module>
2022-08-11T16:07:02.9382040Z     from functorch.experimental import functionalize
2022-08-11T16:07:02.9382706Z ModuleNotFoundError: No module named 'functorch'
2022-08-11T16:07:03.1485985Z Traceback (most recent call last):
2022-08-11T16:07:03.1486240Z   File "test/run_test.py", line 974, in <module>
2022-08-11T16:07:03.1488093Z     main()
2022-08-11T16:07:03.1488293Z   File "test/run_test.py", line 952, in main
2022-08-11T16:07:03.1490366Z     raise RuntimeError(err_message)
2022-08-11T16:07:03.1490610Z RuntimeError: test_functionalization failed!
2022-08-11T16:07:03.4480268Z 
2022-08-11T16:07:03.4480766Z real	0m17.940s
2022-08-11T16:07:03.4481133Z user	0m17.835s
2022-08-11T16:07:03.4481331Z sys	0m3.193s
2022-08-11T16:07:03.4511371Z ##[error]Process completed with exit code 1.
2022-08-11T16:07:03.4545887Z Prepare all required actions
2022-08-11T16:07:03.4546190Z Getting action download info
2022-08-11T16:07:03.6542169Z ##[group]Run ./.github/actions/get-workflow-job-id
2022-08-11T16:07:03.6542627Z with:
2022-08-11T16:07:03.6542968Z   github-token: ***

See GitHub Actions build pull / linux-bionic-py3.7-clang9 / test (crossref, 2, 2, linux.2xlarge) (9/14)

Step: "Test" (full log | diagnosis details)

2022-08-11T16:14:23.4698550Z RuntimeError: test_functionalization failed!
2022-08-11T16:14:22.1797699Z Executing ['/opt/conda/bin/python', '-bb', 'test_functionalization.py', '-v', '--import-slow-tests', '--import-disabled-tests'] ... [2022-08-11 16:14:22.179384]
2022-08-11T16:14:23.2531138Z Traceback (most recent call last):
2022-08-11T16:14:23.2531434Z   File "test_functionalization.py", line 8, in <module>
2022-08-11T16:14:23.2531723Z     from functorch.experimental import functionalize
2022-08-11T16:14:23.2532143Z ModuleNotFoundError: No module named 'functorch'
2022-08-11T16:14:23.4694545Z Traceback (most recent call last):
2022-08-11T16:14:23.4694813Z   File "test/run_test.py", line 974, in <module>
2022-08-11T16:14:23.4696252Z     main()
2022-08-11T16:14:23.4696467Z   File "test/run_test.py", line 952, in main
2022-08-11T16:14:23.4698293Z     raise RuntimeError(err_message)
2022-08-11T16:14:23.4698550Z RuntimeError: test_functionalization failed!
2022-08-11T16:14:23.7947787Z 
2022-08-11T16:14:23.7948115Z real	7m51.535s
2022-08-11T16:14:23.7948397Z user	11m24.425s
2022-08-11T16:14:23.7949957Z sys	0m13.075s
2022-08-11T16:14:23.7978673Z ##[error]Process completed with exit code 1.
2022-08-11T16:14:23.8017808Z Prepare all required actions
2022-08-11T16:14:23.8018113Z Getting action download info
2022-08-11T16:14:24.0239932Z ##[group]Run ./.github/actions/get-workflow-job-id
2022-08-11T16:14:24.0240250Z with:
2022-08-11T16:14:24.0240592Z   github-token: ***

See GitHub Actions build pull / win-vs2019-cpu-py3 / test (default, 1, 2, windows.4xlarge) (10/14)

Step: "Test" (full log | diagnosis details)

2022-08-11T17:26:33.3635255Z FAIL [0.000s]: tes..._surface (__main__.TestFXAPIBackwardCompatibility)
2022-08-11T17:26:33.3121486Z   test_type_check_reshape_false (fx.test_gradual_type.TypeCheckerTest) ... ok (0.000s)
2022-08-11T17:26:33.3157419Z   test_type_check_reshape_true (fx.test_gradual_type.TypeCheckerTest) ... ok (0.016s)
2022-08-11T17:26:33.3179309Z   test_type_check_symbolic_inferenceconv2D_maxpool2d_flatten (fx.test_gradual_type.TypeCheckerTest) ... skip: no sympy (0.000s)
2022-08-11T17:26:33.3209975Z   test_type_check_transpose_False (fx.test_gradual_type.TypeCheckerTest) ... ok (0.000s)
2022-08-11T17:26:33.3245241Z   test_type_check_transpose_true (fx.test_gradual_type.TypeCheckerTest) ... ok (0.000s)
2022-08-11T17:26:33.3508402Z   test_type_maxpool2d_fully_static (fx.test_gradual_type.TypeCheckerTest) ... ok (0.032s)
2022-08-11T17:26:33.3551505Z   test_type_typechecl_maxpool2d_3dinput (fx.test_gradual_type.TypeCheckerTest) ... ok (0.000s)
2022-08-11T17:26:33.3634094Z   test_typecheck_basicblock (fx.test_gradual_type.TypeCheckerTest) ... ok (0.016s)
2022-08-11T17:26:33.3634585Z 
2022-08-11T17:26:33.3634765Z ======================================================================
2022-08-11T17:26:33.3635255Z FAIL [0.000s]: test_public_api_surface (__main__.TestFXAPIBackwardCompatibility)
2022-08-11T17:26:33.3635691Z ----------------------------------------------------------------------
2022-08-11T17:26:33.3636018Z Traceback (most recent call last):
2022-08-11T17:26:33.3636420Z   File "test_fx.py", line 3814, in test_public_api_surface
2022-08-11T17:26:33.3636942Z     raise AssertionError(f"Public FX API(s) {non_back_compat_strs} introduced but not given a "
2022-08-11T17:26:33.3637813Z AssertionError: Public FX API(s) ['torch.fx.passes.reinplace.reinplace'] introduced but not given a backwards-compatibility classification! Please decorate these API(s) with `@torch.fx._compatibility.compatibility` to specify BC guarantees.
2022-08-11T17:26:33.3638217Z 
2022-08-11T17:26:33.4886540Z ----------------------------------------------------------------------
2022-08-11T17:26:33.4886837Z Ran 1002 tests in 8.063s
2022-08-11T17:26:33.4886958Z 
2022-08-11T17:26:33.4887088Z FAILED (failures=1, skipped=208, expected failures=5)

See GitHub Actions build pull / linux-focal-py3.7-gcc7 / test (default, 2, 2, linux.2xlarge) (11/14)

Step: "Test" (full log | diagnosis details)

2022-08-11T16:14:11.3387899Z RuntimeError: test_functionalization failed!
2022-08-11T16:14:10.0201021Z Executing ['/opt/conda/bin/python', '-bb', 'test_functionalization.py', '-v', '--import-slow-tests', '--import-disabled-tests'] ... [2022-08-11 16:14:10.019728]
2022-08-11T16:14:11.1213026Z Traceback (most recent call last):
2022-08-11T16:14:11.1213538Z   File "test_functionalization.py", line 8, in <module>
2022-08-11T16:14:11.1213963Z     from functorch.experimental import functionalize
2022-08-11T16:14:11.1214397Z ModuleNotFoundError: No module named 'functorch'
2022-08-11T16:14:11.3384123Z Traceback (most recent call last):
2022-08-11T16:14:11.3384887Z   File "test/run_test.py", line 974, in <module>
2022-08-11T16:14:11.3385710Z     main()
2022-08-11T16:14:11.3386031Z   File "test/run_test.py", line 952, in main
2022-08-11T16:14:11.3387445Z     raise RuntimeError(err_message)
2022-08-11T16:14:11.3387899Z RuntimeError: test_functionalization failed!
2022-08-11T16:14:11.6517494Z 
2022-08-11T16:14:11.6518013Z real	7m33.781s
2022-08-11T16:14:11.6518348Z user	9m2.408s
2022-08-11T16:14:11.6518821Z sys	0m4.749s
2022-08-11T16:14:11.6548479Z ##[error]Process completed with exit code 1.
2022-08-11T16:14:11.6598419Z Prepare all required actions
2022-08-11T16:14:11.6598728Z Getting action download info
2022-08-11T16:14:11.8793443Z ##[group]Run ./.github/actions/get-workflow-job-id
2022-08-11T16:14:11.8793668Z with:
2022-08-11T16:14:11.8794002Z   github-token: ***

See GitHub Actions build pull / linux-focal-py3.7-clang7-asan / test (default, 4, 5, linux.2xlarge) (12/14)

Step: "Test" (full log | diagnosis details)

2022-08-11T16:06:16.3165544Z FAIL [0.003s]: tes..._surface (__main__.TestFXAPIBackwardCompatibility)
2022-08-11T16:06:16.2498057Z   test_type_check_reshape_false (fx.test_gradual_type.TypeCheckerTest) ... ok (0.003s)
2022-08-11T16:06:16.2530040Z   test_type_check_reshape_true (fx.test_gradual_type.TypeCheckerTest) ... ok (0.003s)
2022-08-11T16:06:16.2710066Z   test_type_check_symbolic_inferenceconv2D_maxpool2d_flatten (fx.test_gradual_type.TypeCheckerTest) ... ok (0.018s)
2022-08-11T16:06:16.2739381Z   test_type_check_transpose_False (fx.test_gradual_type.TypeCheckerTest) ... ok (0.003s)
2022-08-11T16:06:16.2771417Z   test_type_check_transpose_true (fx.test_gradual_type.TypeCheckerTest) ... ok (0.003s)
2022-08-11T16:06:16.3037086Z   test_type_maxpool2d_fully_static (fx.test_gradual_type.TypeCheckerTest) ... ok (0.026s)
2022-08-11T16:06:16.3073420Z   test_type_typechecl_maxpool2d_3dinput (fx.test_gradual_type.TypeCheckerTest) ... ok (0.004s)
2022-08-11T16:06:16.3164545Z   test_typecheck_basicblock (fx.test_gradual_type.TypeCheckerTest) ... ok (0.009s)
2022-08-11T16:06:16.3164872Z 
2022-08-11T16:06:16.3165037Z ======================================================================
2022-08-11T16:06:16.3165544Z FAIL [0.003s]: test_public_api_surface (__main__.TestFXAPIBackwardCompatibility)
2022-08-11T16:06:16.3166469Z ----------------------------------------------------------------------
2022-08-11T16:06:16.3166775Z Traceback (most recent call last):
2022-08-11T16:06:16.3167024Z   File "test_fx.py", line 3814, in test_public_api_surface
2022-08-11T16:06:16.3167321Z     raise AssertionError(f"Public FX API(s) {non_back_compat_strs} introduced but not given a "
2022-08-11T16:06:16.3168045Z AssertionError: Public FX API(s) ['torch.fx.passes.reinplace.reinplace'] introduced but not given a backwards-compatibility classification! Please decorate these API(s) with `@torch.fx._compatibility.compatibility` to specify BC guarantees.
2022-08-11T16:06:16.3168437Z 
2022-08-11T16:06:16.3168641Z ----------------------------------------------------------------------
2022-08-11T16:06:16.3168880Z Ran 1002 tests in 11.177s
2022-08-11T16:06:16.3168997Z 
2022-08-11T16:06:16.3169103Z FAILED (failures=1, skipped=198, expected failures=5)

See GitHub Actions build pull / linux-bionic-py3.7-clang9 / test (crossref, 1, 2, linux.2xlarge) (13/14)

Step: "Test" (full log | diagnosis details)

2022-08-11T16:10:16.3858087Z FAIL [0.002s]: tes..._surface (__main__.TestFXAPIBackwardCompatibility)
2022-08-11T16:10:16.3223298Z   test_type_check_reshape_false (fx.test_gradual_type.TypeCheckerTest) ... ok (0.003s)
2022-08-11T16:10:16.3254214Z   test_type_check_reshape_true (fx.test_gradual_type.TypeCheckerTest) ... ok (0.003s)
2022-08-11T16:10:16.3421910Z   test_type_check_symbolic_inferenceconv2D_maxpool2d_flatten (fx.test_gradual_type.TypeCheckerTest) ... ok (0.017s)
2022-08-11T16:10:16.3453373Z   test_type_check_transpose_False (fx.test_gradual_type.TypeCheckerTest) ... ok (0.003s)
2022-08-11T16:10:16.3486324Z   test_type_check_transpose_true (fx.test_gradual_type.TypeCheckerTest) ... ok (0.003s)
2022-08-11T16:10:16.3736657Z   test_type_maxpool2d_fully_static (fx.test_gradual_type.TypeCheckerTest) ... ok (0.025s)
2022-08-11T16:10:16.3775828Z   test_type_typechecl_maxpool2d_3dinput (fx.test_gradual_type.TypeCheckerTest) ... ok (0.004s)
2022-08-11T16:10:16.3854241Z   test_typecheck_basicblock (fx.test_gradual_type.TypeCheckerTest) ... ok (0.008s)
2022-08-11T16:10:16.3856362Z 
2022-08-11T16:10:16.3856829Z ======================================================================
2022-08-11T16:10:16.3858087Z FAIL [0.002s]: test_public_api_surface (__main__.TestFXAPIBackwardCompatibility)
2022-08-11T16:10:16.3858871Z ----------------------------------------------------------------------
2022-08-11T16:10:16.3859308Z Traceback (most recent call last):
2022-08-11T16:10:16.3859696Z   File "test_fx.py", line 3814, in test_public_api_surface
2022-08-11T16:10:16.3860217Z     raise AssertionError(f"Public FX API(s) {non_back_compat_strs} introduced but not given a "
2022-08-11T16:10:16.3861471Z AssertionError: Public FX API(s) ['torch.fx.passes.reinplace.reinplace'] introduced but not given a backwards-compatibility classification! Please decorate these API(s) with `@torch.fx._compatibility.compatibility` to specify BC guarantees.
2022-08-11T16:10:16.3862344Z 
2022-08-11T16:10:16.3862689Z ----------------------------------------------------------------------
2022-08-11T16:10:16.3863092Z Ran 1100 tests in 207.515s
2022-08-11T16:10:16.3868059Z 
2022-08-11T16:10:16.3868350Z FAILED (failures=1, skipped=194, expected failures=5)

See GitHub Actions build pull / linux-focal-py3.7-clang7-asan / test (default, 3, 5, linux.2xlarge) (14/14)

Step: "Test" (full log | diagnosis details)

2022-08-11T16:06:19.0362486Z RuntimeError: test_functionalization failed!
2022-08-11T16:06:15.7757164Z Executing ['/opt/conda/bin/python', '-bb', 'test_functionalization.py', '-v', '--import-slow-tests', '--import-disabled-tests'] ... [2022-08-11 16:06:15.775355]
2022-08-11T16:06:18.6280935Z Traceback (most recent call last):
2022-08-11T16:06:18.6281472Z   File "test_functionalization.py", line 8, in <module>
2022-08-11T16:06:18.6281823Z     from functorch.experimental import functionalize
2022-08-11T16:06:18.6282232Z ModuleNotFoundError: No module named 'functorch'
2022-08-11T16:06:19.0354794Z Traceback (most recent call last):
2022-08-11T16:06:19.0355151Z   File "test/run_test.py", line 974, in <module>
2022-08-11T16:06:19.0358532Z     main()
2022-08-11T16:06:19.0358902Z   File "test/run_test.py", line 952, in main
2022-08-11T16:06:19.0362005Z     raise RuntimeError(err_message)
2022-08-11T16:06:19.0362486Z RuntimeError: test_functionalization failed!
2022-08-11T16:06:19.5828903Z 
2022-08-11T16:06:19.5829188Z real	0m28.026s
2022-08-11T16:06:19.5829579Z user	0m25.720s
2022-08-11T16:06:19.5829843Z sys	0m5.758s
2022-08-11T16:06:19.5858833Z ##[error]Process completed with exit code 1.
2022-08-11T16:06:19.5895829Z Prepare all required actions
2022-08-11T16:06:19.5896127Z Getting action download info
2022-08-11T16:06:19.7753355Z ##[group]Run ./.github/actions/get-workflow-job-id
2022-08-11T16:06:19.7753560Z with:
2022-08-11T16:06:19.7753880Z   github-token: ***

This comment was automatically generated by Dr. CI (expand for details).

Please report bugs/suggestions to the (internal) Dr. CI Users group.

Click here to manually regenerate this comment.

@bdhirsh bdhirsh requested review from ezyang and zou3519 August 3, 2022 23:27
…ive wrt torch_dispatch"

Context: `bernoulli_.float` is currently a primitive op, but it's functional counterpart `bernoulli.p` is `CompositeImplicitAutograd`.

This is a problem when we're using functionalization on top of python tracing: functionalization will convert `bernoulli_.float` into `bernoulli.p`, but the decomposition for `bernoulli.p` will run before hitting python, and happily convert back into `bernoulli_.float`.

This doesn't seems to come up very often, but I think the right fix is to just make `bernoulli.p` a primitive w.r.t. the Python key too, by making it `CompositeExplicitAutograd`.




[ghstack-poisoned]
Copy link
Contributor

@ezyang ezyang left a comment

Choose a reason for hiding this comment

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

okey dokey

# This op needs to be a primitive w.r.t. Python,
# because functionalization wants to convert bernoulli_.float -> bernoulli.p.
# If we leave it as CompositeImplicitAutograd, then we'll run this kernel
# If we leave it as CompositeImplicitAutograd, then we'll run this kernel
Copy link
Contributor

Choose a reason for hiding this comment

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

duplicated line in comment?

Comment on lines 336 to 338
- name: bernoulli.p(Tensor self, float p, *, Generator? generator=None) -> Tensor
self: zeros_like(grad)
result: auto_element_wise
Copy link
Contributor

Choose a reason for hiding this comment

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

The behavior today is that bernoulli.p returns a Tensor without requires_grad. Does this PR change the behavior by giving it a backwards formula?

In [6]: x = torch.randn(3, 3, requires_grad=True)

In [7]: y = torch.bernoulli(x, 0.5)

In [8]: y
Out[8]:
tensor([[1., 1., 0.],
        [0., 1., 0.],
        [1., 0., 0.]])

Copy link
Collaborator

Choose a reason for hiding this comment

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

Correct, please mark output_differentiability = [False] here to preserve that behavior

Copy link
Contributor Author

Choose a reason for hiding this comment

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

whoops, thanks :)

…ive wrt torch_dispatch"

Context: `bernoulli_.float` is currently a primitive op, but it's functional counterpart `bernoulli.p` is `CompositeImplicitAutograd`.

This is a problem when we're using functionalization on top of python tracing: functionalization will convert `bernoulli_.float` into `bernoulli.p`, but the decomposition for `bernoulli.p` will run before hitting python, and happily convert back into `bernoulli_.float`.

This doesn't seems to come up very often, but I think the right fix is to just make `bernoulli.p` a primitive w.r.t. the Python key too, by making it `CompositeExplicitAutograd`.




[ghstack-poisoned]
Copy link
Collaborator

@albanD albanD left a comment

Choose a reason for hiding this comment

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

Duplicate comments needs to be removed. But good otherwise.

…ive wrt torch_dispatch"

Context: `bernoulli_.float` is currently a primitive op, but it's functional counterpart `bernoulli.p` is `CompositeImplicitAutograd`.

This is a problem when we're using functionalization on top of python tracing: functionalization will convert `bernoulli_.float` into `bernoulli.p`, but the decomposition for `bernoulli.p` will run before hitting python, and happily convert back into `bernoulli_.float`.

This doesn't seems to come up very often, but I think the right fix is to just make `bernoulli.p` a primitive w.r.t. the Python key too, by making it `CompositeExplicitAutograd`.




[ghstack-poisoned]
@pytorch-bot
Copy link

pytorch-bot bot commented Sep 26, 2022

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/82771

Note: Links to docs will display an error until the docs builds have been completed.

❌ 1 Failures, 1 Pending

As of commit 3ba4219:

The following jobs have failed:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

…ive wrt torch_dispatch"

Context: `bernoulli_.float` is currently a primitive op, but it's functional counterpart `bernoulli.p` is `CompositeImplicitAutograd`.

This is a problem when we're using functionalization on top of python tracing: functionalization will convert `bernoulli_.float` into `bernoulli.p`, but the decomposition for `bernoulli.p` will run before hitting python, and happily convert back into `bernoulli_.float`.

This doesn't seems to come up very often, but I think the right fix is to just make `bernoulli.p` a primitive w.r.t. the Python key too, by making it `CompositeExplicitAutograd`.




[ghstack-poisoned]
…ive wrt torch_dispatch"

Context: `bernoulli_.float` is currently a primitive op, but it's functional counterpart `bernoulli.p` is `CompositeImplicitAutograd`.

This is a problem when we're using functionalization on top of python tracing: functionalization will convert `bernoulli_.float` into `bernoulli.p`, but the decomposition for `bernoulli.p` will run before hitting python, and happily convert back into `bernoulli_.float`.

This doesn't seems to come up very often, but I think the right fix is to just make `bernoulli.p` a primitive w.r.t. the Python key too, by making it `CompositeExplicitAutograd`.




[ghstack-poisoned]
…ive wrt torch_dispatch"

Context: `bernoulli_.float` is currently a primitive op, but it's functional counterpart `bernoulli.p` is `CompositeImplicitAutograd`.

This is a problem when we're using functionalization on top of python tracing: functionalization will convert `bernoulli_.float` into `bernoulli.p`, but the decomposition for `bernoulli.p` will run before hitting python, and happily convert back into `bernoulli_.float`.

This doesn't seems to come up very often, but I think the right fix is to just make `bernoulli.p` a primitive w.r.t. the Python key too, by making it `CompositeExplicitAutograd`.




[ghstack-poisoned]
…ive wrt torch_dispatch"

Context: `bernoulli_.float` is currently a primitive op, but it's functional counterpart `bernoulli.p` is `CompositeImplicitAutograd`.

This is a problem when we're using functionalization on top of python tracing: functionalization will convert `bernoulli_.float` into `bernoulli.p`, but the decomposition for `bernoulli.p` will run before hitting python, and happily convert back into `bernoulli_.float`.

This doesn't seems to come up very often, but I think the right fix is to just make `bernoulli.p` a primitive w.r.t. the Python key too, by making it `CompositeExplicitAutograd`.




[ghstack-poisoned]
@bdhirsh bdhirsh mentioned this pull request Sep 29, 2022
…ive wrt torch_dispatch"

Context: `bernoulli_.float` is currently a primitive op, but it's functional counterpart `bernoulli.p` is `CompositeImplicitAutograd`.

This is a problem when we're using functionalization on top of python tracing: functionalization will convert `bernoulli_.float` into `bernoulli.p`, but the decomposition for `bernoulli.p` will run before hitting python, and happily convert back into `bernoulli_.float`.

This doesn't seems to come up very often, but I think the right fix is to just make `bernoulli.p` a primitive w.r.t. the Python key too, by making it `CompositeExplicitAutograd`.




[ghstack-poisoned]
@facebook-github-bot
Copy link
Contributor

/easycla

As part of the transition to the PyTorch Foundation, this project now requires contributions be covered under the new CLA. See #85559 for additional details.

This comment will trigger a new check of this PR. If you are already covered, you will simply see a new "EasyCLA" check that passes. If you are not covered, a bot will leave a new comment with a link to sign.

@github-actions
Copy link
Contributor

github-actions bot commented Dec 3, 2022

Looks like this PR hasn't been updated in a while so we're going to go ahead and mark this as Stale.
Feel free to remove the Stale label if you feel this was a mistake.
If you are unable to remove the Stale label please contact a maintainer in order to do so.
If you want the bot to never mark this PR stale again, add the no-stale label.
Stale pull requests will automatically be closed after 30 days of inactivity.

@github-actions github-actions bot added the Stale label Dec 3, 2022
@github-actions github-actions bot closed this Jan 2, 2023
@facebook-github-bot facebook-github-bot deleted the gh/bdhirsh/292/head branch June 8, 2023 15:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants