ROCm / ROCm/AMDMIGraphX

Non-standard reshape fail during reshape_lazy lowering

Open
#2,419 4 comments 0 reactions 1 assignee View on GitHub

@bpickrel is already working on this.

Since Nov 30, 2023.

  • #2038 by @kahmed10 — closed without merging
Dominant language
C++
Stars
333
Forks
150
Avg merge
4d 19h
Merged PRs (30d)
54

Description

AWSRN-BAM fails with the following:

migraphx-driver: /code/AMDMIGraphX/src/targets/gpu/lowering.cpp:76: void migraphx::gpu::miopen_apply::check_shape(shape, instruction_ref): Assertion 'x == i->get_shape()' failed.

This script can be used for creating the model.

The issue occures during lowering:

BEFORE
@619 = gpu::precompile_op[op=pointwise,additional_args=1,ignore_modules=0](@571,@617,@599,@615,@145,@618), [main:pointwise127] -> float_type, {1, 3, 85, 2, 85, 2}, {86700, 28900, 85, 14450, 1, 7225}, target_id=0
@620 = reshape[dims={1, 3, 170, 170}](@619) -> float_type, {1, 3, 170, 170}, {86700, 28900, 14450, 7225}, target_id=0
@621 = @return(@620), target_id=0

AFTER
@619 = gpu::precompile_op[op=pointwise,additional_args=1,ignore_modules=0](@571,@617,@599,@615,@145,@618), [main:pointwise127] -> float_type, {1, 3, 85, 2, 85, 2}, {86700, 28900, 85, 14450, 1, 7225}, target_id=0
@620 = allocate[shape=float_type, {1, 3, 85, 2, 85, 2}, {86700, 28900, 85, 14450, 1, 7225},buf_type=nullopt] -> float_type, {1, 3, 85, 2, 85, 2}, {86700, 28900, 85, 14450, 1, 7225}, target_id=0
@621 = gpu::contiguous(@619,@620) -> float_type, {1, 3, 85, 2, 85, 2}, {86700, 28900, 340, 170, 2, 1}, target_id=0
@622 = allocate[shape=float_type, {1, 3, 170, 170}, {86700, 28900, 170, 1},buf_type=nullopt] -> float_type, {1, 3, 170, 170}, {86700, 28900, 170, 1}, target_id=0
@623 = reshape_lazy[dims={1, 3, 170, 170}](@621) -> float_type, {1, 3, 170, 170}, {86700, 28900, 170, 1}, target_id=0
@624 = gpu::contiguous(@623,@622) -> float_type, {1, 3, 170, 170}, {86700, 28900, 170, 1}, target_id=0
@625 = @return(@624), target_id=0

The original reshape is in non-standard format. The gpu::contiguous which is added by add_reshape_lazy_op is in standard format.

{1, 3, 170, 170}, {86700, 28900, 14450, 7225} // before
{1, 3, 170, 170}, {86700, 28900, 170, 1} // after

cc @causten @pfultz2

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.