Skip to content

Commit 118d667

Browse files
felipemello1Felipe Mello
andauthored
[easy] FORGE_DISABLE_METRICS also disables Tracer (meta-pytorch#366)
* <Replace this line with a title. Use 1 line only, 67 chars or less> Summary: Test Plan: Reviewers: Subscribers: Tasks: Tags: * fix logic * add lower --------- Co-authored-by: Felipe Mello <[email protected]>
1 parent 4210277 commit 118d667

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/forge/observability/perf_tracker.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@
1515

1616
import torch
1717

18-
from forge.env_constants import DISABLE_PERF_METRICS, METRIC_TIMER_USES_GPU
18+
from forge.env_constants import (
19+
DISABLE_PERF_METRICS,
20+
FORGE_DISABLE_METRICS,
21+
METRIC_TIMER_USES_GPU,
22+
)
1923
from forge.observability.metrics import record_metric, Reduce
2024

2125
logger = logging.getLogger(__name__)
@@ -108,7 +112,10 @@ def __init__(
108112
self.prefix = prefix
109113
self.track_memory = track_memory
110114
self.time_with_gpu = timer == "gpu"
111-
self._disable = os.getenv(DISABLE_PERF_METRICS, "false") == "true"
115+
self._disable = (
116+
os.getenv(DISABLE_PERF_METRICS, "false").lower() == "true"
117+
or os.getenv(FORGE_DISABLE_METRICS, "false").lower() == "true"
118+
)
112119
self._active = False
113120

114121
# Timing state

0 commit comments

Comments
 (0)