Skip to content

[Bugfix] Fix failing test from annotation failure#176887

Closed
Lucaskabela wants to merge 1 commit intopytorch:mainfrom
Lucaskabela:export-D95802783
Closed

[Bugfix] Fix failing test from annotation failure#176887
Lucaskabela wants to merge 1 commit intopytorch:mainfrom
Lucaskabela:export-D95802783

Conversation

@Lucaskabela
Copy link
Contributor

Summary: See title

Test Plan:

buck test fbcode//mode/opt fbcode//caffe2/test/distributed/elastic/agent/server/test:local_agent_test -- --run-disabled

Differential Revision: D95802783

@pytorch-bot pytorch-bot bot added the topic: not user facing topic category label Mar 9, 2026
@pytorch-bot
Copy link

pytorch-bot bot commented Mar 9, 2026

🔗 Helpful Links

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

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

⏳ No Failures, 1 Pending

As of commit d4361dd with merge base 92a9070 (image):
💚 Looks good so far! There are no failures yet. 💚

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

@meta-codesync
Copy link

meta-codesync bot commented Mar 9, 2026

@Lucaskabela has exported this pull request. If you are a Meta employee, you can view the originating Diff in D95802783.

#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
from __future__ import annotations
Copy link
Collaborator

Choose a reason for hiding this comment

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

There is a Ruff rule we can use to prevent this kind of failure. I'll enable it.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Okay, weird. How was this causing a failure before? It shouldn't be on 3.10 or newer?

@pytorch-bot pytorch-bot bot added the ciflow/trunk Trigger trunk jobs on your pull request label Mar 9, 2026
Lucaskabela added a commit to Lucaskabela/pytorch that referenced this pull request Mar 9, 2026
Summary:

See title

Test Plan:
```
buck test fbcode//mode/opt fbcode//caffe2/test/distributed/elastic/agent/server/test:local_agent_test -- --run-disabled
```

Differential Revision: D95802783
@Lucaskabela Lucaskabela force-pushed the export-D95802783 branch 2 times, most recently from c6291e3 to 39028f6 Compare March 9, 2026 16:19
Lucaskabela added a commit to Lucaskabela/pytorch that referenced this pull request Mar 9, 2026
Summary:

See title

Test Plan:
```
buck test fbcode//mode/opt fbcode//caffe2/test/distributed/elastic/agent/server/test:local_agent_test -- --run-disabled
```

Differential Revision: D95802783
Lucaskabela added a commit to Lucaskabela/pytorch that referenced this pull request Mar 9, 2026
Summary:

See title

Test Plan:
```
buck test fbcode//mode/opt fbcode//caffe2/test/distributed/elastic/agent/server/test:local_agent_test -- --run-disabled
```

Differential Revision: D95802783
Lucaskabela added a commit to Lucaskabela/pytorch that referenced this pull request Mar 9, 2026
Summary:

See title

Test Plan:
```
buck test fbcode//mode/opt fbcode//caffe2/test/distributed/elastic/agent/server/test:local_agent_test -- --run-disabled
```

Differential Revision: D95802783
Lucaskabela added a commit to Lucaskabela/pytorch that referenced this pull request Mar 9, 2026
Summary:
Pull Request resolved: pytorch#176887

See title

Test Plan:
```
buck test fbcode//mode/opt fbcode//caffe2/test/distributed/elastic/agent/server/test:local_agent_test -- --run-disabled
```

Differential Revision: D95802783
@Skylion007
Copy link
Collaborator

@Lucaskabela Do you have an exact failure? I suspect the issue is related to different parsing of annotations which we should really replace with inspect.get_annotations, typing_extensions.get_type_hints etc... That would make it work fine in either case?

@Lucaskabela
Copy link
Contributor Author

@Lucaskabela Do you have an exact failure? I suspect the issue is related to different parsing of annotations which we should really replace with inspect.get_annotations, typing_extensions.get_type_hints etc... That would make it work fine in either case?

Yeah the error is like

    agent_results: mp.Queue | None = None,  # (role, agent_result)
                   ~~~~~~~~~^~~~~~
TypeError: unsupported operand type(s) for |: 'method' and 'NoneType'

Worth noting the failure only happens on internal jobs so this is an easy enough fix to land as is imo

Lucaskabela added a commit to Lucaskabela/pytorch that referenced this pull request Mar 9, 2026
Summary:

See title

Test Plan:
```
buck test fbcode//mode/opt fbcode//caffe2/test/distributed/elastic/agent/server/test:local_agent_test -- --run-disabled
```

Differential Revision: D95802783
@Lucaskabela
Copy link
Contributor Author

@pytorchmergebot merge

@pytorchmergebot
Copy link
Collaborator

Merge started

Your change will be merged once all checks pass (ETA 0-4 Hours).

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

@Skylion007
Copy link
Collaborator

Skylion007 commented Mar 9, 2026

Okay, yeah this is exposing some bugs with our handling of __annotations__. We need to stop pulling the raw dictionary from the objects and properly process it to be consistent.

To be consistent all the way through 3.14 we should use.

inspect.get_annotations(obj, eval_str=False)

or better yet for consistent performance across all Python versions:

from typing_extensions import get_annotations, Format
get_annotations(obj, format=Format.FORWARDREF)

@pytorchmergebot
Copy link
Collaborator

Merge failed

Reason: 2 mandatory check(s) failed. The first few are:

Dig deeper by viewing the failures on hud

Details for Dev Infra team Raised by workflow job

Failing merge rule: Core Maintainers

@Lucaskabela
Copy link
Contributor Author

@pytorchmergebot merge -i

@pytorchmergebot
Copy link
Collaborator

Merge started

Your change will be merged while ignoring the following 19 checks: pull / linux-jammy-rocm-py3.10 / build, pull / linux-jammy-py3.14-clang15 / test (default, 1, 5, lf.linux.4xlarge), pull / linux-jammy-py3.14-clang15 / test (dynamo_wrapped, 1, 3, lf.linux.2xlarge), pull / linux-jammy-py3.14-clang15 / test (dynamo_wrapped, 2, 3, lf.linux.2xlarge), pull / linux-jammy-py3.14-clang15 / test (crossref, 2, 2, lf.linux.2xlarge), pull / linux-jammy-py3.14-clang15 / test (crossref, 1, 2, lf.linux.2xlarge), pull / linux-jammy-py3.10-clang15 / test (crossref, 2, 2, lf.linux.2xlarge), pull / linux-jammy-py3.14t-clang15 / test (crossref, 2, 2, lf.linux.2xlarge), pull / linux-jammy-py3.10-clang15 / test (default, 1, 5, lf.linux.4xlarge), pull / linux-jammy-py3.14t-clang15 / test (dynamo_wrapped, 3, 3, lf.linux.2xlarge), pull / linux-jammy-py3.14t-clang15 / test (crossref, 1, 2, lf.linux.2xlarge), pull / linux-jammy-py3.14t-clang15 / test (default, 1, 5, lf.linux.4xlarge), pull / linux-jammy-py3.10-gcc11 / test (default, 1, 5, lf.linux.2xlarge), pull / linux-jammy-py3.10-clang15 / test (dynamo_wrapped, 1, 3, lf.linux.2xlarge), pull / linux-jammy-py3.10-clang15 / test (dynamo_wrapped, 2, 3, lf.linux.2xlarge), pull / linux-jammy-py3.14t-clang15 / test (dynamo_wrapped, 1, 3, lf.linux.2xlarge), pull / linux-jammy-py3.10-clang15 / test (crossref, 1, 2, lf.linux.2xlarge), pull / linux-jammy-py3.10-clang15 / test (default, 2, 5, lf.linux.4xlarge), pull / linux-jammy-py3.10-clang18-asan / test (default, 1, 7, lf.linux.4xlarge)

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

Lucaskabela added a commit to Lucaskabela/pytorch that referenced this pull request Mar 9, 2026
Summary:

See title

Test Plan:
```
buck test fbcode//mode/opt fbcode//caffe2/test/distributed/elastic/agent/server/test:local_agent_test -- --run-disabled
```

Reviewed By: aorenste

Differential Revision: D95802783
Lucaskabela added a commit to Lucaskabela/pytorch that referenced this pull request Mar 9, 2026
Summary:

See title

Test Plan:
```
buck test fbcode//mode/opt fbcode//caffe2/test/distributed/elastic/agent/server/test:local_agent_test -- --run-disabled
```

Reviewed By: aorenste

Differential Revision: D95802783
Summary:
Pull Request resolved: pytorch#176887

See title

Test Plan:
```
buck test fbcode//mode/opt fbcode//caffe2/test/distributed/elastic/agent/server/test:local_agent_test -- --run-disabled
```

Reviewed By: aorenste

Differential Revision: D95802783
@Lucaskabela
Copy link
Contributor Author

@pytorchmergebot merge

@pytorchmergebot
Copy link
Collaborator

Merge started

Your change will be merged once all checks pass (ETA 0-4 Hours).

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/trunk Trigger trunk jobs on your pull request fb-exported Merged meta-exported topic: not user facing topic category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants