Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Merged
kczimm merged 15 commits intopostgresml:masterfromhiguoxing:set-omp-num-threads
Apr 11, 2024

Conversation

higuoxing
Copy link
Contributor

@higuoxinghiguoxing commentedMar 8, 2024
edited
Loading

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.

higuoxingand others added5 commitsMarch 8, 2024 07:59
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>
@montanalowmontanalow requested a review fromkczimmApril 4, 2024 04:29
@@ -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"
Copy link
Contributor

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.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Done!

Copy link
Contributor

@kczimmkczimm left a 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.

#[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();
Copy link
Contributor

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.

Copy link
Contributor

@kczimmkczimm left a 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.

higuoxingand others added3 commitsApril 11, 2024 07:34
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().
@higuoxing
Copy link
ContributorAuthor

Sorry for the additional suggestions but I think we should be good after this.

No problem! Glad to hear more suggestions from you :-)

@kczimmkczimm merged commitf674f70 intopostgresml:masterApr 11, 2024
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@kczimmkczimmkczimm approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

PostgresML is spawning too many threads.
2 participants
@higuoxing@kczimm

[8]ページ先頭

©2009-2025 Movatter.jp