crowsonkb / k-diffusion

Karras et al. (2022) diffusion models for PyTorch
MIT License
2.31k stars 375 forks source link

About missing "ctx" argument in autograd function "ApplyRotaryEmbeddingInplace" #112

Open sairights opened 2 months ago

sairights commented 2 months ago

Thanks for opensourcing your great work HDiT! In https://github.com/crowsonkb/k-diffusion/blob/21d12c91ad4550e8fcf3308ff9fe7116b3f19a08/k_diffusion/models/image_transformer_v2.py#L204, it seems that the ctx is missing. But strangely, the function could run smoothly without the ctx argument on PyTorch 2.1. As I switch to PyTorch-1.12, the code is not runnable. I am wondering about the reason...