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

enable directml #356

Merged
merged 24 commits into from
Jan 3, 2025
Merged

enable directml #356

merged 24 commits into from
Jan 3, 2025

Conversation

HPPinata
Copy link
Contributor

This should broaden our compatibility, although with significantly worse performance than native libraries.

ToDo:
Worse Performance shold be documented and advised against, before announcing this.

The PR still needs the knobs and dials to only enable directml under certain conditions, easiest would be an eqivalent to --amd and then maybe another initialization script?

Or maybe think about a way to properly detect what plattform we are running on and go from there?
Having 4 different update-runtime scripts mostly doing the same is getting a bit out of hand...

@HPPinata HPPinata force-pushed the directml branch 4 times, most recently from 4963ba4 to a8fe38f Compare November 26, 2024 20:46
@HPPinata HPPinata marked this pull request as ready for review November 30, 2024 10:12
@HPPinata
Copy link
Contributor Author

@tazlin here I'd like a thorough review.
I don't really know what I'm doing in Python, so this is basically just copy/paste and google-fu.

I got it to a state where it works locally, but only if I set safety_on_gpu: false and as I already mentioned Flux.1 also doesn't work because of the datatypes it's using.

The update.cmd and bridge.cmd scripts are copy/pastes of the cuda version with minimally different requirements/arguments (this could potentially be solved more elegantly...)

I'll write some user documentation when I know the core logic is actually working as best it can.
Speed and VRAM usage is still atrocious, but that can be tackled later (if there even is a fix for that at all...).

As for the commit history: I can clean that up before the merge, everything up to pass directml is essentially testing whether it works at all, everything after is me trying to do things "properly"

@HPPinata
Copy link
Contributor Author

HPPinata commented Jan 3, 2025

I've finally gotten around to doing some more stress testing and writing the necessary docs. The main Readme.md rewrite really is a big improvement for more clearly separating steps and is a lot easier to extend/link back to.

@tazlin this should be ready to merge.

This would flow very naturally with the main Readme.md, but I've decided to (at least partially) separate it since this is still very experimental (not to mention slow).

Small sidenote: Support for Docker on Windows was planned, but isn't implemented yet, I've removed that mention from the AMD on Windows section for now.

Copy link
Member

@tazlin tazlin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Runs as expected (though at the documented severely reduced inference speed compared to CUDA), code changes are not expected to impact any other use case at this time as they are narrow in scope.

I do sense that the increased number of requirements.x.txt files for each backend is going to be an issue at some point, but with the testing in place to check for consistency, I'm satisfied with the approached until a better one can be identified (perhaps using uv)

@tazlin tazlin merged commit 4255baa into Haidra-Org:main Jan 3, 2025
4 checks passed
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

Successfully merging this pull request may close these issues.

2 participants