This document is relevant for: Trn2, Trn3
nki.isa.NkiInstruction#
- class nki.isa.NkiInstruction(handle)[source]#
Opaque handle to a traced NKI instruction.
Returned by nki.isa operations during tracing. Use
.depends_on(*producers, kind=...)to add runtime or scheduling-only dependencies.Methods
Run this instruction after each producer.
- depends_on(*producers: NkiInstruction, kind: Optional[dependency] = None) NkiInstruction[source]#
Run this instruction after each producer.
kindtakes anki.isa.dependencymember.Returns self, so the two forms compose:
c.depends_on(b, a, kind=dependency.runtime) c.depends_on(b, kind=dependency.runtime).depends_on( a, kind=dependency.runtime )
Omitting
kindpreserves the previous release’s behavior and is deprecated; a future release will require it. Passkind=dependency.runtimeorkind=dependency.scheduleto choose.kind=dependency.runtimelowers to a hardware semaphore wait that orders the pair across engines. Because that wait fires unconditionally, both instructions must sit at the same dynamic-loop nesting (or the producer in an enclosing scope).kind=dependency.scheduleadds an ordering constraint for the compiler schedulers but emits no hardware synchronization. It constrains instruction issue order; instructions on different engines may still overlap.
This document is relevant for: Trn2, Trn3