Skip to content

Better to check get_pip_packages return values in thunder.dynamo.utils.get_env #2123

@crcrpar

Description

@crcrpar

get_pip_packages' second return value can be None:
https://github.com/pytorch/pytorch/blob/269fa8028f68b29176e21886108634f48b1eced7/torch/utils/collect_env.py#L437-L457

def get_env() -> tuple[str, str]:
"""Retrieve detailed environment information using `torch.utils.collect_env.get_pip_packages()`.
Additionally, include the installed versions of Thunder and NvFuser (if available via pip).
"""
from torch.utils.collect_env import run, get_pip_packages
torch_env = "CUDA devices:\n"
for i in range(torch.cuda.device_count()):
torch_env += f" {i}: {torch.cuda.get_device_name(i)}\n"
torch_env += f"CUDA version: {torch.version.cuda}\n"
_, packages = get_pip_packages(run)
torch_env += packages
_, thunder_packages = get_pip_packages(run, {"lightning-thunder", "nvfuser"})
return torch_env, thunder_packages

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions