Skip to content

Conversation

[ghstack-poisoned]
@pytorch-bot
Copy link

pytorch-bot bot commented Sep 11, 2024

🔗 Helpful Links

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

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

❌ 24 New Failures

As of commit bf891a1 with merge base d2207c5 (image):

NEW FAILURES - The following jobs have failed:

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

[ghstack-poisoned]
def make_symbol(prefix: SymT, idx: int, **kwargs) -> sympy.Symbol:
# TODO: maybe put the assumptions here directly
return sympy.Symbol(f"{prefix_str[prefix]}{idx}", **kwargs)
class PrefixedSymbol(sympy.Symbol):
Copy link
Contributor

Choose a reason for hiding this comment

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

needs a comment I suppose

else:
return name_str.startswith(tuple(prefix_str[p] for p in prefix))
assert isinstance(sym, sympy.Symbol)
# TODO: remove all these Symbols and use PrefixedSymbol
Copy link
Contributor

Choose a reason for hiding this comment

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

lol, I think I did think about storing the prefix explicitly and then gave up when trying to figure out how to update everyone.

return name_str.startswith(tuple(prefix_str[p] for p in prefix))
assert isinstance(sym, sympy.Symbol)
# TODO: remove all these Symbols and use PrefixedSymbol
sym_name = sym.name.lower()
Copy link
Contributor

Choose a reason for hiding this comment

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

I hate this so frickin much lol. @shunting314, @jansel let's not take changes like this please lol (c.f. #127342 )

def symbol_is_type(sym: sympy.Basic, prefix: Union[SymT, Tuple[SymT, ...]]) -> bool:
if isinstance(sym, PrefixedSymbol):
# This function is called a *lot* of times, so it needs to be fast
if type(prefix) == tuple:
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe is here is slightly faster?

Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm, do you think we can afford an assert type(prefix) == SymT in the else case? Because otherwise I'm afraid of someone feeding us a list and not have typechecking on lol

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Didn't see any measurable difference. Fixed now

@ezyang ezyang added the topic: not user facing topic category label Sep 11, 2024
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
isuruf added a commit that referenced this pull request Sep 11, 2024
ghstack-source-id: fb2f9c6
Pull Request resolved: #135651
[ghstack-poisoned]
isuruf added a commit that referenced this pull request Sep 16, 2024
ghstack-source-id: 08df448
Pull Request resolved: #135651
isuruf added a commit to isuruf/pytorch that referenced this pull request Sep 23, 2024
ghstack-source-id: 08df448
Pull Request resolved: pytorch#135651
@ezyang
Copy link
Contributor

ezyang commented Sep 25, 2024

So is this hopeless or is there still hope haha

@isuruf
Copy link
Collaborator Author

isuruf commented Oct 18, 2024

I don't think this is easy to do this across the codebase. I'll close this for now and open it later if the performance becomes too much of a bottleneck.

@isuruf isuruf closed this Oct 18, 2024
@github-actions github-actions bot deleted the gh/isuruf/84/head branch November 18, 2024 02:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants