Compact duplicate LoRA adapter tensors - #2195
Draft
hershg wants to merge 3 commits into
Draft
Conversation
hershg
force-pushed
the
optim/glm53-publication
branch
from
September 10, 2026 22:42
0844ae8 to
96275f6
Compare
hershg
force-pushed
the
optim/glm53-publication
branch
from
September 11, 2026 07:55
96275f6 to
73b5bbf
Compare
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
Non-colocated
merge_lora=falsepublication wrote every public LoRA tensor to safetensors independently. GLM-5.3's defaultshare_expert_adapters=trueexport has 116,448 public keys but only 1,545 unique FP32 storages, so the old path serialized and reread about 61.5 GB per update.What changed
This PR contains only the compact-disk optimization. Native NCCL/NIXL transport work is separate.
Matched result
The profiler-identical native GLM-5.3 comparison used the same two-B300 topology, immutable image/runtime pins, 32K workload, rank-32 adapter, target modules, instrumentation, one excluded warmup, and three measured updates.
That is a measured 2.78x speedup.
Rank-0 compact means were:
The retained production artifact was 1,232,385,444 bytes versus 61,521,624,984 bytes for baseline. An independent inspector verified 61,504,339,968 logical FP32 bytes, 1,221,967,872 unique tensor bytes, exact value/layout/alias fingerprints, and independent BF16 conversion storage.
A same-node-pair shared-filesystem control measured:
This explains most of baseline receiver latency as shared-filesystem reading. At compact size, raw reading is only about 5s of the 74.75s receiver RPC, leaving parsing, tensor reconstruction, BF16 materialization, registration, and activation as the main remaining receiver work.
Observed publication GPU peaks did not increase: trainer 225,705 MiB/GPU in both arms; inference 206,291 MiB/GPU baseline and 206,207 MiB/GPU compact. Peak cgroup current fell from 1,404.95 to 1,202.51 GiB on the trainer node and from 1,005.87 to 808.86 GiB on the inference node.
The GLM run completed repeated replacement and sampling, checkpoint, and unload. Its protocol validator accepted six publications and 54 phase records; the trace audit checked 64 inference traces across eight TP ranks and a 3.83-million-event trainer trace.
Scope boundary
This optimization depends on duplicated adapter values. The matched Qwen3-8B updated adapter had no comparable duplication and used the same 349,243,720-byte safetensors representation in both arms:
The single-pair 0.16s difference does not establish a regression. It shows that this optimization provides no benefit when the adapter is not duplicated. The same limitation applies when
trainer.policy.model.lora.share_expert_adapters=false.Correctness and validation
skyrl_tests,check_code_quality,skyrl_train_tests, andskyrl_gym_testson the code head.