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

Using torchsde.BrownianInterval instead of torchsde.BrownianTree in class BatchedBrownianTree #8728

Open
dianyo opened this issue Jun 28, 2024 · 2 comments

Comments

@dianyo
Copy link

dianyo commented Jun 28, 2024

Is your feature request related to a problem? Please describe.
When I was doing some optimization for my pipeline, i found that the BrownianTree somehow took a bit more time.

Describe the solution you'd like.
I further dig into torchsde document, and found that they encouraged to use BrownianInterval to have best benefits for underlying structure utilization. The BrownianTree is actually just an abstraction layer of the BrownianInterval and as we all know, python function calls take time!

Code:

#diffusers/src/diffusers/schedulers/scheduling_dpmsolver_sde.py:41
self.trees = [torchsde.BrownianTree(t0, w0, t1, entropy=s, **kwargs) for s in seed]

# Modified
self.trees = [torchsde.BrownianInterval(t0, t1, size=w0.shape, dtype=w0.dtype, device=w0.device, cache_size=None, entropy=s, **kwargs) for s in seed]

Additional context.
torchsde doc link

@sayakpaul
Copy link
Member

Cc: @yiyixuxu

@dianyo
Copy link
Author

dianyo commented Jul 1, 2024

@sayakpaul @yiyixuxu Any idea on this? This is a low-hanging fruit i think

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

No branches or pull requests

2 participants