Skip to content

[perf] Cache physical CPU count for PyTorch thread limiting - #226

Merged
0oshowero0 merged 1 commit into
Ascend:mainfrom
dodatboii:perf/cache-physical-cpu-count
Nov 26, 2026
Merged

0oshowero0 merged 1 commit into
Ascend:mainfrom
dodatboii:perf/cache-physical-cpu-count

Conversation

@dodatboii

@dodatboii dodatboii commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

After #228 moved SimpleStorage worker thread configuration to startup, the client still queries CPU topology on every async_put() and async_get_data() call through limit_pytorch_auto_parallel_threads().

Cache the CPU count once at module import to remove these repeated queries from the client-side data transfer paths. he cached count assumes CPU topology remains stable during runtime.

Previously tested on a verl ref worker: tq.get() time 5.69s → 0.23s per step; tq.put() time 6.28s → 1.52s per step.

@renjunying2

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-26T03:49:39.309341Z ebeed7a PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Query the physical CPU count once at module import instead of on every entry to `limit_pytorch_auto_parallel_threads`, avoiding repeated CPU topology queries on data transfer paths. The cached count assumes CPU topology remains stable during runtime.
Tested on verl ref worker: tq.get() time **5.69s -> 0.23s per step**; tq.put() time **6.28s -> 1.52s per step**

Signed-off-by: dodatboii <[email protected]>
@dodatboii
dodatboii force-pushed the perf/cache-physical-cpu-count branch from ebeed7a to b417163 Compare November 26, 2026 11:21
@0oshowero0
0oshowero0 merged commit 03eb7f4 into Ascend:main Nov 26, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants