Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error When Running Stable-Diffusion Example #1992

Closed
keisuke-niimi-insightedge-jp opened this issue Apr 2, 2024 · 3 comments
Closed

Error When Running Stable-Diffusion Example #1992

keisuke-niimi-insightedge-jp opened this issue Apr 2, 2024 · 3 comments

Comments

@keisuke-niimi-insightedge-jp

I encountered an error while attempting to run the stable-diffusion example as instructed in the README.md. The specific command used was:
cargo run --example stable-diffusion --release --features=cuda,cudnn -- --prompt "a cosmonaut on a horse (hd, realistic, high-def)" --cpu

The execution resulted in the following error:
Error: MatMulUnexpectedStriding { lhs_l: Layout { shape: [1, 1, 4096, 4096], stride: [16777216, 16777216, 4096, 1], start_offset: 0 }, rhs_l: Layout { shape: [1, 1, 4096, 512], stride: [2097152, 512, 512, 1], start_offset: 0 }, bmnk: (1, 4096, 512, 4096), msg: "non-contiguous rhs" }

After thoroughly reviewing the code and the recent changes, I suspect that the error might be related to the changes introduced in the following PR:(c26dd7f). The modifications in this pull request could potentially be causing the non-contiguous memory layout issue indicated by the error message.

I would like to suggest reconsidering the changes made in PR #1943 as a potential solution to this issue.

@LaurentMazare
Copy link
Collaborator

Thanks for reporting this, I've put a quick fix in #1993 , the longer term fix is to have this properly handled in the matmul but that's a bit more work.

@LaurentMazare
Copy link
Collaborator

LaurentMazare commented Apr 2, 2024

Reverted the temporary fix in favor of a proper fix #1998 (that avoids the intermediate copy). It worked fine for me on both cpu and cuda + some tests have been added but let me know if this is still an issue on your side.

@LaurentMazare
Copy link
Collaborator

Closing as hopefully fixed, feel free to reopen if you run into further issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants