Skip to content
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

Use environment variables to set thresholds in static yaml configurations #1389

Merged
merged 4 commits into from
Oct 21, 2024

Conversation

amahussein
Copy link
Collaborator

@amahussein amahussein commented Oct 21, 2024

Signed-off-by: Ahmed Hussein [email protected]

Fixes #1387

This code change aims at parsing yaml configuration file and resolving the environment variables.

  • spillThresholdBytes defined in qualification-conf.yaml can be overridden by an env-var RAPIDS_USER_TOOLS_SPILL_BYTES_THRESHOLD.
  • totalCoreSecThreshold defined in qualification-conf.yaml can be overridden by an env-var RAPIDS_USER_TOOLS_CORE_SECONDS_THRESHOLD.

These changes improve the flexibility and maintainability of the configuration management in the user_tools package.

Usage:

export RAPIDS_USER_TOOLS_CORE_SECONDS_THRESHOLD=1024
spark_rapids <args>

Code changes

This pull request introduces several changes to the user_tools package, mainly focusing on dependency updates and configuration management enhancements. The key changes include updating dependencies in pyproject.toml, integrating the pyaml_env library for environment variable parsing in YAML files, and modifying configuration files to support environment variable substitution.

Documentation Update

Filed an issue internally to add the new env_variables to the documentation

Dependency updates and integration:

  • user_tools/pyproject.toml: Updated the pyYAML dependency to a version range and added pyaml_env to handle environment variables in YAML files.

Code changes for environment variable parsing:

Configuration file enhancements:

…ions

Signed-off-by: Ahmed Hussein <[email protected]>

Fixes NVIDIA#1387

This code change aims at parsing yaml configuration file and resolving
the environment variables.
- `spillThresholdBytes` defined in qualification-conf.yaml can be
  overridden by an env-var `RAPIDS_USER_TOOLS_SPILL_BYTES_THRESHOLD`.
- `totalCoreSecThreshold` defined in qualification-conf.yaml can be
  overridden by an env-var `RAPIDS_USER_TOOLS_CORE_SECONDS_THRESHOLD`.

Usage:

```
export RAPIDS_USER_TOOLS_CORE_SECONDS_THRESHOLD=1024
spark_rapids <args>
```
@amahussein amahussein marked this pull request as ready for review October 21, 2024 14:56
@amahussein amahussein self-assigned this Oct 21, 2024
@amahussein amahussein added cicd user_tools Scope the wrapper module running CSP, QualX, and reports (python) build labels Oct 21, 2024
@amahussein
Copy link
Collaborator Author

CC: @viadea FYI to control spillThreshold or coreSeconds in a specific environment.

Copy link
Collaborator

@tgravescs tgravescs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

overall looks good. are we documenting these for user, or mean for more advanced configuration?

user_tools/src/spark_rapids_pytools/common/prop_manager.py Outdated Show resolved Hide resolved
@amahussein amahussein added the dependencies Pull requests that update a dependency file label Oct 21, 2024
Signed-off-by: Ahmed Hussein <[email protected]>
tgravescs
tgravescs previously approved these changes Oct 21, 2024
@amahussein
Copy link
Collaborator Author

overall looks good. are we documenting these for user, or mean for more advanced configuration?

It is meant for advanced configuration.
We have an internal issue opened to document all the environment-variables. Thus, if users need specific tuning for their environment we can point them to the env-variables.

Signed-off-by: Ahmed Hussein <[email protected]>
Copy link
Collaborator

@parthosa parthosa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @amahussein. This is an interesting approach. During runtime, we can configure our configs.

This will also be helpful if we want to configure other thresholds in future (such as Top Candidate cut-off speedup etc)

@amahussein amahussein merged commit 88b37bf into NVIDIA:dev Oct 21, 2024
14 checks passed
@amahussein amahussein deleted the rapids-tools-1387 branch October 21, 2024 18:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build cicd dependencies Pull requests that update a dependency file user_tools Scope the wrapper module running CSP, QualX, and reports (python)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEA] Use environment variables to set thresholds in static yaml configurations
3 participants