Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions arraycontext/impl/pytato/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -546,10 +546,9 @@ def _to_frozen(key: tuple[Any, ...], ary) -> TaggableCLArray:
self._dag_transform_cache[normalized_expr])

assert len(pt_prg.bound_arguments) == 0
evt, out_dict = pt_prg(self.queue,
_evt, out_dict = pt_prg(self.queue,
allocator=self.allocator,
**bound_arguments)
evt.wait()
assert len(set(out_dict) & set(key_to_frozen_subary)) == 0

key_to_frozen_subary = {
Expand Down
14 changes: 2 additions & 12 deletions arraycontext/impl/pytato/compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -636,15 +636,10 @@ def __call__(self, arg_id_to_arg) -> ArrayContainer:
input_kwargs_for_loopy = _args_to_device_buffers(
self.actx, self.input_id_to_name_in_program, arg_id_to_arg, fn_name)

evt, out_dict = self.pytato_program(queue=self.actx.queue,
_evt, out_dict = self.pytato_program(queue=self.actx.queue,
allocator=self.actx.allocator,
**input_kwargs_for_loopy)

# FIXME Kernels (for now) allocate tons of memory in temporaries. If we
# race too far ahead with enqueuing, there is a distinct risk of
# running out of memory. This mitigates that risk a bit, for now.
evt.wait()

def to_output_template(keys, _):
name_in_program = self.output_id_to_name_in_program[keys]
return self.actx.thaw(to_tagged_cl_array(
Expand Down Expand Up @@ -680,15 +675,10 @@ def __call__(self, arg_id_to_arg) -> ArrayContainer:
input_kwargs_for_loopy = _args_to_device_buffers(
self.actx, self.input_id_to_name_in_program, arg_id_to_arg, fn_name)

evt, out_dict = self.pytato_program(queue=self.actx.queue,
_evt, out_dict = self.pytato_program(queue=self.actx.queue,
allocator=self.actx.allocator,
**input_kwargs_for_loopy)

# FIXME Kernels (for now) allocate tons of memory in temporaries. If we
# race too far ahead with enqueuing, there is a distinct risk of
# running out of memory. This mitigates that risk a bit, for now.
evt.wait()

return self.actx.thaw(to_tagged_cl_array(out_dict[self.output_name],
axes=get_cl_axes_from_pt_axes(
self.output_axes),
Expand Down
Loading