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

Lumina cache checkpointing #13

Merged
merged 3 commits into from
Feb 17, 2025
Merged

Conversation

rockerBOO
Copy link

@rockerBOO rockerBOO commented Feb 16, 2025

  • Add cache using strategy and cache to disk
  • Gradient checkpointing
  • Gemma offloading
  • Refactor of Lumina forward to be easier to read
  • FP8 support

I noticed packing latents didn't work and the code didn't seem to reflect it being packed. Left it in the code but commented it out.

This PR implies #12 should go first as it builds off of that branch.

Related: kohya-ss#1927

@rockerBOO
Copy link
Author

From this the model is training and I can load it in comfy and it seems "work" but the result is pretty noisy.

ComfyUI_00031_

The loss when training starts at 2.5ish.

Screenshot 2025-02-16 at 03-32-05 morning-resonance-77 women-flux-kohya-lora – Weights   Biases

I think it's some variable of the noise and time shift.

timestep_sampling = "flux_shift" # and shift
discrete_flow_shift = 3.1582
model_prediction_type = "raw"
guidance_scale = 1.0

Tried these but might be something else needed here.

@rockerBOO
Copy link
Author

ComfyUI_00034_

not setting any of those values seems to do a little better. Also using huber loss with huber_c = 0.2 and huber_scale = 1.8. Trying some others but im mostly just experimenting without really knowing.

@rockerBOO
Copy link
Author

rockerBOO commented Feb 16, 2025

without huber loss (using l2 loss) I think maybe something with the sampler too but a little closer

ComfyUI_00036_

But the loss spiked quite a bit

Screenshot 2025-02-16 at 16-00-02 upbeat-snowflake-80 women-flux-kohya-lora – Weights   Biases

@rockerBOO
Copy link
Author

I tried the packed latents again. Seems it goes through if it packs and not unpack but the results were not good.

@sdbds sdbds merged commit bb7bae5 into sdbds:lumina Feb 17, 2025
1 check 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