minnervva / torchdetscan

This is a tool for finding non-deterministic functions in your pytorch code.
https://github.com/minnervva/torchdetscan
MIT License
1 stars 0 forks source link

torch.nn.functional.interpolate() : Check for function arguments #24

Closed markcoletti closed 6 months ago

markcoletti commented 6 months ago

When attempting to differentiate a CUDA tensor and one of the following modes is used:

We'll assume a tensor is being differentiated since this is a static check, but we can still check for those arguments.

markcoletti commented 6 months ago

It works!

/Users/may/Projects/minnervva/minnervva/venv/bin/python /Users/may/Projects/minnervva/minnervva/minnervva/minnervva.py -v . 
Linting directory: /Users/may/Projects/minnervva/minnervva/tests
Linting file: pytorch_basic.py
Found non-deterministic function kthvalue at line 10, column 0
Found non-deterministic function AvgPool3d at line 12, column 0
Linting file: pytorch_interpolate.py
Found non-deterministic function 'interpolate' with argument 'linear' that makes it nondeterministic at line 21, column 9
Found non-deterministic function 'interpolate' with argument 'bilinear' that makes it nondeterministic at line 22, column 9
Found non-deterministic function 'interpolate' with argument 'bicubic' that makes it nondeterministic at line 24, column 9
Found non-deterministic function 'interpolate' with argument 'trilinear' that makes it nondeterministic at line 25, column 9
Done

Closing and merging this branch.