Skip to content

Commit 3aa8c4d

Browse files
amirafzalifacebook-github-bot
authored andcommitted
migrate existing log callsites
Summary: **Diff Purpose & Changes** Now that we have the library log function, let's migrate existing usages over. Reviewed By: colin2328 Differential Revision: D72941480 fbshipit-source-id: a39e1dfad8e9f6dfd0d2c8ee429b04ed04065bb1
1 parent c9417ed commit 3aa8c4d

File tree

4 files changed

+5
-15
lines changed

4 files changed

+5
-15
lines changed

python/monarch/parallel/pipelining/runtime.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@
3535
logger = getLogger()
3636

3737

38-
log = remote("monarch.worker.worker.log", propagate="inspect")
39-
4038
run_forward_udf = remote(
4139
"monarch.parallel.pipelining.runtime.run_forward_impl",
4240
propagate=lambda stage, input_tensor, model_chunk_id, microbatch_id: input_tensor,

python/monarch/worker/worker.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,6 @@
5454
CONTROLLER_COMPILED_REPEAT = True
5555

5656

57-
def log(*args):
58-
logger.warning(*args)
59-
60-
6157
def set_worker_logging_level(level):
6258
logger.setLevel(level)
6359

python/tests/test_coalescing.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@ def _do_bogus_tensor_work(x, y, fail_rank=None):
3535
propagate=_do_bogus_tensor_work,
3636
)
3737

38-
log = remote("monarch.worker.worker.log", propagate="inspect")
39-
4038

4139
def inspect(x):
4240
return fetch_shard(x).result().item()

python/tests/test_remote_functions.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
Stream,
2424
)
2525
from monarch._testing import BackendType, TestingContext
26+
from monarch.builtins.log import log_remote
2627
from monarch.cached_remote_function import remote_autograd_function
2728
from monarch.common import remote as remote_module
2829
from monarch.common.device_mesh import DeviceMesh
@@ -60,9 +61,6 @@ def custom_excepthook(exc_type, exc_value, exc_traceback):
6061
sys.excepthook = custom_excepthook
6162

6263

63-
log = remote("monarch.worker.worker.log", propagate="inspect")
64-
65-
6664
def _set_device_udf(*args):
6765
return torch.zeros(1)
6866

@@ -306,7 +304,7 @@ def do_test_all_reduce(cls, backend_type, reduce_op, expected_tensor):
306304

307305
def test_hello(self, backend_type):
308306
with self.local_device_mesh(2, 2, backend_type):
309-
log("hello, world")
307+
log_remote("hello, world")
310308

311309
def test_eager_remote_function_failed(self, backend_type):
312310
if backend_type == BackendType.PY:
@@ -335,15 +333,15 @@ def test_simple_tensors(self, backend_type):
335333
with self.local_device_mesh(2, 2, backend_type):
336334
x = torch.rand(3, 4)
337335
y = x + x
338-
log("%s %s", x, y)
336+
log_remote("%s %s", x, y)
339337
z = torch.std_mean(x)
340-
log("%s", z)
338+
log_remote("%s", z)
341339

342340
def test_user_call(self, backend_type):
343341
with self.local_device_mesh(2, 2, backend_type) as _:
344342
x = torch.rand(3, 4)
345343
y = rlist((x + 1, x))
346-
log("%s", y)
344+
log_remote("%s", y)
347345

348346
# resume monday:
349347
# 1. tensor ctor resource guard (done)

0 commit comments

Comments
 (0)