- Notifications
You must be signed in to change notification settings - Fork328
Allow user to limit the number of threads that OpenMP spawns.#1362
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Managing GUC parameters in different places is hard to maintain. Thispatch organizes GUC definitions in a single place. Also, we usedefine_xxx_guc() APIs to define these parameters and it will allow usto manage GucContext, GucFlags in future.P.S., the test case test_trusted_model doesn't seem correct. I fixed itin this patch.
This patch introduces a new GUC parameter pgml.omp_num_threads tocontrol control the number of threads that OpenMP can spawn.Co-authored-by: Xuebin Su <sxuebin@vmware.com>Co-authored-by: Xuebin Su (苏学斌) <12034000+xuebinsu@users.noreply.github.com>
pgml-extension/Cargo.toml Outdated
@@ -49,6 +49,7 @@ serde = { version = "1.0" } | |||
serde_json = { version = "1.0", features = ["preserve_order"] } | |||
typetag = "0.2" | |||
xgboost = { git = "https://github.com/postgresml/rust-xgboost", branch = "master" } | |||
lazy_static = "1.4.0" |
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.
We can use theonce_cell::sync::Lazy
since we already have that dependency, rather than adding a new one.
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.
Done!
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
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.
Sorry for the additional suggestions but I think we should be good after this.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
pgml-extension/src/lib.rs Outdated
#[cfg(not(feature = "use_as_lib"))] | ||
#[pg_guard] | ||
pub extern "C" fn _PG_init() { | ||
config::initialize_server_params(); | ||
let omp_num_threads = config::PGML_OMP_NUM_THREADS.get(); |
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.
I think we should move this get/set into theconfig::initialize_server_params()
also. It's specifically configuration.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
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.
Sorry for the additional suggestions but I think we should be good after this.
Co-authored-by: kczimm <4733573+kczimm@users.noreply.github.com>
Co-authored-by: kczimm <4733573+kczimm@users.noreply.github.com>
- Set the minimum value of OMP_NUM_THREADS to 1.- Move PGML_OMP_NUM_THREADS.get() into initialize_server_params().
No problem! Glad to hear more suggestions from you :-) |
Uh oh!
There was an error while loading.Please reload this page.
This patch introduces a new GUC parameter pgml.omp_num_threads to
control control the number of threads that OpenMP can spawn.
This PR contains 2 commits. The first one is refactoring the GUC parameters of pgml (#1360). The second one is for allowing user to control the number of threads that OpenMP can spawn.
Fixes#1161
Depends on#1360 which helps manage GUC parameters better.