Build with CUDA 12.8, hermetic build env using nix flake, ability to use upstream sentencepiece, use upstream NCCL#1041
Open
robinp wants to merge 3 commits into
Open
Build with CUDA 12.8, hermetic build env using nix flake, ability to use upstream sentencepiece, use upstream NCCL#1041robinp wants to merge 3 commits into
robinp wants to merge 3 commits into
Conversation
added 3 commits
February 27, 2026 20:12
This lets use of newer sentencepiece with bugfixes etc.
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.
Description
Probably a too big change in once, so opening rather to document how these things can be done, for cherry-picking in case someone is interested.
How to test
Install the nix package manager, then get a shell using
nix develop- this will compile with the cmake settings as set inflake.nix. Only a devShell is added, but adding an output that produces the built binaries wouldn't be too hard (would need pinning the submodules etc though?).TESTED=compiled & exercised training and translation on Linux in the hermetic Nix devShell. (
flake.lockcurrently locks this to a nixos-unstable package state where CUDA 12.8 is the current).See the README addition for detail on how to build and run with Nix, and why you need to symlink
libcuda.so.1into a separate directory to be put on theLD_LIBRARY_PATH, but the TLDR is:nix \ --extra-experimental-features nix-command \ --extra-experimental-features flakes \ develop # in the shell: # replace LD_LIBRARY_PATH dir with wherever you have put a symlink for libcuda.so.1 (and maybe libnvidia....so..), see README LD_LIBRARY_PATH=/run/nvidia-libs marian translate ...Some notable changes
Minor changes
Quirks
USE_STATIC_LIBSmode, but I don't understand why. So forcing that (new) CMAKE codepath disabled, and even in static build mode, the upstream sentencepiece is linked to dynamically now.pkgs.cudaPackages.cudadnnto the flake.nix.Checklist