Skip to content

Dynamic FBcache parameter with nunchaku - #104

Merged
ToTheBeginning merged 1 commit into
bytedance:mainfrom
Bluear7878:feat_fbcache
Aug 14, 2025
Merged

ToTheBeginning merged 1 commit into
bytedance:mainfrom
Bluear7878:feat_fbcache

Conversation

@Bluear7878

Copy link
Copy Markdown
Contributor

Closes #103

This PR introduces support for the dynamic modification of FBCache and DoubleFBCache when utilizing the nunchaku feature. This allows for on-the-fly adjustments of cache thresholds, enabling a dynamic trade-off between inference speed and output quality without needing to restart the application.

🚨 Important Dependency
For this implementation to function correctly, the updates from PR #452 must be applied first. Please ensure that the changes from nunchux-ai/nunchaku#452 are merged before this PR.

Performance was measured on an NVIDIA A5000 GPU.

Additionally, it's worth noting that the efficiency of both FBCache and DoubleFBCache increases with larger step sizes.

FBCache Performance

For FBCache, I evaluated performance based on both residual_diff_threshold and residual_diff_threshold_single.

Inference Time (seconds)
The table below summarizes the inference time for different threshold combinations.

No FBCache (40s) FBCache (th=0.2, 12s) DoubleFBCache (th=0.2/0.2, 12s)

@ToTheBeginning

Copy link
Copy Markdown
Collaborator

I have a question: in the dependencies part, you wrote that it is necessary to ensure this PR is merged. However, I see that this PR has not yet been merged into the nunchaku repository. Will this have any impact?

@Bluear7878

Bluear7878 commented Jul 1, 2025 •

Copy link
Copy Markdown
Contributor Author

I have a question: in the dependencies part, you wrote that it is necessary to ensure this PR is merged. However, I see that this PR has not yet been merged into the nunchaku repository. Will this have any impact?

Yes. this pr requires the code. That PR has not been merged yet because it still has a small amount of memory allocated to the workflow. It does not affect the functionality, but we are working on a fix.

@Bluear7878

Copy link
Copy Markdown
Contributor Author

@ToTheBeginning
it has now been merged into the nunchaku repositor

@Bluear7878

Copy link
Copy Markdown
Contributor Author

Could you please merge this pr?

@ToTheBeginning
ToTheBeginning merged commit 461e35b into bytedance:main Aug 14, 2025
@ToTheBeginning

Copy link
Copy Markdown
Collaborator

@Bluear7878 Thanks for your contribution, merged now. (Sorry for the late reply, I was busy on other projects recent days.

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.

Expose residual_diff_threshold as a configurable parameter in apply_cache_on_pipe

2 participants