-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
[WIP][Torch] Seeds / Determinism #361
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -75,6 +75,23 @@ struct RuntimeOptions | |
|
||
// Whether or not to disable shape and type checking when running inference | ||
bool disable_shape_and_type_checking = false; | ||
|
||
// EXPERIMENTAL | ||
// A seed to use when running a graph | ||
// Note: this currently only applies to TorchScript models | ||
int64_t seed = -1; | ||
|
||
// EXPERIMENTAL | ||
// Whether or not to run in deterministic mode. See https://pytorch.org/docs/stable/notes/randomness.html#cudnn | ||
// Note: this currently only applies to TorchScript models and affects all torchscript models in the process. | ||
// Should only be used with OPE to avoid this issue. | ||
bool torch_cudnn_deterministic = false; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. My personal perferences: Even we know that this is for Torch only for now, I would call it: backends_cudnn_deterministic and backends_cudnn_benchmark. And then comment specifies that currently this is Torch only. So, we are going to add more options probably in future and it is better to keep them generic and name accordingly (if only 1 backend supports it - fine, but it helps to see gaps/difference between backends and even can be a start point to add options to other framework. |
||
|
||
// EXPERIMENTAL | ||
// Whether or not to enable cudnn benchmark. See https://pytorch.org/docs/stable/notes/randomness.html#cudnn | ||
// Note: this currently only applies to TorchScript models and affects all torchscript models in the process. | ||
// Should only be used with OPE to avoid this issue. | ||
bool torch_cudnn_benchmark = false; | ||
}; | ||
|
||
} // namespace neuropod |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we avoid making these calls all-together is a user opted out to reduce a chance of modifying the default behavior?