Skip to content

[Code Health] Refresh complete HBG boundary Tensor state during affine replay #1821

Description

@high-cloud

Category

Robustness (potential edge-case failure)

Component

AICPU Scheduler

Description

Initial HBG Graph materialization copies the complete boundary Tensor descriptor for BOUNDARY_EXACT and refreshes the dynamic descriptor fields for BOUNDARY_VIEW. On affine reuse, however, the replay patch updates only payload.tensors[j].buffer.addr.

GraphBoundarySignature does not include start_offset, version, owner_task_id, or address_space. Those fields can therefore change without rejecting affine reuse, leaving the retained node payload with stale descriptor state and potentially selecting the wrong element range.

The behavior predates the A2/A3/A5 common-code extraction; PR #1813 only moved the byte-identical A2/A3 implementation into the shared HBG component.

Related: #1706, #1813

Location

  • src/common/host_build_graph/graph_execution.cpp:485
  • src/common/host_build_graph/graph_execution.cpp:567
  • src/common/host_build_graph/graph_execution.h (GraphBoundarySignature and GraphTensorAddressPatch)

Proposed Fix

Refresh the complete dynamic boundary descriptor during affine replay. Preserve the boundary source index and view offset in the patch table, then reconstruct both exact and view descriptors from the current boundary Tensor on every replay. Alternatively, include every dynamic field in the affine-reuse signature so a change forces full rematerialization.

Add regression tests for exact and view bindings where start_offset, version, owner_task_id, and address_space change between executions.

Priority

Medium (minor risk, should fix in next few releases)

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