Repository navigation
glm: resolve TF_NCCL_LIB in the shared NCCL library loader - #3106
Open
vdalesandro wants to merge 2 commits into
Open
vdalesandro wants to merge 2 commits into
vdalesandro wants to merge 2 commits into
Conversation
Owner
|
Thanks @vdalesandro, this is a clean fix. Routing One thing before it can land:
Optional:
|
… re-pinned Review follow-up for ashhart#3106. - zig/tests/fixtures/gradient-serving.tsv: the zig/src/cuda/nccl.zig row carries the new hash and this PR's number, so test-gradient-serving passes again. - Library.pathFrom(raw) holds the one rule (a path is kept as written; unset, empty and blank keep libnccl.so.2; a control byte is refused). Library.open applies it to the process environment as before, and fabric/tp/config.zig applies it to its own getter, so a set-but-blank TF_NCCL_LIB no longer opens a blank path there. A malformed value is error.BadSetting, like the other TP settings. Checked on a CPU-only host with Zig 0.17.0: test-gradient-serving (fails before the re-pin with "serving source changed: zig/src/cuda/nccl.zig", passes after), test-tp (the new config test fails on the old line and passes on the new one), test-runtime-host, test-environment-host, the nccl.zig tests, zig fmt --check and the lean check (0 new). No device run.
This branch has not been deployed
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.
Requested separately in #2993 (review by @ashhart).
Change
Native GLM called the shared
cuda.nccl.Library.open(), which always openedlibnccl.so.2, while fabric/tp already selectedTF_NCCL_LIB. Resolve the override in the shared loader so GLM and its sibling callers use the same explicit selection.Callers of
nccl.Library.open()(zig/src/cuda/nccl.zig:80), all verified at these lines in this checkout:zig/src/families/glm/cuda_native.zig:264--tp 2collective:zig/src/families/flashnext/cuda_collective.zig:25zig/src/families/minimax_m3/cuda_native.zig:159zig/src/cuda/tp_group.zig:35Reuse the native environment path validator: unset, empty and whitespace-only values keep
libnccl.so.2; nonblank paths retain their exact bytes; control characters are refused before loading.openPath, required-symbol resolution, cleanup, minimum-version checks and communicator behavior are unchanged.Three existing files change: the loader and its inline CPU regression; one environment rule; one entry in the existing environment valid-case table. No new dependencies or GPU work.
Verification
With the repository's exact Zig 0.17.0, CPU-only:
zig build test-runtime-host: 328/328 tests passed.zig build test-environment-host: 23/23 tests passed.zig build native: 8/8 build steps succeeded; the built executable reportstensorfold-native 1.2.7.zig fmt --checkandgit diff --check: passed.The successful native executable build contains the final production changes. A later rebuild after adding only the environment test's valid-case row exceeded the local 180-second time limit; final runtime/environment tests and formatting/lean replay passed after that row was added. Initial missing sparse-checkout inputs and the test-table coverage failure were corrected; their failing receipts are retained locally.
No GPU, actual NCCL runtime, checkpoint inference, performance, complete no-GPU CI or release qualification is claimed. Native host checks prove path selection and validation, not device execution.
Once this lands, the switchless-ring recipe in #2993 can point at
TF_NCCL_LIBin place ofLD_LIBRARY_PATH.