Skip to content

Commit 4ab1514

Browse files
committed
Pytato exec: don't wait
1 parent 4aeaed4 commit 4ab1514

File tree

2 files changed

+3
-14
lines changed

2 files changed

+3
-14
lines changed

arraycontext/impl/pytato/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -546,10 +546,9 @@ def _to_frozen(key: tuple[Any, ...], ary) -> TaggableCLArray:
546546
self._dag_transform_cache[normalized_expr])
547547

548548
assert len(pt_prg.bound_arguments) == 0
549-
evt, out_dict = pt_prg(self.queue,
549+
_evt, out_dict = pt_prg(self.queue,
550550
allocator=self.allocator,
551551
**bound_arguments)
552-
evt.wait()
553552
assert len(set(out_dict) & set(key_to_frozen_subary)) == 0
554553

555554
key_to_frozen_subary = {

arraycontext/impl/pytato/compile.py

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -636,15 +636,10 @@ def __call__(self, arg_id_to_arg) -> ArrayContainer:
636636
input_kwargs_for_loopy = _args_to_device_buffers(
637637
self.actx, self.input_id_to_name_in_program, arg_id_to_arg, fn_name)
638638

639-
evt, out_dict = self.pytato_program(queue=self.actx.queue,
639+
_evt, out_dict = self.pytato_program(queue=self.actx.queue,
640640
allocator=self.actx.allocator,
641641
**input_kwargs_for_loopy)
642642

643-
# FIXME Kernels (for now) allocate tons of memory in temporaries. If we
644-
# race too far ahead with enqueuing, there is a distinct risk of
645-
# running out of memory. This mitigates that risk a bit, for now.
646-
evt.wait()
647-
648643
def to_output_template(keys, _):
649644
name_in_program = self.output_id_to_name_in_program[keys]
650645
return self.actx.thaw(to_tagged_cl_array(
@@ -680,15 +675,10 @@ def __call__(self, arg_id_to_arg) -> ArrayContainer:
680675
input_kwargs_for_loopy = _args_to_device_buffers(
681676
self.actx, self.input_id_to_name_in_program, arg_id_to_arg, fn_name)
682677

683-
evt, out_dict = self.pytato_program(queue=self.actx.queue,
678+
_evt, out_dict = self.pytato_program(queue=self.actx.queue,
684679
allocator=self.actx.allocator,
685680
**input_kwargs_for_loopy)
686681

687-
# FIXME Kernels (for now) allocate tons of memory in temporaries. If we
688-
# race too far ahead with enqueuing, there is a distinct risk of
689-
# running out of memory. This mitigates that risk a bit, for now.
690-
evt.wait()
691-
692682
return self.actx.thaw(to_tagged_cl_array(out_dict[self.output_name],
693683
axes=get_cl_axes_from_pt_axes(
694684
self.output_axes),

0 commit comments

Comments
 (0)