MCPcopy Create free account
hub / github.com/pytorch/executorch / __call__

Method __call__

backends/mlx/patterns.py:222–235  ·  view source on GitHub ↗
(self, P: "MLXProgramBuilder", n: Node)

Source from the content-addressed store, hash-verified

220 )
221
222 def __call__(self, P: "MLXProgramBuilder", n: Node) -> Slot:
223 assert n == self.head
224
225 cache_slot, update_slot, start_slot = P.slot_map(
226 [self.cache, self.update, self.start_pos]
227 )
228
229 if self.ring_size > 0:
230 self._emit_ring_buffer(P, cache_slot, update_slot, start_slot)
231 else:
232 self._emit_linear(P, cache_slot, update_slot, start_slot)
233
234 P.set_slot(n, cache_slot)
235 return cache_slot
236
237 def _emit_linear(self, P: "MLXProgramBuilder", cache_slot, update_slot, start_slot):
238 """Emit a single SliceUpdate for linear (non-ring) cache."""

Callers

nothing calls this directly

Calls 4

_emit_ring_bufferMethod · 0.95
_emit_linearMethod · 0.95
slot_mapMethod · 0.80
set_slotMethod · 0.45

Tested by

no test coverage detected