Skip to content

Chess (xchesscc) AIE2P cores time out under raw xrt boot while Peano cores complete (NPU2) #3690

Description

@bong-water-water-bong

Summary

Chess-built (xchesscc) AIE2P cores time out under the raw xrt boot (ERT_CMD_STATE_TIMEOUT) that mlir-aie/IRON's runtime uses, while Peano-built cores from the identical design complete. This holds for every core style tried: the xbridge/me-runtime link, the bare peano-lld link (--xbridge=false), and with the chess_intrinsic_wrapper fences/schedulers removed. The NPU transaction buffer (.bin) is byte-identical between the working Peano and hanging Chess builds, so host-side control is identical; the difference is entirely inside the chess-compiled core ELF.

Environment

  • mlir-aie: 1.4.2.dev16+g7e00b57 wheel (also reproduced intent with the v1.4.2 tag built from source)
  • llvm-aie: 22.0.0.2026082001+84660bc3
  • Vitis AIE tools: 2025.2 (aie2ps target; aie2p name aliased to aie2ps) and 2026.1 — same hang on both
  • Device: Ryzen AI NPU2 (npu2_40, AIE2P), Linux, xrt
  • IRON: amd/IRON, --compiler chess, silu operator test (single column)

Repro

export AIETOOLS_ROOT=<vitis>/aietools
export PATH=$AIETOOLS_ROOT/bin:<mlir_aie>/bin:<llvm-aie>/bin:$PATH   # llvm-aie bin provides `clang` for the bare link
export XILINXD_LICENSE_FILE=<lic>
cd <IRON>
python -m pytest iron/operators/silu/test.py::test_silu[iter0-input_length_1024-num_aie_columns_1-num_channels_1-tile_size_1024] \
    --compiler chess

Compilation succeeds end-to-end (front-end -> me/bare link -> xclbin). The kernel loads and starts, then the ERT command never completes:
HostRuntimeError: Kernel returned ert_cmd_state.ERT_CMD_STATE_TIMEOUT
The identical test with --compiler peano passes.

Evidence

  1. The txn is identical: cmp on the generated *.npu2.bin (the NPU instruction/control buffer) between peano and chess runs = byte-identical (300 B for this design). So the host boots the cores identically.

  2. Chess core ELFs (all hang) vs peano core ELF (works) for the same design:

    • peano (bare, clang): 1,956 B; __start (32 B) -> main; objectFifo acquire inlined as acq #51,-1 / acq #48,-1, releases rel #50,1 / rel #49,1.
    • chess xbridge (me-runtime, libme): 12,048 B; _main_init ctor/init prelude before main; acquire via llvm___aie2p___acquire wrapper -> plain acq r0,r1 with the same lock ids/values.
    • chess bare (peano-lld link of chess objects, me-primitive stubs, --xbridge=false): 5,444 B; no me runtime; same wrapper-based acquire with same lock ids/values.
    • chess bare with the wrapper's llvm.chess_memory_fence / chess_separator_scheduler calls removed: still hangs.
  3. The core design is an infinite server loop (scf.for to 2^63-1); the ERT completes via the shim-DMA drain after the core consumes one tile. A hang therefore means the core never completes its first acquire/compute/release cycle (or never starts). Peano proves the protocol works with these exact lock values.

  4. llvm-objdump decodes peano cores fully but prints <unknown> for many chess VLIW bundles — a chess-specific disassembler or the ISS is needed to inspect the chess main loop. (--get-aiesim, per Tests that still require Chess after #3451, and what each one is waiting on #3479, would be the right tool, but the pip/dev16 aiecc predates it and the current-main aiecc cannot parse the dev16-era IRON design MLIR because aie.objectfifosubview was removed upstream.)

Expected behavior

Chess-compiled cores should run under the same xrt boot as peano cores, or the chess+device path should explicitly refuse/diagnose rather than hanging.

Suspected areas

  • Chess (me-product) codegen emits instructions/metadata (.tctmemtab, .rtstab, .eoltab, .chesstypeannotationtab, me_primitive::* references) that assume the aiecompiler/EV boot environment; the raw xrt core-ELF boot (what IRON/peano uses) may not establish whatever the chess code expects.
  • Or a chess codegen sequence executes incorrectly on real silicon (needs ISS to confirm vs hypothesis above).

Happy to provide artifacts (both core ELFs, the work dir, full logs) and to test any candidate fix or patch.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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