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

Incorrect brownian parameters #6474

Open
gremlation opened this issue Jan 15, 2025 · 1 comment
Open

Incorrect brownian parameters #6474

gremlation opened this issue Jan 15, 2025 · 1 comment
Labels
Potential Bug User is reporting a bug. This should be tested.

Comments

@gremlation
Copy link

Expected Behavior

No warnings.

Actual Behavior

It seems incorrect parameters are being passed into torchsde.BrownianTree here:

def __call__(self, t0, t1):

I receive a warning in the terminal stating:

UserWarning: Should have tb<=t1 but got tb=14.614644050598145 and t1=14.614643.

This is the relevant code:

def __call__(self, t0, t1):
    t0, t1, sign = self.sort(t0, t1)
    if self.cpu_tree:
        w = torch.stack([tree(t0.cpu().float(), t1.cpu().float()).to(t0.dtype).to(t0.device) for tree in self.trees]) * (self.sign * sign)
    else:
        w = torch.stack([tree(t0, t1) for tree in self.trees]) * (self.sign * sign)

    return w if self.batched else w[0]

At the point the warning is generated, these values are present:

t0 = tensor(8.3726, device='mps:0')
t1 = tensor(14.6146, device='mps:0')
sign = -1
self.trees = [BrownianTree(interval=BrownianInterval(t0=0.029, t1=14.615, size=(1, 4, 144, 112), dtype=torch.float32, device=device(type='cpu'), entropy=0, dt=None, tol=1e-06, pool_size=24, cache_size=45, levy_area_approximation='none'))]

Steps to Reproduce

Generate an image using dpmpp_sde or dpmpp_sde_gpu on macOS / Apple silicon.

Debug Logs

See above.

Other

This is with master, currently at cba58fff0bfebfc81fbe678bb80491890a3df14a.

@gremlation gremlation added the Potential Bug User is reporting a bug. This should be tested. label Jan 15, 2025
@gremlation
Copy link
Author

Also logged as an issue upstream:

google-research/torchsde#152

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Potential Bug User is reporting a bug. This should be tested.
Projects
None yet
Development

No branches or pull requests

1 participant