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
InferenceMode
No changes are currently included, but it would be good to support InferenceMode too eventually, as it should provide further performance benefits over NoGradMode.
However, it has stricter requirements, and the mode was only added (as a beta) in PyTorch 1.9, so we would need to be careful if we want to support older versions.
"Looking at the docs we'd maybe want to create an optional argument bool :: inference mode and if set to true enable c10::InferenceMode for the function as a block.
The text was updated successfully, but these errors were encountered:
From our benchmarking (see FTorch with InferenceMode and NoGradMode sections), benefits were less clear, but in general it is expected to be at least as fast
Tests were carried out by replacing torch::AutoGradMode enable_grad(requires_grad); with c10::InferenceMode guard(requires_grad); in all ctorch.cpp functions, but ideally both options would be presented to users
This mode was only added (as a beta) in PyTorch 1.9, so we would need to consider support for older versions
The mode is also much stricter than NoGradMode, so cannot be used in all cases
Originally commented by @ElliottKasoar as part of #103
No changes are currently included, but it would be good to support InferenceMode too eventually, as it should provide further performance benefits over NoGradMode.
However, it has stricter requirements, and the mode was only added (as a beta) in PyTorch 1.9, so we would need to be careful if we want to support older versions.
"Looking at the docs we'd maybe want to create an optional argument
bool :: inference mode
and if set to true enablec10::InferenceMode
for the function as a block.The text was updated successfully, but these errors were encountered: