Skip to content

MIOpen(HIP): Error [EvaluateInvokers] & Potential VAE Decoder Instability with Large Inputs #1571

Description

@Cynthia-lxx

Problem Description

Environment

OS: Windows 11 24H2
Hardware: AMD RX 7800M (gfx1101)
Software: PyTorch with ROCm support (2.7.0a0+git3f903c3)

Description

Two related observations while running Stable Diffusion inference (specifically image upscaling with large tile sizes using SD1.5 models):

  1. VAE Decoder Instability: Under specific conditions (handling large latent tensors, e.g., ~1024x1024+), the VAE decoder produces output tensors containing NaN (Not a Number) or Inf (Infinity) values. This seems more prevalent with SD 1.5 models and correlates with specific large input sizes.
  2. MIOpen Errors: The following error message appears frequently in the logs during these operations, often coinciding with performance hiccups (delays of a few seconds):
    MIOpen(HIP): Error [EvaluateInvokers] ... Invalid elapsed time detected

The VAE instability is the primary functional problem, leading to corrupted output. The MIOpen error might be a symptom or a separate underlying performance/validation issue.

Root Cause

The root cause is suspected to be deep within the ROCm software stack (MIOpen/HIP). The combination of large tensor dimensions specific to SD1.5 model architecture and the ROCm backend might trigger numerical instability or validation errors in certain convolution operations within the VAE decoder.

Proposed Solution

Investigate the potential root causes for:

  1. The VAE decoder producing NaN/Inf values on large inputs specifically under ROCm.
  2. The MIOpen(HIP): Error [EvaluateInvokers] ... Invalid elapsed time detected error.
    A fix at this level would prevent the invalid values from being generated in the first place, which is preferable to handling them downstream in user code.

Impact

The NaN/Inf values corrupt the output of applications (like ComfyUI & USDU) relying on stable VAE decoding. The MIOpen errors cause non-fatal but noticeable performance interruptions. Resolving this would improve the stability and user experience of PyTorch ROCm users in the generative AI space.

Operating System

Windows 11 24H2

CPU

Intel i5-13500H

GPU

AMD RX 7800M (gfx1101)

ROCm Version

ROCm 6.2

ROCm Component

No response

Steps to Reproduce

No response

(Optional for Linux users) Output of /opt/rocm/bin/rocminfo --support

No response

Additional Information

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions