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

Improve transformers-cli env reporting #31003

Merged
merged 3 commits into from
May 29, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/transformers/commands/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
is_safetensors_available,
is_tf_available,
is_torch_available,
is_torch_npu_available,
)
from . import BaseTransformersCLICommand

Expand Down Expand Up @@ -88,6 +89,7 @@ def run(self):

pt_version = torch.__version__
pt_cuda_available = torch.cuda.is_available()
pt_npu_available = is_torch_npu_available()

tf_version = "not installed"
tf_cuda_available = "NA"
Expand Down Expand Up @@ -132,6 +134,11 @@ def run(self):
"Using GPU in script?": "<fill in>",
"Using distributed or parallel set-up in script?": "<fill in>",
}
if pt_cuda_available:
info["GPU type"] = torch.cuda.get_device_name()
elif pt_npu_available:
info["NPU type"] = torch.npu.get_device_name()
info["CANN version"] = torch.version.cann

print("\nCopy-and-paste the text below in your GitHub issue and FILL OUT the two last points.\n")
print(self.format_dict(info))
Expand Down