MCPcopy Create free account
hub / github.com/apache/tvm / ExecContext

Class ExecContext

python/tvm/tirx/exec_context.py:378–408  ·  view source on GitHub ↗

Per-program-point compiler state: active set + scope kind + split.

Source from the content-addressed store, hash-verified

376
377@dataclass(frozen=True)
378class ExecContext:
379 """Per-program-point compiler state: active set + scope kind + split."""
380
381 A: ActiveSet
382 scope_kind: str
383 inter: dict[str, AxisRange]
384 intra: dict[str, AxisRange]
385
386 @staticmethod
387 def at_kernel_entry(*, lane_ext: int = 32, warp_ext: int, cta_ext: int = 1) -> ExecContext:
388 A = initial_A(lane_ext=lane_ext, warp_ext=warp_ext, cta_ext=cta_ext)
389 split = scope_switch(A, KERNEL)
390 return ExecContext(A=A, scope_kind=KERNEL, inter=split.inter, intra=split.intra)
391
392 def with_filter(self, binding: LaneBinding, lo: int, hi: int) -> ExecContext:
393 new_A = filter_narrow(self.A, binding, lo, hi)
394 split = scope_switch(new_A, self.scope_kind)
395 return ExecContext(
396 A=new_A, scope_kind=self.scope_kind, inter=split.inter, intra=split.intra
397 )
398
399 def with_cta_axis_modulo(self, axis: str, modulus: int, residue: int) -> ExecContext:
400 new_A = filter_modulo(self.A, axis, modulus, residue)
401 split = scope_switch(new_A, self.scope_kind)
402 return ExecContext(
403 A=new_A, scope_kind=self.scope_kind, inter=split.inter, intra=split.intra
404 )
405
406 def with_scope_switch(self, scope_kind: str) -> ExecContext:
407 split = scope_switch(self.A, scope_kind)
408 return ExecContext(A=self.A, scope_kind=scope_kind, inter=split.inter, intra=split.intra)

Callers 4

at_kernel_entryMethod · 0.85
with_filterMethod · 0.85
with_cta_axis_moduloMethod · 0.85
with_scope_switchMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…