You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: Zero division in inverse estimator functions (#65)
#### Motivation
Fixes this warning:
```
packages/text_generation_server/utils/memory_characterizer.py:71: RuntimeWarning: invalid value encountered in scalar divide
Shard 0: return (np.sqrt(c0**2 + 4*c1*(mem/batch)) - c0)/(2*c1)
```
#### Modifications
When the memory characterizer doesn't find a linear or quadratic
behavior, the coefficients are set to zero resulting in division by zero
errors in the inverse functions.
In this commit this situation is detected and the max float is returned
to be consistent with the semantics of the memory estimator
Signed-off-by: Max de Bayser <[email protected]>
0 commit comments