Skip to content

CachedXRTRuntime: context-cache eviction degrades later kernels in multi-xclbin processes #175

Description

@bong-water-water-bong

Severity: MEDIUM/HIGH — non-deterministic garbage after context churn. Verified on Strix Halo (NPU2, XRT 2.21.75).

Running several different xclbins in one process (each op compiling its own AIEContexthw_context) degrades execution: after the LRU cache evicts entries, later kernels return garbage while the ERT state still reports ERT_CMD_STATE_COMPLETED. Repro: compile+run 4+ different GEMM/AXPY ops sequentially in one Python process — the first op is exact, later ones produce wrong values; each op alone in a fresh process is exact.

CachedXRTRuntime has an npu2 single-entry _evict() path (the npu1 path has a documented "full drain" workaround for the same class of problem). The npu2 eviction leaves the device in a state where subsequent dispatches execute incorrectly. Suspect stale instruction/context state after eviction; needs a driver-level repro (possibly tied to the group_id binding issue).

Workaround used for measurements: one op per process.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions