Skip to content

[Ez][BE]: Remove accidental classvar#153540

Closed
Skylion007 wants to merge 1 commit intopytorch:mainfrom
Skylion007:skylion007/remove-classvar-type-2025-05-14
Closed

[Ez][BE]: Remove accidental classvar#153540
Skylion007 wants to merge 1 commit intopytorch:mainfrom
Skylion007:skylion007/remove-classvar-type-2025-05-14

Conversation

@Skylion007
Copy link
Collaborator

@Skylion007 Skylion007 commented May 14, 2025

Untyped variables become ClassVar in dataclasses, this type alias should just be a type alias; no need for it to eb a classvar.

cc @H-Huang @awgu @wanchaol @fegin @fduwjj @wz337 @wconstab @d4l3k @pragupta

@pytorch-bot
Copy link

pytorch-bot bot commented May 14, 2025

🔗 Helpful Links

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

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

❌ 1 New Failure

As of commit 331fa22 with merge base f1de3f9 (image):

NEW FAILURE - The following job has failed:

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

@pytorch-bot pytorch-bot bot added the oncall: distributed Add this issue/PR to distributed oncall triage queue label May 14, 2025
@Skylion007 Skylion007 force-pushed the skylion007/remove-classvar-type-2025-05-14 branch from 5ea51ea to 43d4b6c Compare May 14, 2025 14:47
@Skylion007 Skylion007 added the topic: not user facing topic category label May 14, 2025
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.

Thanks!

@Skylion007 Skylion007 force-pushed the skylion007/remove-classvar-type-2025-05-14 branch from 43d4b6c to 331fa22 Compare May 14, 2025 16:04
@Skylion007
Copy link
Collaborator Author

@pytorchbot merge

@pytorch-bot pytorch-bot bot added the ciflow/trunk Trigger trunk jobs on your pull request label May 14, 2025
@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

@jeanschmidt
Copy link
Contributor

@pytorchbot revert -m "Broken internal tests, @albanD may you help the author get his PR merged? D74804063" -c ghfirst

@pytorchmergebot
Copy link
Collaborator

@pytorchbot successfully started a revert job. Check the current status here.
Questions? Feedback? Please reach out to the PyTorch DevX Team

pytorchmergebot added a commit that referenced this pull request May 16, 2025
This reverts commit e0dece5.

Reverted #153540 on behalf of https://github.com/jeanschmidt due to Broken internal tests, @albanD may you help the author get his PR merged? D74804063 ([comment](#153540 (comment)))
@pytorchmergebot
Copy link
Collaborator

@Skylion007 your PR has been successfully reverted.

@pytorchmergebot pytorchmergebot added Reverted ci-no-td Do not run TD on this PR labels May 16, 2025
# from run-time to resolve circular dependency.
from torch.distributed._shard.sharded_tensor import ShardedTensor

_ShardingDim: TypeAlias = Union[int, str]
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'm guess something imported the type Alias from the dataclass internally? I mean we can keep it as a class based TypeAlias but seems silly

Copy link
Collaborator

Choose a reason for hiding this comment

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

The error is:

Incompatible parameter type [6]: In call `torch.distributed._shard.sharding_spec.chunk_sharding_spec.ChunkShardingSpec.__init__`, for argument `placements`, expected `List[Union[str, _remote_device]]` but got `List[str]`.

Copy link
Collaborator

Choose a reason for hiding this comment

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

So I guess we need to fix the wrong type internally and not much we can do here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is either an issue with TypeAlias resolution leaving that type unresolved or we need an explicit cast somewhere. Could also be that the TypeAlias was never properly picked up before for some reason

@Skylion007
Copy link
Collaborator Author

@aorenste Would you mind shepherding / debugging this when you get a chance?

@github-actions
Copy link
Contributor

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 Jul 27, 2025
@github-actions github-actions bot closed this Aug 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-no-td Do not run TD on this PR ciflow/trunk Trigger trunk jobs on your pull request Merged oncall: distributed Add this issue/PR to distributed oncall triage queue open source Reverted Stale topic: not user facing topic category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants