Conversation
|
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 @sayakpaul what needs to be done prior to merging this PR? |
DN6
left a comment
There was a problem hiding this comment.
Looking good 👍🏽 Some minor comments. Could we also add a test for saving/loading and setting device_map with a dummy model.
Co-authored-by: Dhruv Nair <dhruv.nair@gmail.com>
| if class_name.startswith("FlashPack"): | ||
| class_name = class_name.removeprefix("FlashPack") | ||
|
|
There was a problem hiding this comment.
Don't think this path would ever run since diffusers isn't modifying the class name when saving flash pack models. Think we can remove this.
There was a problem hiding this comment.
The original code modifies the class name when saving models
What does this PR do?
Adds support for FlashPack
FlashPack could be used as weight format only (see:
load_flashpack_checkpoint) - keeping only weight format code would be a cleaner integration, the model loading is indeed faster[1] however part of the performance difference seems to be just due to the complexity of existingfrom_pretrainedcode, for example I noticed that_caching_allocator_warmupslows things down, alsoempty_device_cacheis called in_load_pretrained_modelwhereas FlashPack's code doesn't thus the empty cache time is excluded from FlashPack's benchmark results.is_flashpack_availablecheck logging, etc)silent,num_streams,use_distributed_loadingetc.)Benchmark
Changes from FlashPack's version:
transformersrelated code[1] For
bfloat16- withfloat16existing code appears to be fasterWho can review?
Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.