-
Notifications
You must be signed in to change notification settings - Fork 72
Add an environment variable to disable ort session cache if necessary | fix(atenlib) #685
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
d70ff44
1fadd93
776c041
16244e7
4083b07
a3a4952
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 | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,10 @@ | ||||||
# ------------------------------------------------------------------------- | ||||||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||||||
# Licensed under the MIT License. | ||||||
# -------------------------------------------------------------------------- | ||||||
"""Switches to determine if the corresponding feature of onnxscript is enabled or not.""" | ||||||
|
||||||
import os | ||||||
|
||||||
# By default: Enable | ||||||
CACHE_ORT_SESSIONS: bool = os.getenv("CACHE_ORT_SESSIONS", "1") != "0" | ||||||
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.
Suggested change
sorry - I changed my mind because it looks like it is a flag that can be changed in runtime (not constant), so snake case instead? 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. Is this in 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 opinion is: Such switches should not be exposed to users calling onnx-script ops or torch_libs to construct a model. Because these switches control some internal features of onnx-script only. These internal features are not necessary to be known by those users. 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.
I think a variable in upper case is more like a constant which should not be changed in runtime. Isn't it? And I think this is aligned with the assumption that these switches are designed to be controlled by the environment variable only, so we don't need to change them to snake case. |
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.
consider
flags.py
as in "feature flags"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.
In my past projects, such things which determines if a feature is enable or not were named like "xxxx_switch", so I followed them.
In addition, I think 'switch' implies this can control something while 'flag' is more like a static label.