Skip to content

TensorView::computeAt() recursive traversal is non-deterministic #41

@tlemo

Description

@tlemo

TensorView::computeAt() is propagating to all the uses of the same producer:

for (Expr* other_use : FusionGuard::getCurFusion()->uses(this)) {

The problem is that Fusion::uses() returns a std::set<Expr*>:

std::set<Expr*> Fusion::uses(Val* val) const {

std::set normally offers a predictable (sorted) order of values, but in this case the keys are Expr*, which are non-deterministic. This is an issue since the order of computeAt() traversal changes the end results.

This issue manifested as a failure of a unit test triggered by an unrelated change in a different unit test (but which impacted the heap layout as a side effect).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions