-
Notifications
You must be signed in to change notification settings - Fork 254
compiler: Minor tweaks to enable integrated NCU-based profiling #2937
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
base: main
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 |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| from .operator import Operator # noqa | ||
| from .profiling import profiler_registry # noqa | ||
| from .profiling import NcuProfiling, profiler_registry # noqa | ||
| from .registry import operator_registry # noqa |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -199,7 +199,14 @@ def init_configuration(configuration=configuration, env_vars_mapper=env_vars_map | |
| # Env variable format: 'var=k1:v1;k2:v2:k3:v3:...' | ||
| keys, values = zip(*[i.split(':') for i in items], strict=True) | ||
| # Casting | ||
| values = [eval(i) for i in values] | ||
| processed = [] | ||
| for i in values: | ||
| try: | ||
| processed.append(eval(i)) | ||
| except (NameError, SyntaxError): | ||
| # Allow unquoted strings as `k:v` values. | ||
| processed.append(i) | ||
| values = processed | ||
| except AttributeError: | ||
|
Contributor
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. Not sure why you need processed and values if you just do values = processed
Contributor
Author
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. there is an |
||
| # Env variable format: 'var=v', 'v' is not a string | ||
| keys = [v] | ||
|
|
||
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.
This could use a try/key error for safety
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.
not necessary, if you're here inside
profiling_preprocessorthe presence ofncu(or any other legal value inprofiler_registry) has already been ensuredgives