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

Make lazy mode autodetection more robust #921

Open
wants to merge 5 commits into
base: habana_main
Choose a base branch
from

Conversation

kzawora-intel
Copy link

@kzawora-intel kzawora-intel commented Mar 17, 2025

No description provided.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
is_lazy = htorch.utils.internal.is_lazy{}
if is_lazy:
torch._dynamo.config.disable = True
env_update_dict['PT_HPU_ENABLE_LAZY_COLLECTIVES'] = 'true'

Choose a reason for hiding this comment

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

Do we really need to clean this up? I'm assuming PT_HPU_ENABLE_LAZY_COLLECTIVES only affects lazy and is ignored in other cases. If we skip cleanup we could end up with something as simple as:

os.environ['PT_HPU_ENABLE_LAZY_COLLECTIVES'] = 'true'
import habana_frameworks.torch as htorch
if htorch.utils.internal.is_lazy:
    torch._dynamo.config.disable = True

is_lazy = lazy_mode_env_var == '1'
if lazy_mode_env_var is None:
import habana_frameworks.torch as htorch
is_lazy = htorch.utils.internal.is_lazy{}

Choose a reason for hiding this comment

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

what is this syntax? Is it a typo?

Copy link
Author

Choose a reason for hiding this comment

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

yeah, i should probably get a new pair of glasses

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants