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

Check if torch.use_deterministic_algorithms is called #32

Closed markcoletti closed 5 months ago

markcoletti commented 6 months ago

According to the this page, there are a set of functions that become non-deterministic if torch.use_deterministic_algorithms is invoked with True. This means we have to add a whole series of checks for functions if this function is either not invoked or invoked with False.

Note that I'm assuming that a global state is set that is within module scope. That is, since the linter does static checks, we have no good way of knowing if this function is invoked already in a different module. So we have to be "module-oriented" in our static checks. That is, we will check if this function was invoked with True in the current module and if we do not see that in a given module, we will assume that it was not invoked even though in run-time it may have. We will have to make this distinction clear to the end user.