Skip to content

[Assembler] Identity pto.tmov (dst == src) causes spurious sync insertion, hanging on A5 #421

@Hzfengsy

Description

@Hzfengsy

When a pto.tmov instruction has the same source and destination (identity move), ptoas still treats it as a data-movement op and inserts sync instructions around it. These spurious syncs cause synchronization errors that hang the kernel on A5. The same code passes on A3 due to different sync behavior between the two platforms.

Root Cause

ptoas unconditionally inserts sync instructions around every pto.tmov. When the tmov is a no-op (dst == src), the syncs are unnecessary and harmful.

Suggested Fix

ptoas should detect identity pto.tmov instructions (where source and destination resolve to the same address/MemRef) and either:

  1. Skip sync insertion for identity moves, or
  2. Eliminate identity pto.tmov instructions entirely

Reproducer

fa5_softmax_rescale.py

Related

Note

A complementary fix has been applied on the pypto side (hw-native-sys/pypto#836) to avoid emitting identity pto.tmov in the first place. However, ptoas should still handle this case defensively.

Metadata

Metadata

Labels

Type

No type

Projects

Status

In Progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions