Skip to content

[torch vitals] Initial implementation#51047

Closed
bwasti wants to merge 1 commit intopytorch:masterfrom
bwasti:export-D25791248
Closed

[torch vitals] Initial implementation#51047
bwasti wants to merge 1 commit intopytorch:masterfrom
bwasti:export-D25791248

Conversation

@bwasti
Copy link
Copy Markdown
Contributor

@bwasti bwasti commented Jan 25, 2021

Summary:
If the environment variable TORCH_VITAL is set to a non-zero length string, the vitals a dumped at program end.

The API is very similar to google's logging

Test Plan: buck test //caffe2/aten:vitals

Reviewed By: bitfort

Differential Revision: D25791248

Summary:
If the environment variable `TORCH_VITAL` is set to a non-zero length string, the vitals a dumped at program end.

The API is very similar to google's logging

Test Plan: buck test //caffe2/aten:vitals

Reviewed By: bitfort

Differential Revision: D25791248

fbshipit-source-id: f46b74ecab915619b973adb3187074b9efa0897e
@facebook-github-bot
Copy link
Copy Markdown
Contributor

facebook-github-bot commented Jan 25, 2021

💊 CI failures summary and remediations

As of commit 945081e (more details on the Dr. CI page):


  • 2/2 failures possibly* introduced in this PR
    • 2/2 non-CircleCI failure(s)

This comment was automatically generated by Dr. CI (expand for details).Follow this link to opt-out of these comments for your Pull Requests.

Please report bugs/suggestions to the (internal) Dr. CI Users group.

@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request was exported from Phabricator. Differential Revision: D25791248

@codecov
Copy link
Copy Markdown

codecov Bot commented Jan 26, 2021

Codecov Report

Merging #51047 (945081e) into master (ac0a3cc) will decrease coverage by 0.00%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##           master   #51047      +/-   ##
==========================================
- Coverage   80.92%   80.91%   -0.01%     
==========================================
  Files        1926     1928       +2     
  Lines      210019   210033      +14     
==========================================
+ Hits       169950   169953       +3     
- Misses      40069    40080      +11     

@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request has been merged in 069602e.

@malfet malfet mentioned this pull request Mar 26, 2026
malfet added a commit that referenced this pull request Mar 26, 2026
TorchVitals was an undocumented feature gated behind the TORCH_VITAL
environment variable that allowed setting and reading key-value "vital
signs" (e.g. whether CUDA or DataLoader was used). It was never
documented and the test itself had a "FIXME: document or deprecate"
comment.

Originally added in PR #51047 (Jan 2021), with a Python API in #53238
and a CUDA vital in #58059. There have been no feature changes since
June 2021 — all subsequent commits were mechanical cleanups (clang-tidy,
thread-safe getenv, etc.).

A search on cs.github.com and general web search confirmed no external
projects depend on torch.set_vital, torch.read_vitals, or
torch.vitals_enabled — usage was limited to pytorch/pytorch itself.

Authored with Claude.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
ghstack-source-id: b56228f
Pull-Request: #178479
malfet added a commit that referenced this pull request Mar 26, 2026
TorchVitals was an undocumented feature gated behind the TORCH_VITAL
environment variable that allowed setting and reading key-value "vital
signs" (e.g. whether CUDA or DataLoader was used). It was never
documented and the test itself had a "FIXME: document or deprecate"
comment.

Originally added in PR #51047 (Jan 2021), with a Python API in #53238
and a CUDA vital in #58059. There have been no feature changes since
June 2021 — all subsequent commits were mechanical cleanups (clang-tidy,
thread-safe getenv, etc.).

A search on cs.github.com and general web search confirmed no external
projects depend on torch.set_vital, torch.read_vitals, or
torch.vitals_enabled — usage was limited to pytorch/pytorch itself.

Authored with Claude.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
ghstack-source-id: 372adae
Pull-Request: #178479
malfet added a commit that referenced this pull request Mar 26, 2026
TorchVitals was an undocumented feature gated behind the TORCH_VITAL
environment variable that allowed setting and reading key-value "vital
signs" (e.g. whether CUDA or DataLoader was used). It was never
documented and the test itself had a "FIXME: document or deprecate"
comment.

Originally added in PR #51047 (Jan 2021), with a Python API in #53238
and a CUDA vital in #58059. There have been no feature changes since
June 2021 — all subsequent commits were mechanical cleanups (clang-tidy,
thread-safe getenv, etc.).

A search on cs.github.com and general web search confirmed no external
projects depend on torch.set_vital, torch.read_vitals, or
torch.vitals_enabled — usage was limited to pytorch/pytorch itself.

Authored with Claude.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
ghstack-source-id: 1c33462
Pull-Request: #178479
malfet added a commit that referenced this pull request Mar 26, 2026
TorchVitals was an undocumented feature gated behind the TORCH_VITAL
environment variable that allowed setting and reading key-value "vital
signs" (e.g. whether CUDA or DataLoader was used). It was never
documented and the test itself had a "FIXME: document or deprecate"
comment.

Originally added in PR #51047 (Jan 2021), with a Python API in #53238
and a CUDA vital in #58059. There have been no feature changes since
June 2021 — all subsequent commits were mechanical cleanups (clang-tidy,
thread-safe getenv, etc.).

A search on cs.github.com and general web search confirmed no external
projects depend on torch.set_vital, torch.read_vitals, or
torch.vitals_enabled — usage was limited to pytorch/pytorch itself.

Authored with Claude.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
ghstack-source-id: 65c136a
Pull-Request: #178479
malfet added a commit that referenced this pull request Mar 26, 2026
TorchVitals was an undocumented feature gated behind the TORCH_VITAL
environment variable that allowed setting and reading key-value "vital
signs" (e.g. whether CUDA or DataLoader was used). It was never
documented and the test itself had a "FIXME: document or deprecate"
comment.

Originally added in PR #51047 (Jan 2021), with a Python API in #53238
and a CUDA vital in #58059. There have been no feature changes since
June 2021 — all subsequent commits were mechanical cleanups (clang-tidy,
thread-safe getenv, etc.).

A search on cs.github.com and general web search confirmed no external
projects depend on torch.set_vital, torch.read_vitals, or
torch.vitals_enabled — usage was limited to pytorch/pytorch itself.

Authored with Claude.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
ghstack-source-id: 160ae2f
Pull-Request: #178479
pytorchmergebot pushed a commit that referenced this pull request Mar 26, 2026
TorchVitals was an undocumented feature gated behind the TORCH_VITAL
environment variable that allowed setting and reading key-value "vital
signs" (e.g. whether CUDA or DataLoader was used). It was never
documented and the test itself had a "FIXME: document or deprecate"
comment.

Originally added in PR #51047 (Jan 2021), with a Python API in #53238
and a CUDA vital in #58059. There have been no feature changes since
June 2021 — all subsequent commits were mechanical cleanups (clang-tidy,
thread-safe getenv, etc.).

A search on cs.github.com and general web search confirmed no external
projects depend on torch.set_vital, torch.read_vitals, or
torch.vitals_enabled — usage was limited to pytorch/pytorch itself.

Authored with Claude.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

Pull Request resolved: #178479
Approved by: https://github.com/msaroufim, https://github.com/albanD
Copilot AI pushed a commit that referenced this pull request Mar 27, 2026
TorchVitals was an undocumented feature gated behind the TORCH_VITAL
environment variable that allowed setting and reading key-value "vital
signs" (e.g. whether CUDA or DataLoader was used). It was never
documented and the test itself had a "FIXME: document or deprecate"
comment.

Originally added in PR #51047 (Jan 2021), with a Python API in #53238
and a CUDA vital in #58059. There have been no feature changes since
June 2021 — all subsequent commits were mechanical cleanups (clang-tidy,
thread-safe getenv, etc.).

A search on cs.github.com and general web search confirmed no external
projects depend on torch.set_vital, torch.read_vitals, or
torch.vitals_enabled — usage was limited to pytorch/pytorch itself.

Authored with Claude.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

Pull Request resolved: #178479
Approved by: https://github.com/msaroufim, https://github.com/albanD

Co-authored-by: Xia-Weiwen <12522207+Xia-Weiwen@users.noreply.github.com>
AaronWang04 pushed a commit to AaronWang04/pytorch that referenced this pull request Mar 31, 2026
TorchVitals was an undocumented feature gated behind the TORCH_VITAL
environment variable that allowed setting and reading key-value "vital
signs" (e.g. whether CUDA or DataLoader was used). It was never
documented and the test itself had a "FIXME: document or deprecate"
comment.

Originally added in PR pytorch#51047 (Jan 2021), with a Python API in pytorch#53238
and a CUDA vital in pytorch#58059. There have been no feature changes since
June 2021 — all subsequent commits were mechanical cleanups (clang-tidy,
thread-safe getenv, etc.).

A search on cs.github.com and general web search confirmed no external
projects depend on torch.set_vital, torch.read_vitals, or
torch.vitals_enabled — usage was limited to pytorch/pytorch itself.

Authored with Claude.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

Pull Request resolved: pytorch#178479
Approved by: https://github.com/msaroufim, https://github.com/albanD
pytorch-bot Bot pushed a commit that referenced this pull request Apr 2, 2026
TorchVitals was an undocumented feature gated behind the TORCH_VITAL
environment variable that allowed setting and reading key-value "vital
signs" (e.g. whether CUDA or DataLoader was used). It was never
documented and the test itself had a "FIXME: document or deprecate"
comment.

Originally added in PR #51047 (Jan 2021), with a Python API in #53238
and a CUDA vital in #58059. There have been no feature changes since
June 2021 — all subsequent commits were mechanical cleanups (clang-tidy,
thread-safe getenv, etc.).

A search on cs.github.com and general web search confirmed no external
projects depend on torch.set_vital, torch.read_vitals, or
torch.vitals_enabled — usage was limited to pytorch/pytorch itself.

Authored with Claude.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

Pull Request resolved: #178479
Approved by: https://github.com/msaroufim, https://github.com/albanD
malfet added a commit that referenced this pull request Apr 2, 2026
TorchVitals was an undocumented feature gated behind the TORCH_VITAL
environment variable that allowed setting and reading key-value "vital
signs" (e.g. whether CUDA or DataLoader was used). It was never
documented and the test itself had a "FIXME: document or deprecate"
comment.

Originally added in PR #51047 (Jan 2021), with a Python API in #53238
and a CUDA vital in #58059. There have been no feature changes since
June 2021 — all subsequent commits were mechanical cleanups (clang-tidy,
thread-safe getenv, etc.).

A search on cs.github.com and general web search confirmed no external
projects depend on torch.set_vital, torch.read_vitals, or
torch.vitals_enabled — usage was limited to pytorch/pytorch itself.

Authored with Claude.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
ghstack-source-id: 46b1a3d
Pull-Request: #178479
malfet added a commit that referenced this pull request Apr 2, 2026
TorchVitals was an undocumented feature gated behind the TORCH_VITAL
environment variable that allowed setting and reading key-value "vital
signs" (e.g. whether CUDA or DataLoader was used). It was never
documented and the test itself had a "FIXME: document or deprecate"
comment.

Originally added in PR #51047 (Jan 2021), with a Python API in #53238
and a CUDA vital in #58059. There have been no feature changes since
June 2021 — all subsequent commits were mechanical cleanups (clang-tidy,
thread-safe getenv, etc.).

A search on cs.github.com and general web search confirmed no external
projects depend on torch.set_vital, torch.read_vitals, or
torch.vitals_enabled — usage was limited to pytorch/pytorch itself.

Authored with Claude.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
ghstack-source-id: 46b1a3d
Pull-Request: #178479
pytorchmergebot pushed a commit that referenced this pull request Apr 3, 2026
TorchVitals was an undocumented feature gated behind the TORCH_VITAL
environment variable that allowed setting and reading key-value "vital signs" (e.g. whether CUDA or DataLoader was used). It was never documented and the test itself had a "FIXME: document or deprecate" comment.

Originally added in PR #51047 (Jan 2021), with a Python API in #53238 and a CUDA vital in #58059. There have been no feature changes since June 2021 — all subsequent commits were mechanical cleanups (clang-tidy,
thread-safe getenv, etc.).

Update: `torch.set_vital` was used from TorchData (see meta-pytorch/data#1537 ) so will keep the dummy API around

Authored with Claude.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

Pull Request resolved: #178479
Approved by: https://github.com/msaroufim, https://github.com/albanD, https://github.com/mlazos
IvanKobzarev pushed a commit to IvanKobzarev/pytorch that referenced this pull request Apr 3, 2026
TorchVitals was an undocumented feature gated behind the TORCH_VITAL
environment variable that allowed setting and reading key-value "vital
signs" (e.g. whether CUDA or DataLoader was used). It was never
documented and the test itself had a "FIXME: document or deprecate"
comment.

Originally added in PR pytorch#51047 (Jan 2021), with a Python API in pytorch#53238
and a CUDA vital in pytorch#58059. There have been no feature changes since
June 2021 — all subsequent commits were mechanical cleanups (clang-tidy,
thread-safe getenv, etc.).

A search on cs.github.com and general web search confirmed no external
projects depend on torch.set_vital, torch.read_vitals, or
torch.vitals_enabled — usage was limited to pytorch/pytorch itself.

Authored with Claude.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

Pull Request resolved: pytorch#178479
Approved by: https://github.com/msaroufim, https://github.com/albanD
weifengpy pushed a commit that referenced this pull request Apr 7, 2026
TorchVitals was an undocumented feature gated behind the TORCH_VITAL
environment variable that allowed setting and reading key-value "vital signs" (e.g. whether CUDA or DataLoader was used). It was never documented and the test itself had a "FIXME: document or deprecate" comment.

Originally added in PR #51047 (Jan 2021), with a Python API in #53238 and a CUDA vital in #58059. There have been no feature changes since June 2021 — all subsequent commits were mechanical cleanups (clang-tidy,
thread-safe getenv, etc.).

Update: `torch.set_vital` was used from TorchData (see meta-pytorch/data#1537 ) so will keep the dummy API around

Authored with Claude.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

Pull Request resolved: #178479
Approved by: https://github.com/msaroufim, https://github.com/albanD, https://github.com/mlazos
nklshy-aws pushed a commit to nklshy-aws/pytorch that referenced this pull request Apr 7, 2026
TorchVitals was an undocumented feature gated behind the TORCH_VITAL
environment variable that allowed setting and reading key-value "vital
signs" (e.g. whether CUDA or DataLoader was used). It was never
documented and the test itself had a "FIXME: document or deprecate"
comment.

Originally added in PR pytorch#51047 (Jan 2021), with a Python API in pytorch#53238
and a CUDA vital in pytorch#58059. There have been no feature changes since
June 2021 — all subsequent commits were mechanical cleanups (clang-tidy,
thread-safe getenv, etc.).

A search on cs.github.com and general web search confirmed no external
projects depend on torch.set_vital, torch.read_vitals, or
torch.vitals_enabled — usage was limited to pytorch/pytorch itself.

Authored with Claude.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

Pull Request resolved: pytorch#178479
Approved by: https://github.com/msaroufim, https://github.com/albanD
nklshy-aws pushed a commit to nklshy-aws/pytorch that referenced this pull request Apr 7, 2026
TorchVitals was an undocumented feature gated behind the TORCH_VITAL
environment variable that allowed setting and reading key-value "vital signs" (e.g. whether CUDA or DataLoader was used). It was never documented and the test itself had a "FIXME: document or deprecate" comment.

Originally added in PR pytorch#51047 (Jan 2021), with a Python API in pytorch#53238 and a CUDA vital in pytorch#58059. There have been no feature changes since June 2021 — all subsequent commits were mechanical cleanups (clang-tidy,
thread-safe getenv, etc.).

Update: `torch.set_vital` was used from TorchData (see meta-pytorch/data#1537 ) so will keep the dummy API around

Authored with Claude.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

Pull Request resolved: pytorch#178479
Approved by: https://github.com/msaroufim, https://github.com/albanD, https://github.com/mlazos
pytorch-bot Bot pushed a commit that referenced this pull request Apr 10, 2026
TorchVitals was an undocumented feature gated behind the TORCH_VITAL
environment variable that allowed setting and reading key-value "vital signs" (e.g. whether CUDA or DataLoader was used). It was never documented and the test itself had a "FIXME: document or deprecate" comment.

Originally added in PR #51047 (Jan 2021), with a Python API in #53238 and a CUDA vital in #58059. There have been no feature changes since June 2021 — all subsequent commits were mechanical cleanups (clang-tidy,
thread-safe getenv, etc.).

Update: `torch.set_vital` was used from TorchData (see meta-pytorch/data#1537 ) so will keep the dummy API around

Authored with Claude.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

Pull Request resolved: #178479
Approved by: https://github.com/msaroufim, https://github.com/albanD, https://github.com/mlazos
laurentdupin pushed a commit to laurentdupin/pytorch that referenced this pull request Apr 24, 2026
Summary:
Pull Request resolved: pytorch#51047

If the environment variable `TORCH_VITAL` is set to a non-zero length string, the vitals a dumped at program end.

The API is very similar to google's logging

Test Plan: buck test //caffe2/aten:vitals

Reviewed By: bitfort

Differential Revision: D25791248

fbshipit-source-id: 0b40da7d22c31d2c4b2094f0dcb1229a35338ac2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants