You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
i’m really looking forward to working on this integration!
since adding flashpack support will likely require major changes to files such as modeling_utils.py, pipeline_utils.py, and some model-specific loader files,
i wanted to clarify a few things before proceeding:
which direction would you prefer to keep the design consistent with existing patterns?
option a: introduce new methods like from_pretrained_flashpack() and save_pretrained_flashpack()
option b: extend existing methods with a flag, e.g. from_pretrained(..., use_flashpack=True)
which model classes should be prioritized initially?
dit models (e.g. sd3, flux, etc.)
unet models
text encoders (e.g. clip, t5)
thanks! happy to start drafting a proposal or initial pr plan once we align on these points.
i've been exploring this issue as well and have figured out the changes required in modeling_utils.py and pipeline_utils.py that align with option B, mimicking the safetensors implementation
this includes proper fallback mechanisms when Flashpack isn't available and dtype consistency checks in the Flashpack loading block before calling assign_from_file()
@devanshi00 would you be open to collaborating on this?
Hey @devanshi00! I've already drafted the preliminary implementation while exploring this. Would it work if I handle the implementation and you work on the testing? That way we both contribute to important aspects. Let me know if you'd prefer a different split!
Hey @RakshithaKowlikar sure, I hope you have tested in on basic models like flux and there is an improvement in the performance as given in the benchmarking script this. Then I can run it on different models subject to the compute I have. Also please share your pr with me.
Sure @devanshi00! I've already tested it on UNet from Stable Diffusion v1.5 to verify. I’m making a few small changes to the code and will then raise the PR along with a description of the changes here.
Added use_flashpack parameter and conditional block
Added docstring for same
Pass use_flashpack to diffusers models when loading pipelines
Few questions:
The dtype in flashpack model and dtype requested by user (torch_dtype) should be same. For now if they don't match then it falls back to safetensors. Should i remove this and add it to the documentation?
All errors now go to the safetensors fallback since flashpack is an optional method. as of now if any errors the user isn't notified, the process isn't terminated and just silently goes to the safetensors block. Should i use logger.warning() for each possible error?
The loading will lead to problems if a model from transformers is loaded. To combat this i have made changes to pipeline_loading_utils.py. Do we plan to integrate flashpack to transformers repo as well?
Loading UNet from Stable Diffusion v1.5 took 2.39s normally and 1.31s(0.05s to load with flashpack and 1.26s to convert to flashpack format)using flashpack.
This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.
Please note that issues that do not follow the contributing guidelines are likely to be ignored.
#12999 @DN6@yiyixuxu@sayakpaul
I’ve added the experimentation results as part of this PR.
One current limitation is that .flashpack files can’t be uploaded directly to the Hub yet, since push_to_hub=True only supports standard PyTorch / safetensors weights at the moment.
Do we have plans to extend Hub support for flashpack files, or to integrate flashpack more broadly into the transformers repository as well?
Looking forward to your feedback!
This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.
Please note that issues that do not follow the contributing guidelines are likely to be ignored.
Activity
DN6 commentedon Oct 28, 2025
Looking into it :)
devanshi00 commentedon Nov 13, 2025
hi @sayakpaul @yiyixuxu
i’m really looking forward to working on this integration!
since adding flashpack support will likely require major changes to files such as
modeling_utils.py,pipeline_utils.py, and some model-specific loader files,i wanted to clarify a few things before proceeding:
which direction would you prefer to keep the design consistent with existing patterns?
from_pretrained_flashpack()andsave_pretrained_flashpack()from_pretrained(..., use_flashpack=True)which model classes should be prioritized initially?
thanks! happy to start drafting a proposal or initial pr plan once we align on these points.
sayakpaul commentedon Nov 13, 2025
Thanks @devanshi00! Option b sounds good!
RakshithaKowlikar commentedon Nov 13, 2025
hey @sayakpaul @yiyixuxu @DN6
i've been exploring this issue as well and have figured out the changes required in
modeling_utils.pyandpipeline_utils.pythat align with option B, mimicking the safetensors implementationthis includes proper fallback mechanisms when Flashpack isn't available and dtype consistency checks in the Flashpack loading block before calling
assign_from_file()@devanshi00 would you be open to collaborating on this?
RakshithaKowlikar commentedon Nov 21, 2025
Hey @devanshi00! I've already drafted the preliminary implementation while exploring this. Would it work if I handle the implementation and you work on the testing? That way we both contribute to important aspects. Let me know if you'd prefer a different split!
devanshi00 commentedon Nov 21, 2025
Hey @RakshithaKowlikar sure, I hope you have tested in on basic models like flux and there is an improvement in the performance as given in the benchmarking script this. Then I can run it on different models subject to the compute I have. Also please share your pr with me.
RakshithaKowlikar commentedon Nov 22, 2025
Sure @devanshi00! I've already tested it on UNet from Stable Diffusion v1.5 to verify. I’m making a few small changes to the code and will then raise the PR along with a description of the changes here.
RakshithaKowlikar commentedon Nov 24, 2025
hey @sayakpaul @DN6 @yiyixuxu
I have opened a pr for this issue
use_flashpackparameter and conditional blockuse_flashpackto diffusers models when loading pipelinesFew questions:
torch_dtype) should be same. For now if they don't match then it falls back tosafetensors. Should i remove this and add it to the documentation?logger.warning()for each possible error?pipeline_loading_utils.py. Do we plan to integrate flashpack to transformers repo as well?Loading UNet from Stable Diffusion v1.5 took 2.39s normally and 1.31s(0.05s to load with flashpack and 1.26s to convert to flashpack format)using flashpack.
Looking forward to your feedback!
github-actions commentedon Jan 9, 2026
This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.
Please note that issues that do not follow the contributing guidelines are likely to be ignored.
devanshi00 commentedon Jan 19, 2026
#12999
@DN6 @yiyixuxu @sayakpaul
I’ve added the experimentation results as part of this PR.
One current limitation is that .flashpack files can’t be uploaded directly to the Hub yet, since push_to_hub=True only supports standard PyTorch / safetensors weights at the moment.
Do we have plans to extend Hub support for flashpack files, or to integrate flashpack more broadly into the transformers repository as well?
Looking forward to your feedback!
github-actions commentedon Feb 12, 2026
This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.
Please note that issues that do not follow the contributing guidelines are likely to be ignored.
DN6 commentedon Apr 13, 2026
Closing because #12700 was merged.