Repository navigation
Conversation
On an M4 Max the default line claimed CPU 1 through 15 and host CPU 0. An explicit list containing CPU 0 also warned of a conflict. The macOS affinity implementation leaves the threads to the scheduler. Report the count and how macOS places the threads. Register the CPU-only placement test in the Metal build: two placement checks failed before the change and both pass after it.
The M4 Max startup check found 15 workers, with no CPU pins. The engine help still promised exact processor placement. The linked Release executable now describes scheduler placement for both host and workers and the count supplied by a CPU list.
macOS places the host thread and the workers. The launch help, the server config docstring and the --pool-cores section of DETAILS.md now say that on macOS the list only sets the worker count, and DETAILS.md scopes its pinning sentences to Windows and Linux.
On macOS the pool pins nothing, so it no longer warns about the host thread's processor. Say where the warnings apply, and give the macOS form of the start-up line beside placement_line().
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem and result
On macOS, Strata lists specific logical processors for the CPU expert workers and the host thread. With
--pool-cores 0,1, it even warns that a worker competes with the host on processor 0. The macOS implementation ofpin_thread_to_cpu()leaves placement to the scheduler.On my M4 Max, the default pool and a pool started with
--pool-cores 0,1now report, respectively:Related discussion
None.
Approach
On macOS,
ExpertPoolsetspin = false, andgenerate.cppomits its separate processor list.--pool-coresstill sets the default worker count from the distinct usable entries. Invalid IDs can warn and are dropped. If none are usable, automatic sizing applies. A positive--pool-workersoverrides the count.The host-collision check now runs only when the pool pins threads. Windows and Linux engine starts still request pinning. Tests and
bwg_pool_bench --pin 0can request an unpinned pool.Engine and Terminal help, the config docstring,
docs/TERMINAL_LAUNCH.mdanddocs/DETAILS.mdexplain macOS sizing. The Metal build now registerspool_cores_test.Validation
Passed:
dd56c0ecf, rebased onto v0.2.23 (4560d0379), I built and linkedstrataandpool_cores_teston an M4 Max with macOS 27.3, Apple Clang 21.0.0 and Release Metal (-DSTRATA_OWN_CPU_QUANT=ON -DSTRATA_BUILD_TESTS=ON).pool_cores_testreported 16 logical processors and passed. Its two-worker default printed the macOS message, and the list3,1added the sizing note.strata --helpshowed the macOS text for--host-coreand--pool-cores.python tools/settings_register.py --checkexited 0.0,1. That build also included the Windows process-mask and one-CPU-default changes.Failed: Stock
58ee32277printed processor lists on both Macs and warned about processor 0 for0,1.Not run: Windows or Linux builds, or full engine startup with a model. I only compiled the change to the second startup line in
generate.cpp.Limits
Thread placement stays with macOS. The
explicit_cores()comment inpool.hppstill implies pinning, andDETAILS.mdscopes invalid-ID warnings to Windows and Linux even though macOS can emit them. I keptterminal/data/settings-register.jsonout of the diff to avoid line-number churn. Its check verifies setting names only.