Skip to content

Commit 1fe1d62

Browse files
Pathways-on-Cloud Teamcopybara-github
authored andcommitted
Internal
PiperOrigin-RevId: 948049485
1 parent 74e6ebc commit 1fe1d62

2 files changed

Lines changed: 4 additions & 23 deletions

File tree

pathwaysutils/profiling.py

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -64,25 +64,8 @@ def call_profile_executable(self) -> None:
6464
raise RuntimeError(
6565
"_call_profile_executable called with no active executable."
6666
)
67-
# If the profile request contains xprofTraceOptions, then we need to pass
68-
# out_avals and out_shardings to the executable call because the
69-
# executable will return a future that needs to be resolved. This is true
70-
# for both starting and stopping a trace.
71-
if (
72-
self.profile_request is not None
73-
and "xprofTraceOptions" in self.profile_request
74-
):
75-
out_avals = [jax.core.ShapedArray((1,), jnp.object_)]
76-
out_shardings = [
77-
getattr(
78-
jax.sharding,
79-
"make_single_device_sharding",
80-
jax.sharding.SingleDeviceSharding,
81-
)(backend.get_default_device())
82-
]
83-
else:
84-
out_avals = ()
85-
out_shardings = ()
67+
out_avals = ()
68+
out_shardings = ()
8669

8770
_, result_future = self.executable.call(
8871
out_avals=out_avals, out_shardings=out_shardings

pathwaysutils/test/profiling_test.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -389,10 +389,8 @@ def test_stop_trace_with_xprof_options_passes_out_avals(self):
389389

390390
with self.subTest("out_avals_properties"):
391391
_, kwargs = self.mock_plugin_executable_cls.return_value.call.call_args
392-
self.assertLen(kwargs["out_avals"], 1)
393-
(out_aval,) = kwargs["out_avals"]
394-
self.assertEqual(out_aval.shape, (1,))
395-
self.assertEqual(out_aval.dtype, jnp.object_)
392+
self.assertEqual(kwargs["out_avals"], ())
393+
self.assertEqual(kwargs["out_shardings"], ())
396394

397395
def test_stop_trace_before_start_error(self):
398396
with self.assertRaisesRegex(

0 commit comments

Comments
 (0)