prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  nv-sd CI test failure
  The Nightly CI for https://github.com/microsoft/DeepSpeed/actions/runs/7434747598 failed.
  
  
  </issue>
  <code>
  [start of deepspeed/module_inject/containers/vae.py]
  1 # Copyright (c) Microsoft Corporation.
  2 # SPDX-License-Identifier: Apache-2.0
  3 
  4 # DeepSpeed Team
  5 
  6 from ..policy import DSPolicy
  7 from ...model_implementations.diffusers.vae import DSVAE
  8 
  9 
  10 class VAEPolicy(DSPolicy):
  11 
  12     def __init__(self):
  13         super().__init__()
  14         try:
  15             import diffusers
  16             if hasattr(diffusers.models.vae, "AutoencoderKL"):
  17                 self._orig_layer_class = diffusers.models.vae.AutoencoderKL
  18             else:
  19                 # Diffusers >= 0.12.0 changes location of AutoencoderKL
  20                 self._orig_layer_class = diffusers.models.autoencoder_kl.AutoencoderKL
  21         except ImportError:
  22             self._orig_layer_class = None
  23 
  24     def match(self, module):
  25         return isinstance(module, self._orig_layer_class)
  26 
  27     def match_replaced(self, module):
  28         return isinstance(module, DSVAE)
  29 
  30     def apply(self, module, enable_cuda_graph=True):
  31         # TODO(cmikeh2): Enable cuda graph should be an inference configuration
  32         return DSVAE(module, enable_cuda_graph=enable_cuda_graph)
  33 
  34     # NOTE (lekurile): Should we have a diffusers policy class?
  35     def attention(self, client_module):
  36         pass
  37
  [end of deepspeed/module_inject/containers/vae.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/deepspeed/module_inject/containers/vae.py b/deepspeed/module_inject/containers/vae.py
  --- a/deepspeed/module_inject/containers/vae.py
  +++ b/deepspeed/module_inject/containers/vae.py
  @@ -13,11 +13,11 @@
           super().__init__()
           try:
               import diffusers
  -            if hasattr(diffusers.models.vae, "AutoencoderKL"):
  -                self._orig_layer_class = diffusers.models.vae.AutoencoderKL
  +            if hasattr(diffusers.models.autoencoders.vae, "AutoencoderKL"):
  +                self._orig_layer_class = diffusers.models.autoencoders.vae.AutoencoderKL
               else:
                   # Diffusers >= 0.12.0 changes location of AutoencoderKL
  -                self._orig_layer_class = diffusers.models.autoencoder_kl.AutoencoderKL
  +                self._orig_layer_class = diffusers.models.autoencoders.autoencoder_kl.AutoencoderKL
           except ImportError:
               self._orig_layer_class = None
  
verification_info: {"golden_diff": "diff --git a/deepspeed/module_inject/containers/vae.py b/deepspeed/module_inject/containers/vae.py\n--- a/deepspeed/module_inject/containers/vae.py\n+++ b/deepspeed/module_inject/containers/vae.py\n@@ -13,11 +13,11 @@\n         super().__init__()\n         try:\n             import diffusers\n-            if hasattr(diffusers.models.vae, \"AutoencoderKL\"):\n-                self._orig_layer_class = diffusers.models.vae.AutoencoderKL\n+            if hasattr(diffusers.models.autoencoders.vae, \"AutoencoderKL\"):\n+                self._orig_layer_class = diffusers.models.autoencoders.vae.AutoencoderKL\n             else:\n                 # Diffusers >= 0.12.0 changes location of AutoencoderKL\n-                self._orig_layer_class = diffusers.models.autoencoder_kl.AutoencoderKL\n+                self._orig_layer_class = diffusers.models.autoencoders.autoencoder_kl.AutoencoderKL\n         except ImportError:\n             self._orig_layer_class = None\n", "issue": "nv-sd CI test failure\nThe Nightly CI for https://github.com/microsoft/DeepSpeed/actions/runs/7434747598 failed.\n\n", "before_files": [{"content": "# Copyright (c) Microsoft Corporation.\n# SPDX-License-Identifier: Apache-2.0\n\n# DeepSpeed Team\n\nfrom ..policy import DSPolicy\nfrom ...model_implementations.diffusers.vae import DSVAE\n\n\nclass VAEPolicy(DSPolicy):\n\n    def __init__(self):\n        super().__init__()\n        try:\n            import diffusers\n            if hasattr(diffusers.models.vae, \"AutoencoderKL\"):\n                self._orig_layer_class = diffusers.models.vae.AutoencoderKL\n            else:\n                # Diffusers >= 0.12.0 changes location of AutoencoderKL\n                self._orig_layer_class = diffusers.models.autoencoder_kl.AutoencoderKL\n        except ImportError:\n            self._orig_layer_class = None\n\n    def match(self, module):\n        return isinstance(module, self._orig_layer_class)\n\n    def match_replaced(self, module):\n        return isinstance(module, DSVAE)\n\n    def apply(self, module, enable_cuda_graph=True):\n        # TODO(cmikeh2): Enable cuda graph should be an inference configuration\n        return DSVAE(module, enable_cuda_graph=enable_cuda_graph)\n\n    # NOTE (lekurile): Should we have a diffusers policy class?\n    def attention(self, client_module):\n        pass\n", "path": "deepspeed/module_inject/containers/vae.py"}]}