Skip to content

[Bug] a5sim tensormap_and_ringbuffer chip_swimlane suite segfaults in the L2 native wait, serially, ~1 in 6 #2206

Description

@ChaoWao

Component

Host Runtime

Runtime Variant

tensormap_and_ringbuffer

Description

The five a5sim chip_swimlane cases, run as one serial session with the
swimlane and dep_gen channels on, segfault at a low rate inside the L2 native
wait. Observed once in six runs of the same command.

Fatal Python error: Segmentation fault

  File "python/simpler/worker.py", line 11585 in _wait_run_handle
  File "python/simpler/worker.py", line 4354  in wait
  File "python/simpler/worker.py", line 11227 in run
  File "simpler_setup/scene_test.py", line 1925 in _run_and_validate_l2

worker.py:11585 is return chip_run.wait(...), so the fault is inside the
native wait beneath the binding.

This is not #2121, though it is the closest relative. That issue had the same
symptom and the same deepest frame, and its root cause was AsyncWaitList
reaching the AICPU with a residual count because hbg's forked async_wait.h
had lost reset_for_reuse(). The fix (#2124) restored it for hbg and noted the
tensormap_and_ringbuffer twin already had it — and a5 tmr does:
src/a5/runtime/tensormap_and_ringbuffer/runtime/shared/runtime_init.cpp:258
calls sched->async_wait_list.reset_for_reuse() from SchedulerState::reset_for_reuse.
So this crash has a different cause.

It also differs from #2121 in three ways that narrow the search:

#2121 (fixed) this
platform a2a3sim a5sim
runtime host_build_graph tensormap_and_ringbuffer
trigger needed -n 4 reproduces serially, -p no:xdist

Not #2182 either: that one is a2a3 onboard, faults during forked-worker
init rather than in the wait, and needs a full-suite run.

The two failing case names do rhyme — #2121's was
TestSpmdSyncStartEarlyDispatchHbg and this one is
TestSyncStartEarlyLocalOwner — so the sync-start early-dispatch machinery is
worth looking at first even though the known defect in it is handled on this side.

Steps to Reproduce

python -m pytest tests/st/a5/tensormap_and_ringbuffer/dfx/chip_swimlane/ \
    --platform a5sim --enable-chip-swimlane --enable-dep-gen \
    --device 0-15 -p no:xdist --pto-session-timeout 600 --manual include -q

Observed 1 segfault in 6 runs of exactly this command. The failing case was the
fifth, TestSyncStartEarlyLocalOwner, which passes in isolation (20/20), so
the trigger is order- or timing-dependent within the session rather than
specific to that case.

Note the channel flags: a bare sweep enables no DFX channel and does not
exercise this path at all.

Expected Behavior

Five passes.

Actual Behavior

rc=139, Fatal Python error: Segmentation fault, no diagnosis left behind —
the process dies before any teardown or artifact export.

Git Commit ID

0cc51ad

NPU Kind

N/A (simulation only)

Host Platform

Linux (aarch64)

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

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions