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

Enabled torch compile on _compute_affine_output_size #8218

Merged

Conversation

vfdev-5
Copy link
Collaborator

@vfdev-5 vfdev-5 commented Jan 17, 2024

Fixed failing tests:

  • test.test_transforms_v2.TestRotate.test_kernel_image[cpu-dtype0-expand-True]
  • test.test_transforms_v2.TestRotate.test_kernel_image[cpu-dtype1-expand-True]
  • test.test_transforms_v2.TestRotate.test_kernel_bounding_boxes[cpu-dtype0-BoundingBoxFormat.XYXY-expand-True]
  • test.test_transforms_v2.TestRotate.test_kernel_bounding_boxes[cpu-dtype0-BoundingBoxFormat.XYWH-expand-True]
  • test.test_transforms_v2.TestRotate.test_kernel_bounding_boxes[cpu-dtype0-BoundingBoxFormat.CXCYWH-expand-True]
  • test.test_transforms_v2.TestRotate.test_kernel_bounding_boxes[cpu-dtype1-BoundingBoxFormat.XYXY-expand-True]
  • test.test_transforms_v2.TestRotate.test_kernel_bounding_boxes[cpu-dtype1-BoundingBoxFormat.XYWH-expand-True]
  • test.test_transforms_v2.TestRotate.test_kernel_bounding_boxes[cpu-dtype1-BoundingBoxFormat.CXCYWH-expand-True]

from compile (true, inductor, true) / dynamic=true,backend=inductor,fullgraph=true: https://github.com/pytorch/vision/actions/runs/7298953575

PR is fixing the following error:

E   torch._dynamo.exc.UserError: Tried to use data-dependent value in the subsequent computation. This can happen when we encounter unbounded dynamic value that is unknown during tracing time.  You will need to explicitly give hint to the compiler. Please take a look at constrain_as_value OR constrain_as_size APIs.  It appears that you're trying to get a value out of symbolic int/float whose value is data-dependent (and thus we do not know the true value.)  The expression we were trying to evaluate is f0 >= 0 (unhinted: f0 >= 0).  For more information, run with TORCH_LOGS="+dynamic".
E   
E   For more information about this error, see: https://pytorch.org/docs/main/generated/exportdb/index.html#constrain-as-size-example
E   
E   from user code:
E      File "/pytorch/vision/torchvision/transforms/v2/functional/_geometry.py", line 986, in rotate_image
E       _compute_affine_output_size(matrix, input_width, input_height) if expand else (input_width, input_height)
E     File "/pytorch/vision/torchvision/transforms/v2/functional/_geometry.py", line 559, in _compute_affine_output_size
E       return int(size[0]), int(size[1])  # w, 

Copy link

pytorch-bot bot commented Jan 17, 2024

🔗 Helpful Links

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

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

✅ No Failures

As of commit 75387b4 with merge base 1de7a74 (image):
💚 Looks good so far! There are no failures yet. 💚

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

@vfdev-5 vfdev-5 changed the title Enable torch compile on _compute_affine_output_size Enabled torch compile on _compute_affine_output_size Jan 17, 2024
@vfdev-5 vfdev-5 force-pushed the fix-torch-compile-compute_affine_output_size branch from 59e7d7d to 75387b4 Compare January 17, 2024 16:35
@vfdev-5 vfdev-5 marked this pull request as ready for review January 17, 2024 16:35
Copy link
Member

@NicolasHug NicolasHug left a comment

Choose a reason for hiding this comment

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

Thanks a lot @vfdev-5 , LGTM if green (here and in #8127 !)

@vfdev-5 vfdev-5 merged commit 6a9b549 into pytorch:main Jan 18, 2024
83 checks passed
@vfdev-5 vfdev-5 deleted the fix-torch-compile-compute_affine_output_size branch January 18, 2024 10:17
facebook-github-bot pushed a commit that referenced this pull request Mar 19, 2024
Reviewed By: vmoens

Differential Revision: D55062779

fbshipit-source-id: 72d16f6739c07855a7297fbb6ab48eb06a9fd384
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.

3 participants